Skip to content

Commit 24e9686

Browse files
committed
Update embeds handling
1 parent 4fbf8bd commit 24e9686

27 files changed

Lines changed: 192 additions & 287 deletions

ide.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "https://laravel-ide.com/schema/laravel-ide-v2.json",
3+
"view": {
4+
"paths": [
5+
{
6+
"path": "./resources/views",
7+
"namespace": "ozu"
8+
}
9+
]
10+
},
11+
"blade": {
12+
"components": {
13+
"viewPaths": [
14+
{
15+
"path": "src/View/Components/Content",
16+
"namespace": "ozu-content"
17+
}
18+
]
19+
}
20+
}
21+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@php
2+
/**
3+
* @var \Code16\OzuClient\Eloquent\Media $fileModel
4+
*/
5+
@endphp
6+
7+
<p>
8+
<a href="{{ $fileModel->downloadUrl() }}" download="{{ $name }}" target="_blank">
9+
{{ $legend ?? $name }}
10+
</a>
11+
</p>

resources/views/components/embedded-image.blade.php renamed to resources/views/components/embeds/ozu-content-image.blade.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
@php use Code16\OzuClient\Eloquent\Media; @endphp
2-
@props([
3-
/** @var Media $fileModel */
4-
'fileModel',
5-
'legend' => null,
6-
])
1+
@php
2+
/**
3+
* @var \Code16\OzuClient\Eloquent\Media $fileModel
4+
*/
5+
@endphp
6+
77
<figure>
88
<img src="{{ $fileModel->thumbnail($thumbnailWidth, $thumbnailHeight) }}" {{ $attributes }}>
99
@if($legend)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@props([
2+
'author' => null,
3+
])
4+
<figure>
5+
<blockquote style="padding-left: 1rem; border-left: 3px solid #ccc">
6+
{{ $slot }}
7+
</blockquote>
8+
9+
@if($author)
10+
<figcaption>
11+
{{ $author }}
12+
</figcaption>
13+
@endif
14+
</figure>
15+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@props([
2+
'url',
3+
'legend' => null,
4+
])
5+
<figure>
6+
<x-embed-video :url="$url" />
7+
8+
@if($legend)
9+
<figcaption>
10+
{{ $legend }}
11+
</figcaption>
12+
@endif
13+
</figure>

resources/views/components/file.blade.php

Lines changed: 0 additions & 11 deletions
This file was deleted.

resources/views/components/image.blade.php

Lines changed: 0 additions & 9 deletions
This file was deleted.

resources/views/components/quote.blade.php

Lines changed: 0 additions & 12 deletions
This file was deleted.

resources/views/components/video.blade.php

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/Eloquent/Media.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function thumbnail(?int $width = null, ?int $height = null, bool $fit = f
4040
->make($width, $height, $fit);
4141
}
4242

43-
public function download(): ?string
43+
public function downloadUrl(): ?string
4444
{
4545
return app(Thumbnail::class)
4646
->forMedia($this)

0 commit comments

Comments
 (0)