added sub-group theme part

optimized theme parts
improved group seeder
change screenshots
pull/49/head
A1Gard 5 months ago
parent 55a6b0e62e
commit 879ea9d1a3

@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use App\Models\Comment;
use App\Models\Customer;
use App\Models\Group;
use App\Models\Post;
use App\Models\User;
use Illuminate\Http\Request;
@ -93,4 +94,12 @@ class ClientController extends Controller
{
}
public function group(Group $group){
$area = 'group';
$title = $group->name;
$subtitle = $group->subtitle;
$posts = $group->posts()->orderByDesc('id')->paginate($this->paginate);
return view('client.group', compact('area', 'posts', 'title', 'subtitle','group'));
}
}

@ -15,7 +15,7 @@ class Area extends Model
'attachments_page',
'card',
'categories',
'categories_page',
// 'categories_page',
'category',
'comments',
'clip',
@ -31,7 +31,7 @@ class Area extends Model
'gallery',
'group',
'groups',
'groups_page',
// 'groups_page',
'header',
'index',
'invoice',

@ -84,8 +84,7 @@ class Group extends Model
public function webUrl()
{
return '#';// WIP
return route('');
return route('client.group',$this->slug);
}
public function published($limit = 10, $order = 'id', $dir = 'DESC')

@ -154,16 +154,16 @@ class AreaSeeder extends Seeder
'preview' => 'client.attachment',
'icon' => 'ri-book-3-line',
],
[
'name' => 'categories-list',
'valid_segments' => json_encode(
["top", "header", "footer", "menu",
"parallax", "other", "categories_page", "ads"]
),
'max' => 6,
'preview' => 'client.categories',
'icon' => 'ri-file-copy-2-line',
],
// [
// 'name' => 'categories-list',
// 'valid_segments' => json_encode(
// ["top", "header", "footer", "menu",
// "parallax", "other", "categories_page", "ads"]
// ),
// 'max' => 6,
// 'preview' => 'client.categories',
// 'icon' => 'ri-file-copy-2-line',
// ],
[
'name' => 'group',
'valid_segments' => json_encode(
@ -172,18 +172,18 @@ class AreaSeeder extends Seeder
),
'max' => 6,
'preview' => 'client.group',
'icon' => 'ri-book-line',
],
[
'name' => 'groups-list',
'valid_segments' => json_encode(
["top", "header", "footer", "menu",
"parallax", "other", "groups_page", "ads"]
),
'max' => 6,
'preview' => 'client.groups',
'icon' => 'ri-book-shelf-line',
],
// [
// 'name' => 'groups-list',
// 'valid_segments' => json_encode(
// ["top", "header", "footer", "menu",
// "parallax", "other", "groups_page", "ads"]
// ),
// 'max' => 6,
// 'preview' => 'client.groups',
// 'icon' => 'ri-book-shelf-line',
// ],
[
'name' => 'card',
'valid_segments' => json_encode(

@ -30,5 +30,26 @@ class GroupSeeder extends Seeder
$g3->name = __("About us");
$g3->slug = 'about-us';
$g3->save();
$g4 = new Group();
$g4->name = __("Sport");
$g4->subtitle = __("Sport news about sport around the world.");
$g4->slug = 'sport-news';
$g4->parent_id = $g1->id;
$g4->save();
$g4 = new Group();
$g4->name = __("Economy");
$g4->subtitle = __("Economy news about sport around the world.");
$g4->slug = 'economy-news';
$g4->parent_id = $g1->id;
$g4->save();
$g4 = new Group();
$g4->name = __("Militarily");
$g4->subtitle = __("Militarily news about sport around the world.");
$g4->slug = 'militarily-news';
$g4->parent_id = $g1->id;
$g4->save();
}
}

@ -0,0 +1,18 @@
@extends('website.inc.website-layout')
@section('title')
{{$title}} - {{config('app.name')}}
@endsection
@php
if ($group->bg != null){
$bg = $group->bgUrl();
}
@endphp
@section('content')
<main>
@foreach(getParts($area) as $part)
@php($p = $part->getBladeWithData())
@include($p['blade'],['data' => $p['data']])
@endforeach
</main>
@endsection

@ -0,0 +1,23 @@
<section class='SubGroupsGrid content'>
<div class="{{gfx()['container']}}">
@if($group->children()->count() > 0)
<div class="px-4">
<h3>
{{__("Sub groups")}}
</h3>
<div class="row">
@foreach($group->children as $subGroup)
<div class="col-md-4">
<div class="sub-group">
<img src="{{$subGroup->imgUrl()}}" alt="{{$subGroup->name}}" class="img-fluid">
<h4>
{{$subGroup->name}}
</h4>
</div>
</div>
@endforeach
</div>
</div>
@endif
</div>
</section>

@ -0,0 +1,10 @@
{
"name": "SubGroupsGrid",
"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": []
}

@ -0,0 +1,21 @@
<?php
namespace Resources\Views\Segments;
use App\Models\Part;
class SubGroupsGrid
{
public static function onAdd(Part $part = null)
{
}
public static function onRemove(Part $part = null)
{
}
public static function onMount(Part $part = null)
{
return $part;
}
}

@ -0,0 +1,47 @@
.SubGroupsGrid {
.row{
.col-md-4{
padding: 2px;
}
}
.sub-group{
height: 300px;
width: 100%;
position: relative;
overflow: hidden;
img{
position: absolute;
height: 300px;
width: 100%;
left: 0;
right: 0;
top: 0;
bottom: 0;
object-fit: cover;
transition: 400ms;
}
h4{
z-index: 3;
position: absolute;
left: 0;
right: 0;
bottom: 0;
text-align: center;
background: #ffffff33;
backdrop-filter: blur(4px);
margin: 0;
padding: 1rem;
transition: 400ms;
}
&:hover{
h4{
background: #ffffff88;
}
img{
transform: scale(1.3) rotateZ(15deg);
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 KiB

@ -1,4 +1,4 @@
<section class='GridPostList'>
<section class='GridPostList content'>
<div class="{{gfx()['container']}}">
<div class="row pinned-posts">
@foreach(\App\Models\Post::where('status',1)->where('is_pinned',1)->limit(2)->get() as $post)
@ -45,7 +45,7 @@
</span>
<span class="float-end">
<i class="ri-eye-line"></i>
{{$post->view}}
{{number_format($post->view)}}
</span>
</div>
<p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 KiB

@ -1,4 +1,4 @@
<section class='GridPostListSidebar'>
<section class='GridPostListSidebar content'>
<div class="{{gfx()['container']}}">
<div class="row pinned-posts">
@foreach(\App\Models\Post::where('status',1)->where('is_pinned',1)->limit(2)->get() as $post)
@ -49,7 +49,7 @@
</span>
<span class="float-end">
<i class="ri-eye-line"></i>
{{$post->view}}
{{number_format($post->view)}}
</span>
</div>
<p>

@ -63,7 +63,7 @@
overflow: hidden;
img{
width: 100%;
height: 300px;
height: 200px;
object-fit: cover;
margin-bottom: 1rem;
border-radius: var(--xshop-border-radius) ;

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 KiB

@ -1,4 +1,4 @@
<section class='SimplePostList'>
<section class='SimplePostList content'>
<div class="{{gfx()['container']}}">
<div class="row pinned-posts">
@foreach(\App\Models\Post::where('status',1)->where('is_pinned',1)->limit(2)->get() as $post)

@ -1,4 +1,4 @@
<section class='SimplePostListSideBar'>
<section class='SimplePostListSideBar content'>
<div class="{{gfx()['container']}}">
<div class="row pinned-posts">
@foreach(\App\Models\Post::where('status',1)->where('is_pinned',1)->limit(2)->get() as $post)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 344 KiB

@ -47,6 +47,7 @@ Route::prefix(config('app.panel.prefix'))->name('admin.')->group(
Route::post('store', [\App\Http\Controllers\Admin\GroupController::class, 'store'])->name('store');
Route::get('edit/{item}', [\App\Http\Controllers\Admin\GroupController::class, 'edit'])->name('edit');
Route::post('update/{item}', [\App\Http\Controllers\Admin\GroupController::class, 'update'])->name('update');
Route::get('show/{item}', [\App\Http\Controllers\Admin\GroupController::class, 'show'])->name('show');
Route::get('delete/{item}', [\App\Http\Controllers\Admin\GroupController::class, 'destroy'])->name('destroy');
Route::get('restore/{item}', [\App\Http\Controllers\Admin\GroupController::class, 'restore'])->name('restore');
Route::post('bulk', [\App\Http\Controllers\Admin\GroupController::class, "bulk"])->name('bulk');
@ -358,7 +359,8 @@ Route::name('client.')->group(function (){
// index
Route::get('/', [\App\Http\Controllers\ClientController::class,'welcome'])->name('welcome');
Route::get('/posts', [\App\Http\Controllers\ClientController::class,'posts'])->name('posts');
Route::get('/tag/{post}', [\App\Http\Controllers\ClientController::class,'tag'])->name('tag');
Route::get('/tag/{post}', [\App\Http\Controllers\ClientController::class,'tag'])->name('tag'); // wip
Route::get('/group/{group}', [\App\Http\Controllers\ClientController::class,'group'])->name('group');
Route::get('/search', [\App\Http\Controllers\ClientController::class,'search'])->name('search');
Route::get('/{post}', [\App\Http\Controllers\ClientController::class,'post'])->name('post');

Loading…
Cancel
Save