diff --git a/app/Http/Controllers/ClientController.php b/app/Http/Controllers/ClientController.php index 55ca080..401e04f 100644 --- a/app/Http/Controllers/ClientController.php +++ b/app/Http/Controllers/ClientController.php @@ -892,4 +892,9 @@ class ClientController extends Controller return response($xmlContent, 200) ->header('Content-Type', 'text/xml'); } + + public function underConstruction(){ + $title = __('Under Construction') . ' - ' . config('app.name'); + return view('client.under-construction', compact('title')); + } } diff --git a/app/Http/Middleware/VisitorCounter.php b/app/Http/Middleware/VisitorCounter.php index a2c3e92..d71f9f0 100644 --- a/app/Http/Middleware/VisitorCounter.php +++ b/app/Http/Middleware/VisitorCounter.php @@ -39,6 +39,10 @@ class VisitorCounter $visitor->page = $request->route()->getName(); $visitor->save(); } + + if (getSetting('under') == '1' && !auth()->check()) { + return redirect(route('client.under-construction')); + } return $next($request); } } diff --git a/app/Models/Area.php b/app/Models/Area.php index cb514f2..c1d0e29 100644 --- a/app/Models/Area.php +++ b/app/Models/Area.php @@ -53,6 +53,7 @@ class Area extends Model 'search', 'slider', 'top', + 'under' ]; protected $casts = [ diff --git a/database/seeders/AreaSeeder.php b/database/seeders/AreaSeeder.php index 98e2133..9e82e71 100644 --- a/database/seeders/AreaSeeder.php +++ b/database/seeders/AreaSeeder.php @@ -283,6 +283,15 @@ class AreaSeeder extends Seeder 'preview' => null, 'icon' => 'ri-layout-grid-line', ], + [ + 'name' => 'under-construction', + 'valid_segments' => json_encode( + ["under"] + ), + 'max' => 1, + 'preview' => null, + 'icon' => 'ri-calendar-schedule-line', + ], ]; foreach ($areas as $area) { diff --git a/public/assets/default/under-construction.svg b/public/assets/default/under-construction.svg new file mode 100644 index 0000000..8ec5112 --- /dev/null +++ b/public/assets/default/under-construction.svg @@ -0,0 +1,500 @@ + + diff --git a/resources/views/client/under-construction.blade.php b/resources/views/client/under-construction.blade.php new file mode 100644 index 0000000..2a8d46d --- /dev/null +++ b/resources/views/client/under-construction.blade.php @@ -0,0 +1,10 @@ +@extends('website.inc.website-layout') +@section('title') + {{$title}} +@endsection +@section('content') + @foreach(getParts('under-construction') as $part) + @php($p = $part->getBladeWithData($model??null)) + @include($p['blade'],['data' => $p['data']]) + @endforeach +@endsection diff --git a/resources/views/segments/index/TimerEvent/TimerEvent.blade.php b/resources/views/segments/index/TimerEvent/TimerEvent.blade.php index 1ab2e70..022b493 100644 --- a/resources/views/segments/index/TimerEvent/TimerEvent.blade.php +++ b/resources/views/segments/index/TimerEvent/TimerEvent.blade.php @@ -19,10 +19,6 @@
{!! getSetting($data->area_name.'_'.$data->part.'_last') !!} - - Lorem ipsum dolor sit amet, consectetur adipisicing elit. Cupiditate dignissimos dolores - doloribus eaque expedita facilis ipsa itaque maiores minus nam neque, porro ratione sapiente - sint unde ut vero voluptatibus voluptatum.
diff --git a/resources/views/segments/under/SimpleUnderConstruction/SimpleUnderConstruction.blade.php b/resources/views/segments/under/SimpleUnderConstruction/SimpleUnderConstruction.blade.php new file mode 100644 index 0000000..e645281 --- /dev/null +++ b/resources/views/segments/under/SimpleUnderConstruction/SimpleUnderConstruction.blade.php @@ -0,0 +1,33 @@ +
+
+

+ {{$title}} +

+

+ {{getSetting('desc')}} +

+ under-construction +
+ {!! getSetting($data->area_name.'_'.$data->part.'_text') !!} +
+ +
+
diff --git a/resources/views/segments/under/SimpleUnderConstruction/SimpleUnderConstruction.js b/resources/views/segments/under/SimpleUnderConstruction/SimpleUnderConstruction.js new file mode 100644 index 0000000..e69de29 diff --git a/resources/views/segments/under/SimpleUnderConstruction/SimpleUnderConstruction.json b/resources/views/segments/under/SimpleUnderConstruction/SimpleUnderConstruction.json new file mode 100644 index 0000000..ed07e9c --- /dev/null +++ b/resources/views/segments/under/SimpleUnderConstruction/SimpleUnderConstruction.json @@ -0,0 +1,10 @@ +{ + "name": "SimpleUnderConstruction", + "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/under/SimpleUnderConstruction/SimpleUnderConstruction.php b/resources/views/segments/under/SimpleUnderConstruction/SimpleUnderConstruction.php new file mode 100644 index 0000000..d73cec1 --- /dev/null +++ b/resources/views/segments/under/SimpleUnderConstruction/SimpleUnderConstruction.php @@ -0,0 +1,33 @@ +section = 'theme'; + $setting->key = $part->area_name . '_' . $part->part.'_text'; + $setting->value = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Cupiditate dignissimos dolores + doloribus eaque expedita facilis ipsa itaque maiores minus nam neque, porro ratione sapiente + sint unde ut vero voluptatibus voluptatum.'; + $setting->size = 12; + $setting->title = $part->area_name . ' ' . $part->part. ' Message'; + $setting->type = 'EDITOR'; + $setting->save(); + } + public static function onRemove(Part $part = null) + { + Setting::where('key',$part->area_name . '_' . $part->part.'_text')->first()?->delete(); + + } + public static function onMount(Part $part = null) + { + return $part; + } +} diff --git a/resources/views/segments/under/SimpleUnderConstruction/SimpleUnderConstruction.scss b/resources/views/segments/under/SimpleUnderConstruction/SimpleUnderConstruction.scss new file mode 100644 index 0000000..82a1873 --- /dev/null +++ b/resources/views/segments/under/SimpleUnderConstruction/SimpleUnderConstruction.scss @@ -0,0 +1,36 @@ +.SimpleUnderConstruction { + height: 100vh; + width: 100%; + background: rgb(254,255,0); + background: radial-gradient(circle, rgba(254,255,0,1) 0%, rgba(251,111,25,1) 100%); + text-align: center; + + h1,h2{ + font-weight: 200; + } + + .container{ + padding-top: 10vh; + } + + img{ + height: 50vh; + } + + .social-list{ + list-style: none; + display: flex; + align-items: center; + justify-content: space-between; + max-width: 500px; + margin: 1rem auto; + a{ + + color: black; + + i{ + font-size: 35px; + } + } + } +} diff --git a/resources/views/segments/under/SimpleUnderConstruction/screenshot.png b/resources/views/segments/under/SimpleUnderConstruction/screenshot.png new file mode 100644 index 0000000..4cf6fd8 Binary files /dev/null and b/resources/views/segments/under/SimpleUnderConstruction/screenshot.png differ diff --git a/routes/web.php b/routes/web.php index 17b6c43..91da1bd 100644 --- a/routes/web.php +++ b/routes/web.php @@ -503,3 +503,4 @@ Route::any('{lang}', [ClientController::class, 'langIndex']) ->middleware([\App\Http\Middleware\LangControl::class, \App\Http\Middleware\VisitorCounter::class]); +Route::any('under-construction',[ClientController::class,'underConstruction'])->name('client.under-construction');