added comment area & post view & time-spend

pull/49/head
A1Gard 5 months ago
parent b42e1b460d
commit 1733b9c1c1

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

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

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

@ -3,12 +3,15 @@
<div class="p-2">
<h1>
{{$post->title}}
<span class="float-end text-muted">
Time spend: {{$post->spendTime()}}
</span>
</h1>
<img src="{{$post->orgUrl()}}" alt="" class="img-fluid">
<p class="text-muted my-3">
{{$post->subtitle}}
</p>
<div class="row">
<div class="row text-center">
<div class="col-md">
<i class="ri-calendar-line"></i>
{{$post->created_at->ldate('Y/m/d H:i')}}
@ -17,15 +20,21 @@
<i class="ri-message-line"></i>
{{number_format($post->approvedComments()->count())}}
</div>
<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 class="col-md">
<i class="ri-eye-line"></i>
{{number_format($post->view)}}
</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>
<hr>
{!! $post->body !!}

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 305 KiB

After

Width:  |  Height:  |  Size: 312 KiB

Loading…
Cancel
Save