added comment area & post view & time-spend

master
A1Gard 3 months ago
parent b42e1b460d
commit 1733b9c1c1

@ -17,6 +17,7 @@ class Area extends Model
'categories', 'categories',
'categories_page', 'categories_page',
'category', 'category',
'comments',
'clip', 'clip',
'clips', 'clips',
'comments', 'comments',

@ -87,7 +87,7 @@ class Post extends Model implements HasMedia
$word = strlen(strip_tags($this->body)); $word = strlen(strip_tags($this->body));
$m = ceil($word / 1350); $m = ceil($word / 1350);
return $m . ' ' . __('minute'); return $m . ' ' . __('minute(s)');
} }

@ -27,9 +27,9 @@ class AreaSeeder extends Seeder
[ [
'name' => 'index', 'name' => 'index',
'valid_segments' => json_encode( 'valid_segments' => json_encode(
["top","slider","header","footer","menu", ["top", "slider", "header", "footer", "menu",
"parallax","other","posts","products","attachments" "parallax", "other", "posts", "products", "attachments"
,"groups","categories","category","group","index"] , "groups", "categories", "category", "group", "index"]
), ),
'max' => 10, 'max' => 10,
'preview' => 'client.welcome', 'preview' => 'client.welcome',
@ -38,15 +38,15 @@ class AreaSeeder extends Seeder
[ [
'name' => 'post', 'name' => 'post',
'valid_segments' => json_encode( 'valid_segments' => json_encode(
["top","header","footer","menu", ["top", "header", "footer", "menu",
"parallax","other","post"] "parallax", "other", "post", "comments"]
), ),
'max' => 6, 'max' => 6,
'preview' => 'client.post', 'preview' => 'client.post',
'icon' => 'ri-layout-top-2-line', 'icon' => 'ri-layout-top-2-line',
], ],
]; ];
foreach ($areas as $area){ foreach ($areas as $area) {
$a = new Area(); $a = new Area();
$a->name = $area['name']; $a->name = $area['name'];
$a->max = $area['max']; $a->max = $area['max'];

@ -3,12 +3,15 @@
<div class="p-2"> <div class="p-2">
<h1> <h1>
{{$post->title}} {{$post->title}}
<span class="float-end text-muted">
Time spend: {{$post->spendTime()}}
</span>
</h1> </h1>
<img src="{{$post->orgUrl()}}" alt="" class="img-fluid"> <img src="{{$post->orgUrl()}}" alt="" class="img-fluid">
<p class="text-muted my-3"> <p class="text-muted my-3">
{{$post->subtitle}} {{$post->subtitle}}
</p> </p>
<div class="row"> <div class="row text-center">
<div class="col-md"> <div class="col-md">
<i class="ri-calendar-line"></i> <i class="ri-calendar-line"></i>
{{$post->created_at->ldate('Y/m/d H:i')}} {{$post->created_at->ldate('Y/m/d H:i')}}
@ -17,15 +20,21 @@
<i class="ri-message-line"></i> <i class="ri-message-line"></i>
{{number_format($post->approvedComments()->count())}} {{number_format($post->approvedComments()->count())}}
</div> </div>
<div class="col-md-6"> <div class="col-md">
{{__("Tags")}}: <i class="ri-eye-line"></i>
@foreach($post->tags as $tag) {{number_format($post->view)}}
<a href="{{route('client.tag',$tag->slug)}}" class="tag me-2">
<i class="ri-price-tag-line"></i>
{{$tag->name}}
</a>
@endforeach
</div> </div>
@if($post->tags()->count() > 0)
<div class="col-md-6">
{{__("Tags")}}:
@foreach($post->tags as $tag)
<a href="{{route('client.tag',$tag->slug)}}" class="tag me-2">
<i class="ri-price-tag-line"></i>
{{$tag->name}}
</a>
@endforeach
</div>
@endif
</div> </div>
<hr> <hr>
{!! $post->body !!} {!! $post->body !!}

@ -4,6 +4,12 @@
font-size: 27px; font-size: 27px;
padding: 1rem; padding: 1rem;
color: var(--xshop-primary); color: var(--xshop-primary);
span{
font-size: 16px;
margin-top: 5px;
display: inline-block;
}
} }
img{ img{

Binary file not shown.

Before

Width:  |  Height:  |  Size: 305 KiB

After

Width:  |  Height:  |  Size: 312 KiB

Loading…
Cancel
Save