added default header

optimized area and part seeder
pull/49/head
A1Gard 4 months ago
parent 8e0e562bd3
commit 78d8a90e7b

@ -20,6 +20,8 @@ class AreaController extends Controller
public function desgin(Area $area)
{
$valids = [];
foreach ($area->segment as $seg) {
if (File::exists(resource_path() . '/views/segments/' . $seg)) {
@ -80,6 +82,11 @@ class AreaController extends Controller
logAdmin(__METHOD__, __CLASS__, $area->id);
if ($request->has('use_default')){
$area->use_default = 1;
$area->save();
}
return redirect()->back()->with(['message' => __('area :NAME of website updated', ['NAME' => $area->name])]);
}

@ -18,6 +18,7 @@ return new class extends Migration
$table->string('icon')->nullable();
$table->json('valid_segments');
$table->string('preview')->nullable();
$table->boolean('use_default')->default(true);
$table->timestamps();
});
}

@ -33,6 +33,24 @@ class AreaSeeder extends Seeder
'preview' => null,
'icon' => 'ri-ai-generate',
],
[
'name' => 'default_header',
'valid_segments' => json_encode(
["top", "header", "other", "ads", "menu"]
),
'max' => 2,
'preview' => null,
'icon' => 'ri-window-line',
],
[
'name' => 'default_footer',
'valid_segments' => json_encode(
["footer", "other", "ads" , "groups"]
),
'max' => 2,
'preview' => null,
'icon' => 'ri-window-line rotate-180',
],
[
'name' => 'index',
'valid_segments' => json_encode(
@ -71,7 +89,7 @@ class AreaSeeder extends Seeder
"parallax", "other", "clip", "comments", "ads", "attachments"]
),
'max' => 6,
'preview' => null,
'preview' => null,
'icon' => 'ri-video-line',
],
[
@ -91,7 +109,7 @@ class AreaSeeder extends Seeder
"parallax", "other", "gallery", "comments", "ads", "attachments"]
),
'max' => 6,
'preview' => null,
'preview' => null,
'icon' => 'ri-image-line',
],
[
@ -111,7 +129,7 @@ class AreaSeeder extends Seeder
"parallax", "other", "product", "comments", "ads", "attachments"]
),
'max' => 6,
'preview' => null,
'preview' => null,
'icon' => 'ri-vip-diamond-line',
],
[
@ -131,7 +149,7 @@ class AreaSeeder extends Seeder
"parallax", "other", "attachment", "comments", "ads"]
),
'max' => 6,
'preview' => null,
'preview' => null,
'icon' => 'ri-attachment-line',
],
[
@ -171,7 +189,7 @@ class AreaSeeder extends Seeder
"parallax", "other", "group", "ads", 'posts_page', "attachments"]
),
'max' => 6,
'preview' => null,
'preview' => null,
'icon' => 'ri-book-shelf-line',
],
// [
@ -201,7 +219,7 @@ class AreaSeeder extends Seeder
"parallax", "other", "login", "ads"]
),
'max' => 6,
'preview' => 'client.login',
'preview' => 'client.sign-in',
'icon' => 'ri-login-circle-line',
],
[
@ -252,6 +270,9 @@ class AreaSeeder extends Seeder
$a->valid_segments = $area['valid_segments'];
$a->icon = $area['icon'];
$a->preview = $area['preview'];
if ($area['name'] == 'index'){
$a->use_default = false;
}
$a->save();
}
}

@ -83,37 +83,43 @@ class PartSeeder extends Seeder
// -------------------------------------------------------------
// default header and footer
$part = new Part();
$part->segment = 'header';
$part->part = 'SimpleHeader';
$part->area_id = Area::where('name', 'card')->first()->id;
$part->segment = 'menu';
$part->part = 'AplMenu';
$part->area_id = Area::where('name', 'index')->first()->id;
$part->sort = 0;
$part->save();
$part = new Part();
$part->segment = 'card';
$part->part = 'NsCard';
$part->area_id = Area::where('name', 'card')->first()->id;
$part->sort = 1;
$part->segment = 'header';
$part->part = 'SimpleHeader';
$part->area_id = Area::where('name', 'default_header')->first()->id;
$part->sort = 0;
$part->save();
$part = new Part();
$part->segment = 'footer';
$part->part = 'WaveFooter';
$part->area_id = Area::where('name', 'card')->first()->id;
$part->area_id = Area::where('name', 'default_footer')->first()->id;
$part->sort = 2;
$part->save();
// -------------------------------------------------------------
$part = new Part();
$part->segment = 'header';
$part->part = 'SimpleHeader';
$part->area_id = Area::where('name', 'products-list')->first()->id;
$part->sort = 0;
$part->segment = 'card';
$part->part = 'NsCard';
$part->area_id = Area::where('name', 'card')->first()->id;
$part->sort = 1;
$part->save();
// -------------------------------------------------------------
$part = new Part();
$part->segment = 'products_page';
$part->part = 'ProductGridSidebar';
@ -121,23 +127,12 @@ class PartSeeder extends Seeder
$part->sort = 1;
$part->save();
$part = new Part();
$part->segment = 'footer';
$part->part = 'WaveFooter';
$part->area_id = Area::where('name', 'products-list')->first()->id;
$part->sort = 2;
$part->save();
// -------------------------------------------------------------
$part = new Part();
$part->segment = 'header';
$part->part = 'SimpleHeader';
$part->area_id = Area::where('name', 'product')->first()->id;
$part->sort = 0;
$part->save();
$part = new Part();
$part->segment = 'product';
@ -146,60 +141,120 @@ class PartSeeder extends Seeder
$part->sort = 1;
$part->save();
// -------------------------------------------------------------
$part = new Part();
$part->segment = 'footer';
$part->part = 'WaveFooter';
$part->area_id = Area::where('name', 'product')->first()->id;
$part->sort = 2;
$part->segment = 'posts_page';
$part->part = 'GridPostListSidebar';
$part->area_id = Area::where('name', 'posts-list')->first()->id;
$part->sort = 1;
$part->save();
// -------------------------------------------------------------
$part = new Part();
$part->segment = 'header';
$part->part = 'SimpleHeader';
$part->area_id = Area::where('name', 'posts-list')->first()->id;
$part->sort = 0;
$part->segment = 'post';
$part->part = 'PostSidebar';
$part->area_id = Area::where('name', 'post')->first()->id;
$part->sort = 1;
$part->save();
// -------------------------------------------------------------
$part = new Part();
$part->segment = 'posts_page';
$part->part = 'GridPostListSidebar';
$part->area_id = Area::where('name', 'posts-list')->first()->id;
$part->segment = 'clips_page';
$part->part = 'ClipListGrid';
$part->area_id = Area::where('name', 'clips-list')->first()->id;
$part->sort = 1;
$part->save();
// -------------------------------------------------------------
$part = new Part();
$part->segment = 'footer';
$part->part = 'WaveFooter';
$part->area_id = Area::where('name', 'posts-list')->first()->id;
$part->sort = 2;
$part->segment = 'clip';
$part->part = 'DorClip';
$part->area_id = Area::where('name', 'clip')->first()->id;
$part->sort = 1;
$part->save();
// -------------------------------------------------------------
$part = new Part();
$part->segment = 'galleries_page';
$part->part = 'GalleriesList';
$part->area_id = Area::where('name', 'galleries-list')->first()->id;
$part->sort = 1;
$part->save();
// -------------------------------------------------------------
$part = new Part();
$part->segment = 'header';
$part->part = 'SimpleHeader';
$part->area_id = Area::where('name', 'post')->first()->id;
$part->sort = 0;
$part->segment = 'gallery';
$part->part = 'GallaryGrid';
$part->area_id = Area::where('name', 'gallery')->first()->id;
$part->sort = 1;
$part->save();
// -------------------------------------------------------------
$part = new Part();
$part->segment = 'post';
$part->part = 'PostSidebar';
$part->area_id = Area::where('name', 'post')->first()->id;
$part->segment = 'compare';
$part->part = 'CompareProducts';
$part->area_id = Area::where('name', 'compare')->first()->id;
$part->sort = 1;
$part->save();
// -------------------------------------------------------------
$part = new Part();
$part->segment = 'footer';
$part->part = 'WaveFooter';
$part->area_id = Area::where('name', 'post')->first()->id;
$part->sort = 2;
$part->segment = 'login';
$part->part = 'LoginPatternBg';
$part->area_id = Area::where('name', 'login')->first()->id;
$part->sort = 1;
$part->save();
// -------------------------------------------------------------
$part = new Part();
$part->segment = 'customer';
$part->part = 'AvisaCustomer';
$part->area_id = Area::where('name', 'customer')->first()->id;
$part->sort = 1;
$part->save();
// -------------------------------------------------------------
$part = new Part();
$part->segment = 'attachments_page';
$part->part = 'DenaAttachList';
$part->area_id = Area::where('name', 'attachments-list')->first()->id;
$part->sort = 1;
$part->save();
// -------------------------------------------------------------
$part = new Part();
$part->segment = 'attachment';
$part->part = 'AttachmentWithPreview';
$part->area_id = Area::where('name', 'attachment')->first()->id;
$part->sort = 1;
$part->save();

@ -14,24 +14,26 @@ import "./client-custom/windowLoader.js";
import "../views/segments/preloader/PreloaderCircle/PreloaderCircle.js";
import "../views/segments/menu/RecetMenu/RecetMenu.js";
import "../views/segments/slider/SliderSimple/SliderSimple.js";
import "../views/segments/products/LatestProducts/LatestProducts.js";
import "../views/segments/posts/PostsIconSimple/PostsIconSimple.js";
import "../views/segments/index/CounterGrid/CounterGrid.js";
import "../views/segments/categories/CategoriesFavImageLinks/CategoriesFavImageLinks.js";
import "../views/segments/posts/PostIndexImage/PostIndexImage.js";
import "../views/segments/footer/WaveFooter/WaveFooter.js";
import "../views/segments/menu/AplMenu/AplMenu.js";
import "../views/segments/header/SimpleHeader/SimpleHeader.js";
import "../views/segments/card/NsCard/NsCard.js";
import "../views/segments/footer/WaveFooter/WaveFooter.js";
import "../views/segments/header/SimpleHeader/SimpleHeader.js";
import "../views/segments/card/NsCard/NsCard.js";
import "../views/segments/products_page/ProductGridSidebar/ProductGridSidebar.js";
import "../views/segments/footer/WaveFooter/WaveFooter.js";
import "../views/segments/header/SimpleHeader/SimpleHeader.js";
import "../views/segments/product/ProductKaren/ProductKaren.js";
import "../views/segments/footer/WaveFooter/WaveFooter.js";
import "../views/segments/header/SimpleHeader/SimpleHeader.js";
import "../views/segments/posts_page/GridPostListSidebar/GridPostListSidebar.js";
import "../views/segments/footer/WaveFooter/WaveFooter.js";
import "../views/segments/header/SimpleHeader/SimpleHeader.js";
import "../views/segments/post/PostSidebar/PostSidebar.js";
import "../views/segments/footer/WaveFooter/WaveFooter.js";
import "../views/segments/products/LatestProducts/LatestProducts.js";
import "../views/segments/clips_page/ClipListGrid/ClipListGrid.js";
import "../views/segments/clip/DorClip/DorClip.js";
import "../views/segments/galleries_page/GalleriesList/GalleriesList.js";
import "../views/segments/gallery/GallaryGrid/GallaryGrid.js";
import "../views/segments/compare/CompareProducts/CompareProducts.js";
import "../views/segments/login/LoginPatternBg/LoginPatternBg.js";
import "../views/segments/customer/AvisaCustomer/AvisaCustomer.js";
import "../views/segments/attachments_page/DenaAttachList/DenaAttachList.js";
import "../views/segments/attachment/AttachmentWithPreview/AttachmentWithPreview.js";

@ -25,24 +25,26 @@ $xshop-shadow:2px 2px 4px #777777;
@import "../views/segments/preloader/PreloaderCircle/PreloaderCircle";
@import "../views/segments/menu/RecetMenu/RecetMenu";
@import "../views/segments/slider/SliderSimple/SliderSimple";
@import "../views/segments/products/LatestProducts/LatestProducts";
@import "../views/segments/posts/PostsIconSimple/PostsIconSimple";
@import "../views/segments/index/CounterGrid/CounterGrid";
@import "../views/segments/categories/CategoriesFavImageLinks/CategoriesFavImageLinks";
@import "../views/segments/posts/PostIndexImage/PostIndexImage";
@import "../views/segments/footer/WaveFooter/WaveFooter";
@import "../views/segments/menu/AplMenu/AplMenu";
@import "../views/segments/header/SimpleHeader/SimpleHeader";
@import "../views/segments/card/NsCard/NsCard";
@import "../views/segments/footer/WaveFooter/WaveFooter";
@import "../views/segments/header/SimpleHeader/SimpleHeader";
@import "../views/segments/card/NsCard/NsCard";
@import "../views/segments/products_page/ProductGridSidebar/ProductGridSidebar";
@import "../views/segments/footer/WaveFooter/WaveFooter";
@import "../views/segments/header/SimpleHeader/SimpleHeader";
@import "../views/segments/product/ProductKaren/ProductKaren";
@import "../views/segments/footer/WaveFooter/WaveFooter";
@import "../views/segments/header/SimpleHeader/SimpleHeader";
@import "../views/segments/posts_page/GridPostListSidebar/GridPostListSidebar";
@import "../views/segments/footer/WaveFooter/WaveFooter";
@import "../views/segments/header/SimpleHeader/SimpleHeader";
@import "../views/segments/post/PostSidebar/PostSidebar";
@import "../views/segments/footer/WaveFooter/WaveFooter";
@import "../views/segments/products/LatestProducts/LatestProducts";
@import "../views/segments/clips_page/ClipListGrid/ClipListGrid";
@import "../views/segments/clip/DorClip/DorClip";
@import "../views/segments/galleries_page/GalleriesList/GalleriesList";
@import "../views/segments/gallery/GallaryGrid/GallaryGrid";
@import "../views/segments/compare/CompareProducts/CompareProducts";
@import "../views/segments/login/LoginPatternBg/LoginPatternBg";
@import "../views/segments/customer/AvisaCustomer/AvisaCustomer";
@import "../views/segments/attachments_page/DenaAttachList/DenaAttachList";
@import "../views/segments/attachment/AttachmentWithPreview/AttachmentWithPreview";

@ -14,6 +14,16 @@
{{__("Design :AREA",['AREA' => $area->name])}} <i class="{{$area->icon}}"></i>
</h1>
@if(strpos($area->name,'default') !== 0 )
<div class="form-group p-3">
<div class="form-check form-switch">
<input value="1" class="form-check-input @error('use_default') is-invalid @enderror" name="use_default" @if( isset($area) && $area->use_default) checked @endif type="checkbox" id="use_default">
<label class="form-check-label" for="use_default"> {{__('Use default')}}</label>
</div>
</div>
@endif
<area-designer
image-link="{{route('admin.area.image',['',''])}}"
:parts='@json($area->parts()->orderBy('sort')->get())'

@ -10,9 +10,21 @@ if ($category->bg != null){
@endphp
@section('content')
<main>
@foreach(getParts($area) as $part)
@php($p = $part->getBladeWithData())
@include($p['blade'],['data' => $p['data']])
@endforeach
@if(\App\Models\Area::where('name',$area)->first()->use_default)
@foreach(getParts('default_header') as $part)
@php($p = $part->getBladeWithData())
@include($p['blade'],['data' => $p['data']])
@endforeach
@endif
@foreach(getParts($area) as $part)
@php($p = $part->getBladeWithData())
@include($p['blade'],['data' => $p['data']])
@endforeach
@if(\App\Models\Area::where('name',$area)->first()->use_default)
@foreach(getParts('default_footer') as $part)
@php($p = $part->getBladeWithData())
@include($p['blade'],['data' => $p['data']])
@endforeach
@endif
</main>
@endsection

@ -5,9 +5,21 @@
@endsection
@section('content')
<main>
@foreach(getParts($area) as $part)
@php($p = $part->getBladeWithData())
@include($p['blade'],['data' => $p['data']])
@endforeach
@if(\App\Models\Area::where('name',$area)->first()->use_default)
@foreach(getParts('default_header') as $part)
@php($p = $part->getBladeWithData())
@include($p['blade'],['data' => $p['data']])
@endforeach
@endif
@foreach(getParts($area) as $part)
@php($p = $part->getBladeWithData())
@include($p['blade'],['data' => $p['data']])
@endforeach
@if(\App\Models\Area::where('name',$area)->first()->use_default)
@foreach(getParts('default_footer') as $part)
@php($p = $part->getBladeWithData())
@include($p['blade'],['data' => $p['data']])
@endforeach
@endif
</main>
@endsection

@ -5,9 +5,21 @@
@endsection
@section('content')
<main>
@foreach(getParts($area) as $part)
@php($p = $part->getBladeWithData($gallery))
@include($p['blade'],['data' => $p['data']])
@endforeach
@if(\App\Models\Area::where('name',$area)->first()->use_default)
@foreach(getParts('default_header') as $part)
@php($p = $part->getBladeWithData())
@include($p['blade'],['data' => $p['data']])
@endforeach
@endif
@foreach(getParts($area) as $part)
@php($p = $part->getBladeWithData())
@include($p['blade'],['data' => $p['data']])
@endforeach
@if(\App\Models\Area::where('name',$area)->first()->use_default)
@foreach(getParts('default_footer') as $part)
@php($p = $part->getBladeWithData())
@include($p['blade'],['data' => $p['data']])
@endforeach
@endif
</main>
@endsection

@ -10,9 +10,21 @@ if ($group->bg != null){
@endphp
@section('content')
<main>
@foreach(getParts($area) as $part)
@php($p = $part->getBladeWithData())
@include($p['blade'],['data' => $p['data']])
@endforeach
@if(\App\Models\Area::where('name',$area)->first()->use_default)
@foreach(getParts('default_header') as $part)
@php($p = $part->getBladeWithData())
@include($p['blade'],['data' => $p['data']])
@endforeach
@endif
@foreach(getParts($area) as $part)
@php($p = $part->getBladeWithData())
@include($p['blade'],['data' => $p['data']])
@endforeach
@if(\App\Models\Area::where('name',$area)->first()->use_default)
@foreach(getParts('default_footer') as $part)
@php($p = $part->getBladeWithData())
@include($p['blade'],['data' => $p['data']])
@endforeach
@endif
</main>
@endsection

@ -5,10 +5,20 @@
{{$post->title}} - {{config('app.name')}}
@endsection
@section('content')
<main>
@if(\App\Models\Area::where('name',$area)->first()->use_default)
@foreach(getParts('default_header') as $part)
@php($p = $part->getBladeWithData())
@include($p['blade'],['data' => $p['data']])
@endforeach
@endif
@foreach(getParts($area) as $part)
@php($p = $part->getBladeWithData($post))
@php($p = $part->getBladeWithData())
@include($p['blade'],['data' => $p['data']])
@endforeach
</main>
@if(\App\Models\Area::where('name',$area)->first()->use_default)
@foreach(getParts('default_footer') as $part)
@php($p = $part->getBladeWithData())
@include($p['blade'],['data' => $p['data']])
@endforeach
@endif
@endsection

@ -5,9 +5,21 @@
@endsection
@section('content')
<main>
@foreach(getParts($area) as $part)
@php($p = $part->getBladeWithData())
@include($p['blade'],['data' => $p['data']])
@endforeach
@if(\App\Models\Area::where('name',$area)->first()->use_default)
@foreach(getParts('default_header') as $part)
@php($p = $part->getBladeWithData())
@include($p['blade'],['data' => $p['data']])
@endforeach
@endif
@foreach(getParts($area) as $part)
@php($p = $part->getBladeWithData())
@include($p['blade'],['data' => $p['data']])
@endforeach
@if(\App\Models\Area::where('name',$area)->first()->use_default)
@foreach(getParts('default_footer') as $part)
@php($p = $part->getBladeWithData())
@include($p['blade'],['data' => $p['data']])
@endforeach
@endif
</main>
@endsection

@ -1,5 +1,4 @@
#RecetMenu {
// scss
position: fixed;
inset-inline-start: 1rem;
inset-inline-end: 1rem;

@ -1,5 +1,6 @@
<section class='GridPostList content'>
<div class="{{gfx()['container']}}">
@if(\App\Models\Post::where('status',1)->where('is_pinned',1)->count() < 0 )
<div class="row pinned-posts">
@foreach(\App\Models\Post::where('status',1)->where('is_pinned',1)->limit(2)->get() as $post)
<div class="col-md-6 p-1">
@ -24,6 +25,7 @@
@endforeach
</div>
<hr>
@endif
<div class="row">
<div class="col-12">

@ -1,5 +1,6 @@
<section class='GridPostListSidebar content'>
<div class="{{gfx()['container']}}">
@if(\App\Models\Post::where('status',1)->where('is_pinned',1)->count() < 0 )
<div class="row pinned-posts">
@foreach(\App\Models\Post::where('status',1)->where('is_pinned',1)->limit(2)->get() as $post)
<div class="col-md-6 p-1">
@ -24,6 +25,7 @@
@endforeach
</div>
<hr>
@endif
<div class="row">
@if(!getSetting($data->area->name.'_'.$data->part.'_invert'))
<div class="col-lg-3 p-0">

@ -1,5 +1,6 @@
<section class='SimplePostList content'>
<div class="{{gfx()['container']}}">
@if(\App\Models\Post::where('status',1)->where('is_pinned',1)->count() < 0 )
<div class="row pinned-posts">
@foreach(\App\Models\Post::where('status',1)->where('is_pinned',1)->limit(2)->get() as $post)
<div class="col-md-6 p-1">
@ -24,6 +25,7 @@
@endforeach
</div>
<hr>
@endif
@foreach($posts as $post)
<div class="post-list-item">
<img src="{{$post->imgUrl()}}" class="float-start me-4" alt="{{$post->title}}">

@ -1,27 +1,29 @@
<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)
<div class="col-md-6 p-1">
<div class="post-item">
<div class="corner">
{{$post->mainGroup->name}}
</div>
<a href="{{$post->webUrl()}}">
<img src="{{$post->orgUrl()}}" alt="{{$post->title}}"
title="{{implode(',',$post->tags->pluck('name')->toArray()??'')}}">
</a>
<div class="detail">
<h4>
{{$post->title}}
</h4>
<span>
@if(\App\Models\Post::where('status',1)->where('is_pinned',1)->count() < 0 )
@foreach(\App\Models\Post::where('status',1)->where('is_pinned',1)->limit(2)->get() as $post)
<div class="col-md-6 p-1">
<div class="post-item">
<div class="corner">
{{$post->mainGroup->name}}
</div>
<a href="{{$post->webUrl()}}">
<img src="{{$post->orgUrl()}}" alt="{{$post->title}}"
title="{{implode(',',$post->tags->pluck('name')->toArray()??'')}}">
</a>
<div class="detail">
<h4>
{{$post->title}}
</h4>
<span>
{{$post->created_at->ldate('Y/m/d l')}}
</span>
</div>
</div>
</div>
</div>
@endforeach
@endforeach
@endif
</div>
<hr>
<div class="row">

@ -4,14 +4,14 @@
<div>
<div class="parallax-slider" data-bg="{{$slider->imgUrl()}}"></div>
<div class="parallax-slide-item">
<div class="main-content">
<div class="main-content" @if(langIsRTL(config('app.locale'))) dir="rtl" @else dir="ltr" @endif>
{!! $slider->body !!}
<br>
<p class="text-center">
{{$slider->dataz['index_ParallaxSlider_subtitle']}}
<br>
<a class="btn btn-outline-dark mt-5"
href="{{$slider->dataz['index_ParallaxSlider_link']}}">
href="{{fixUrlLang($slider->dataz['index_ParallaxSlider_link'])}}">
{{$slider->dataz['index_ParallaxSlider_btn']}}
</a>
</p>

@ -1,5 +1,10 @@
#ParallaxSlider {
.tns-inner{
direction: ltr;
}
#ParallaxSliderTns > div{
position: relative;
overflow: hidden;

Loading…
Cancel
Save