From cf9514e3dc6a29b61ba6ebbb6fbc6b13be03ae81 Mon Sep 17 00:00:00 2001 From: A1Gard Date: Fri, 26 Jul 2024 22:52:31 +0330 Subject: [PATCH] added post sidebar theme part --- app/Http/Controllers/ClientController.php | 4 ++ .../post/PostSidebar/PostSidebar.blade.php | 58 ++++++++++++++++ .../segments/post/PostSidebar/PostSidebar.js | 1 + .../post/PostSidebar/PostSidebar.json | 10 +++ .../segments/post/PostSidebar/PostSidebar.php | 30 ++++++++ .../post/PostSidebar/PostSidebar.scss | 68 +++++++++++++++++++ .../post/PostSidebar/inc/sidebar.blade.php | 44 ++++++++++++ routes/web.php | 1 + 8 files changed, 216 insertions(+) create mode 100644 resources/views/segments/post/PostSidebar/PostSidebar.blade.php create mode 100644 resources/views/segments/post/PostSidebar/PostSidebar.js create mode 100644 resources/views/segments/post/PostSidebar/PostSidebar.json create mode 100644 resources/views/segments/post/PostSidebar/PostSidebar.php create mode 100644 resources/views/segments/post/PostSidebar/PostSidebar.scss create mode 100644 resources/views/segments/post/PostSidebar/inc/sidebar.blade.php diff --git a/app/Http/Controllers/ClientController.php b/app/Http/Controllers/ClientController.php index eb41d96..75daeeb 100644 --- a/app/Http/Controllers/ClientController.php +++ b/app/Http/Controllers/ClientController.php @@ -72,4 +72,8 @@ class ClientController extends Controller return redirect()->back()->with(['message' => __('Your comment has been submitted')]); } + + public function search(Request $request){ + + } } diff --git a/resources/views/segments/post/PostSidebar/PostSidebar.blade.php b/resources/views/segments/post/PostSidebar/PostSidebar.blade.php new file mode 100644 index 0000000..9dfa796 --- /dev/null +++ b/resources/views/segments/post/PostSidebar/PostSidebar.blade.php @@ -0,0 +1,58 @@ +
+
+ + @if(!getSetting($data->area->name.'_'.$data->part.'_invert')) +
+ @include('segments.post.PostSidebar.inc.sidebar') +
+ @endif +
+
+

+ {{$post->title}} + + Time spend: {{$post->spendTime()}} + +

+ +

+ {{$post->subtitle}} +

+
+
+ + {{$post->created_at->ldate('Y/m/d H:i')}} +
+
+ + {{number_format($post->approvedComments()->count())}} +
+
+ + {{number_format($post->view)}} +
+ @if($post->tags()->count() > 0) +
+ {{__("Tags")}}: + @foreach($post->tags as $tag) + + + {{$tag->name}} + + @endforeach +
+ @endif +
+
+ {!! $post->body !!} +
+ +
+ @if(getSetting($data->area->name.'_'.$data->part.'_invert')) +
+ @include('segments.post.PostSidebar.inc.sidebar') +
+ @endif +
+
+
diff --git a/resources/views/segments/post/PostSidebar/PostSidebar.js b/resources/views/segments/post/PostSidebar/PostSidebar.js new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/resources/views/segments/post/PostSidebar/PostSidebar.js @@ -0,0 +1 @@ + diff --git a/resources/views/segments/post/PostSidebar/PostSidebar.json b/resources/views/segments/post/PostSidebar/PostSidebar.json new file mode 100644 index 0000000..7478129 --- /dev/null +++ b/resources/views/segments/post/PostSidebar/PostSidebar.json @@ -0,0 +1,10 @@ +{ + "name": "PostSidebar", + "version": "1.0", + "author": "xStack", + "email": "xshop@xstack.ir", + "license": "GPL-3.0-or-later", + "url": "https:\/\/xstack.ir", + "author_url": "https:\/\/4xmen.ir", + "packages": [] +} \ No newline at end of file diff --git a/resources/views/segments/post/PostSidebar/PostSidebar.php b/resources/views/segments/post/PostSidebar/PostSidebar.php new file mode 100644 index 0000000..70b892e --- /dev/null +++ b/resources/views/segments/post/PostSidebar/PostSidebar.php @@ -0,0 +1,30 @@ +section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_invert'; + $setting->value = 0; + $setting->size = 12; + $setting->type = 'CHECKBOX'; +// $setting->data = json_encode(['xmin' => 2, 'xmax' => 90]); + $setting->title = $part->area->name . ' ' . $part->part. ' invert sidebar position'; + $setting->save(); + } + public static function onRemove(Part $part = null) + { + + } + public static function onMount(Part $part = null) + { + return $part; + } +} diff --git a/resources/views/segments/post/PostSidebar/PostSidebar.scss b/resources/views/segments/post/PostSidebar/PostSidebar.scss new file mode 100644 index 0000000..e730de5 --- /dev/null +++ b/resources/views/segments/post/PostSidebar/PostSidebar.scss @@ -0,0 +1,68 @@ +.PostSidebar { + + h1 { + font-size: 27px; + padding: 1rem; + color: var(--xshop-primary); + + span { + font-size: 16px; + margin-top: 5px; + display: inline-block; + } + } + + img { + max-height: 40vh; + width: 100%; + object-fit: cover; + } + + .tag { + background: var(--xshop-primary); + padding: 3px .7rem; + color: var(--xshop-diff); + border-radius: var(--xshop-border-radius); + } + + + aside{ + h4{ + padding: .5rem; + position: relative; + text-align: center; + font-weight: 300; + font-size: 20px; + &:after{ + position: absolute; + content: ' '; + height: 1px; + width: 70%; + bottom: 0; + left: 15%; + right: 15%; + background: linear-gradient(90deg,#ffffff00 0%, var(--xshop-primary) 50%, #ffffff00 100%); + } + } + } + + .recent{ + padding: 0; + list-style: none; + margin-top: 1rem; + li{ + min-height: 60px; + margin-bottom: 1rem; + } + img{ + width: 48px; + height: 48px; + object-fit: cover; + } + + p{ + height: 1.2em; + overflow: hidden; + } + } +} diff --git a/resources/views/segments/post/PostSidebar/inc/sidebar.blade.php b/resources/views/segments/post/PostSidebar/inc/sidebar.blade.php new file mode 100644 index 0000000..a810c73 --- /dev/null +++ b/resources/views/segments/post/PostSidebar/inc/sidebar.blade.php @@ -0,0 +1,44 @@ + diff --git a/routes/web.php b/routes/web.php index 14fd5d3..3a4ad1d 100644 --- a/routes/web.php +++ b/routes/web.php @@ -359,6 +359,7 @@ Route::name('client.')->group(function (){ Route::get('/', [\App\Http\Controllers\ClientController::class,'welcome'])->name('welcome'); Route::get('/{post}', [\App\Http\Controllers\ClientController::class,'post'])->name('post'); Route::get('/tag/{post}', [\App\Http\Controllers\ClientController::class,'tag'])->name('tag'); + Route::get('/search', [\App\Http\Controllers\ClientController::class,'search'])->name('search'); Route::post('/comment/submit', [\App\Http\Controllers\ClientController::class,'submitComment'])->name('comment.submit');