Skip to content

Commit 94aeca2

Browse files
authored
init
1 parent 0028362 commit 94aeca2

File tree

5 files changed

+71
-28
lines changed

5 files changed

+71
-28
lines changed

modules/Article/Resources/views/frontend/posts/index.blade.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
@endphp
4040
<x-frontend.list
4141
:url="$detail_url"
42-
:name="$$module_name_singular->name"
42+
:title="$$module_name_singular->name"
4343
:image="$$module_name_singular->featured_image"
4444
>
4545
@if($$module_name_singular->created_by_alias)
@@ -68,15 +68,21 @@
6868
<span class="w-6">
6969
<i class="fa fa-fw fa-folder-open"></i>
7070
</span>
71-
<x-frontend.badge :url="route('frontend.categories.show', [encode_id($$module_name_singular->category_id), $$module_name_singular->category->slug])" :text="$$module_name_singular->category_name" />
71+
<x-frontend.badge
72+
:url="route('frontend.categories.show', [encode_id($$module_name_singular->category_id), $$module_name_singular->category->slug])"
73+
:text="$$module_name_singular->category_name"
74+
/>
7275
</div>
7376
@if(count($$module_name_singular->tags))
7477
<div class="flex flex-row items-center">
7578
<span class="w-6">
7679
<i class="fa fa-tag"></i>
7780
</span>
7881
@foreach ($$module_name_singular->tags as $tag)
79-
<x-frontend.badge :url="route('frontend.tags.show', [encode_id($tag->id), $tag->slug])" :text="$tag->name" />
82+
<x-frontend.badge
83+
:url="route('frontend.tags.show', [encode_id($tag->id), $tag->slug])"
84+
:text="$tag->name"
85+
/>
8086
@endforeach
8187
</div>
8288
@endif

modules/Page/Resources/views/frontend/pages/index.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
$detail_url = route("frontend.$module_name.show",[encode_id($$module_name_singular->id), $$module_name_singular->slug]);
2929
@endphp
3030

31-
<x-frontend.list :url="$detail_url" :name="$$module_name_singular->name">
31+
<x-frontend.list :url="$detail_url" :title="$$module_name_singular->name">
3232
<p class="mb-3 font-normal text-gray-700 dark:text-gray-400">
3333
{{$$module_name_singular->description}}
3434
</p>

resources/assets/css/app-frontend.scss

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ a {
125125
*/
126126

127127
.flex-0-0-24 {
128-
flex: 0 0 100px;
128+
flex: 0 0 24px;
129129
}
130130

131131
.flex-0-0-48 {
@@ -140,6 +140,14 @@ a {
140140
flex: 0 0 200px;
141141
}
142142

143+
.flex-0-0-300 {
144+
flex: 0 0 300px;
145+
}
146+
147+
.flex-0-0-400 {
148+
flex: 0 0 400px;
149+
}
150+
143151
/**
144152
* Button
145153
* =========================================================================
Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,33 @@
1-
@props(['url', 'name', 'image'=>''])
1+
@props(['url', 'title', 'image'=>''])
22

3-
<div class="bg-white border border-gray-200 rounded-lg shadow hover:shadow-lg dark:bg-gray-800 dark:border-gray-700">
4-
@if ($image)
5-
<div class="rounded-t-lg overflow-hidden">
3+
<div class="flex flex-row items-center bg-white border border-gray-200 rounded-lg shadow hover:shadow-lg dark:bg-gray-800 dark:border-gray-700">
4+
<div class="flex-0-0-300 mx-4">
65
<a href="{{$url}}">
7-
<img class="rounded-t-lg transform hover:scale-110 duration-300" src="{{$image}}" alt="{{$name}}">
6+
@if ($image)
7+
<img class="transform hover:scale-110 duration-300" src="{{$image}}" alt="{{$title}}">
8+
@else
9+
<x-image-placeholder width='300' height='200' text="Costar" class="transform hover:scale-110 duration-300" />
10+
@endif
811
</a>
912
</div>
10-
@endif
11-
<div class="mt-5 px-5">
12-
<a href="{{$url}}">
13-
<h5 class="mb-2 sm:mb-4 text-lg sm:text-xl font-semibold tracking-tight text-gray-900">
14-
{{$name}}
15-
</h5>
16-
</a>
17-
</div>
18-
<div class="px-5 mb-2 sm:mb-4 font-normal text-sm sm:text-base">
19-
{!! $slot !!}
20-
</div>
21-
<div class="px-5 text-end pb-5">
22-
<a href="{{$url}}" class="inline-flex items-center text-sm text-gray-700 hover:text-gray-100 bg-gray-200 hover:bg-gray-700 py-2 px-3 rounded">
23-
{{__("View details")}}
24-
<svg class="ml-2 -mr-1 w-4 h-4" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
25-
<path fill-rule="evenodd" d="M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z" clip-rule="evenodd"></path>
26-
</svg>
27-
</a>
13+
<div class="flex flex-col flex-1">
14+
<div class="mt-5 px-5">
15+
<a href="{{$url}}">
16+
<h5 class="mb-2 sm:mb-4 text-lg sm:text-xl font-semibold tracking-tight text-gray-900">
17+
{{$title}}
18+
</h5>
19+
</a>
20+
</div>
21+
<div class="px-5 mb-2 sm:mb-4 font-normal text-sm sm:text-base">
22+
{!! $slot !!}
23+
</div>
24+
<div class="px-5 text-end pb-5">
25+
<a href="{{$url}}" class="inline-flex items-center text-sm text-gray-700 hover:text-gray-100 bg-gray-200 hover:bg-gray-700 py-2 px-3 rounded">
26+
{{__("View details")}}
27+
<svg class="ml-2 -mr-1 w-4 h-4" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
28+
<path fill-rule="evenodd" d="M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z" clip-rule="evenodd"></path>
29+
</svg>
30+
</a>
31+
</div>
2832
</div>
2933
</div>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@props([
2+
'width' => '600',
3+
'height' => '400',
4+
'text' => '600x400',
5+
'bgColor' => '#ddd',
6+
'fontColor' => '#fff',
7+
'fontSize' => '56px',
8+
'class' => 'image-placeholder',
9+
])
10+
<svg
11+
xmlns="http://www.w3.org/2000/svg"
12+
width="{{$width}}"
13+
height="{{$height}}"
14+
class="{{$class}}"
15+
>
16+
<rect x="0" y="0" width="{{$width}}" height="{{$height}}" fill="{{$bgColor}}"/>
17+
<text
18+
x="50%"
19+
y="50%"
20+
style="{{'dominant-baseline:middle;text-anchor:middle;font-size:'.$fontSize}}"
21+
fill="{{$fontColor}}"
22+
>
23+
{{$text}}
24+
</text>
25+
</svg>

0 commit comments

Comments
 (0)