Merge remote-tracking branch 'origin/master'

pull/49/head
sadeghpm 4 months ago
commit bdf3ef01a2

@ -0,0 +1,54 @@
name: Laravel
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
laravel-tests:
runs-on: ubuntu-latest
steps:
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
with:
php-version: '8.2'
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: remove composer lock
run: rm composer.lock
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --ignore-platform-reqs
- name: Generate key
run: php artisan key:generate
- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache
- name: Create Database
run: |
mkdir -p database
touch database/database.sqlite
- name: Dataseeder
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: php artisan migrate --seed
- name: Npm install
run: npm install
- name: client build
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: php artisan client
- name: npm build
run: npm run build
- name: Execute tests (Unit and Feature tests) via PHPUnit
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: php artisan test

@ -20,7 +20,7 @@
## Access to xShop/v1
> [!WARNING]
> xShop/v1 available here: <a href="https://github.com/a1Gard/xshop.v1">https://github.com/a1Gard/xshop.v1</a>
> xShop/v1 available here: <a href="https://github.com/4xmen/xshop.v1">https://github.com/4xmen/xshop.v1</a>
## Installation

@ -816,25 +816,48 @@ function getGroupBySetting($key)
}
/**
* get group by setting key
* get menu by setting key
* @param $key
* @return Menu
*/
function getMenuBySetting($key)
{
if (Menu::count() == 0) {
return [];
}
return Menu::where('id', getSetting($key) ?? 1)->first();
}
/**
* get menu's items by setting key
* @param $key
* @return array
*/
function getMenuBySettingItems($key)
{
if (Menu::count() == 0) {
return [];
}
$r = Menu::where('id', getSetting($key) ?? 1)->first();
if ($r == null) {
$r = Menu::first();
}
return $r->items;
}
/**
* get group's posts by setting key
* @param $key
* @param integer $limit
* @return \App\Models\Post[]|\Illuminate\Database\Eloquent\Collection|\LaravelIdea\Helper\App\Models\_IH_Post_C
* @return \App\Models\Post[]|\Illuminate\Database\Eloquent\Collection|\LaravelIdea\Helper\App\Models\_IH_Post_C|array
*/
function getGroupPostsBySetting($key, $limit = 10, $order = 'id', $dir = "DESC")
{
return Group::where('id', getSetting($key) ?? 1)->first()
->posts()->where('status', 1)->orderBy($order, $dir)->limit($limit)->get();
$g = Group::where('id', getSetting($key) ?? 1)->first();
if ($g == null) {
return [];
}
return $g->posts()->where('status', 1)->orderBy($order, $dir)->limit($limit)->get();
}
/**
@ -857,12 +880,15 @@ function getCategoryProductBySetting($key, $limit = 10, $order = 'id', $dir = "D
* @param integer $limit
* @param string $order
* @param string $dir
* @return \App\Models\Post[]|\Illuminate\Database\Eloquent\Collection|\LaravelIdea\Helper\App\Models\_IH_Post_C
* @return \App\Models\Post[]|\Illuminate\Database\Eloquent\Collection|\LaravelIdea\Helper\App\Models\_IH_Post_C | array
*/
function getCategorySubCatsBySetting($key, $limit = 10, $order = 'id', $dir = "DESC")
{
return Category::where('id', getSetting($key) ?? 1)->first()
->children()->orderBy($order, $dir)->limit($limit)->get();
$c = Category::where('id', getSetting($key) ?? 1)->first();
if ($c == null) {
return [];
}
return $c->children()->orderBy($order, $dir)->limit($limit)->get();
}
/**
@ -994,6 +1020,7 @@ function postsUrl()
{
return fixUrlLang(\route('client.posts'));
}
/**
* products url to best experience for multi lang shops
* @return string
@ -1002,6 +1029,7 @@ function productsUrl()
{
return fixUrlLang(\route('client.products'));
}
/**
* clips url to best experience for multi lang shops
* @return string
@ -1010,6 +1038,7 @@ function clipsUrl()
{
return fixUrlLang(\route('client.clips'));
}
/**
* galleries url to best experience for multi lang shops
* @return string
@ -1018,6 +1047,7 @@ function gallariesUrl()
{
return fixUrlLang(\route('client.galleries'));
}
/**
* attachments url to best experience for multi lang shops
* @return string
@ -1101,11 +1131,11 @@ function transports()
*/
function defTrannsport()
{
if (\App\Models\Transport::where('is_default',1)->count() == 0){
if (\App\Models\Transport::where('is_default', 1)->count() == 0) {
return null;
}
return \App\Models\Transport::where('is_default',1)->first()->id;
return \App\Models\Transport::where('is_default', 1)->first()->id;
}
@ -1114,7 +1144,8 @@ function defTrannsport()
* @param $array
* @return false|string
*/
function vueTranslate($array){
function vueTranslate($array)
{
return json_encode($array);
}
@ -1137,7 +1168,7 @@ function markUpBreadcrumbList($items)
"name" => $index,
];
if ($item != '' || $item != null) {
$json[$i-1]['item'] = $item;
$json[$i - 1]['item'] = $item;
}
}
@ -1166,9 +1197,9 @@ RESULT;
*/
function fixUrlLang($url)
{
if ( config('app.xlang.active') && app()->getLocale() != config('app.xlang.main')){
if (config('app.xlang.active') && app()->getLocale() != config('app.xlang.main')) {
$welcome = \route('client.welcome');
return str_replace($welcome,$welcome .'/'.app()->getLocale(),$url);
return str_replace($welcome, $welcome . '/' . app()->getLocale(), $url);
}
return $url;
}

@ -44,7 +44,7 @@ class TVisitor {
*/
public static function DetectOS() {
if (!isset($_SERVER['HTTP_USER_AGENT']))
return 'Unknown';
return null;
$os_list = Visitor::$osList;
@ -54,7 +54,7 @@ class TVisitor {
}
}
return 'Unknown';
return null;
}
/**
@ -118,7 +118,7 @@ class TVisitor {
*/
public static function DetectBrowser() {
if (!isset($_SERVER['HTTP_USER_AGENT']))
return 'Unknown';
return null;
$browser_list = Visitor::$browserList;
@ -128,7 +128,7 @@ class TVisitor {
}
}
return 'Other';
return null;
}
/**

@ -80,6 +80,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])]);
}

@ -57,7 +57,9 @@ class CategoryController extends XController
$category->name = $request->input('name');
$category->subtitle = $request->input('subtitle');
$category->description = $request->input('description');
$category->parent_id = $request->input('parent_id');
if ($category->parent_id != ''){
$category->parent_id = $request->input('parent_id',null);
}
$category->slug = $this->getSlug($category);
if ($request->has('image')) {
$category->image = $this->storeFile('image', $category, 'categories');

@ -51,7 +51,7 @@ class CustomerController extends XController
{
$customer->name = $request->input('name');
if ($customer->credit != $request->input('credit')){
if ($customer->credit != $request->input('credit') && $customer->id != null){
$diff = $request->input('credit') - $customer->credit;
$customer->credit = $request->input('credit')??0 ;
$cr = new Credit();

@ -56,7 +56,9 @@ class GroupController extends XController
$group->name = $request->input('name');
$group->subtitle = $request->input('subtitle');
$group->description = $request->input('description');
$group->parent_id = $request->input('parent_id');
if ($group->parent_id != ''){
$group->parent_id = $request->input('parent_id',null);
}
$group->slug = $this->getSlug($group);
if ($request->has('image')){
$group->image = $this->storeFile('image',$group, 'groups');

@ -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', 'default_header')->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 = 'compare';
$part->part = 'CompareProducts';
$part->area_id = Area::where('name', 'compare')->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 = 'login';
$part->part = 'LoginPatternBg';
$part->area_id = Area::where('name', 'login')->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 = '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

@ -13,7 +13,7 @@ class DenaAttachList
$setting->section = 'theme';
$setting->key = $part->area->name . '_' . $part->part.'_title';
$setting->value = __("Website attachments list").' [ pdf, docx, zip, png, jpg, svg, mp4, rar, mp3 ]';
$setting->type = 'text';
$setting->type = 'TEXT';
$setting->size = 6;
$setting->title = $part->area->name . ' ' . $part->part;
$setting->save();

@ -7,7 +7,7 @@
</a>
</li>
@foreach(getMenuBySetting($data->area->name.'_'.$data->part.'_menu')->items as $item)
@foreach(getMenuBySettingItems($data->area->name.'_'.$data->part.'_menu') as $item)
<li>
@if($item->meta == null)
<a href="{{$item->webUrl()}}">

@ -1,6 +1,3 @@
main{
padding-top: 47px;
}
#AplMenu {
position: fixed;
left: 0;
@ -149,4 +146,8 @@ main{
}
}
}
~header{
margin-top: 44px;
}
}

@ -5,7 +5,7 @@
<i class="ri-menu-line"></i>
</a>
</li>
@foreach(getMenuBySetting($data->area->name.'_'.$data->part.'_menu')->items as $item)
@foreach(getMenuBySettingItems($data->area->name.'_'.$data->part.'_menu') as $item)
<li>
<a href="{{$item->webUrl()}}">
{{$item->title}}

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

@ -1,12 +1,12 @@
<section class='PostIndexImage'>
<div class="{{gfx()['container']}}">
<h1>
<a href="{{getGroupBySetting($data->area->name.'_'.$data->part.'_group')->webUrl()}}">
{{getGroupBySetting($data->area->name.'_'.$data->part.'_group')->name}}
<a href="{{getGroupBySetting($data->area->name.'_'.$data->part.'_group')?->webUrl()}}">
{{getGroupBySetting($data->area->name.'_'.$data->part.'_group')?->name}}
</a>
</h1>
<p class="text-muted">
{{getGroupBySetting($data->area->name.'_'.$data->part.'_group')->description}}
{{getGroupBySetting($data->area->name.'_'.$data->part.'_group')?->description}}
</p>
<div class="row">
@foreach( getGroupPostsBySetting($data->area->name.'_'.$data->part.'_group',4) as $post )
@ -28,7 +28,7 @@
@endforeach
</div>
<div class="py-5 text-center">
<a href="{{getGroupBySetting($data->area->name.'_'.$data->part.'_group')->webUrl()}}" class="btn btn-outline-primary">
<a href="{{getGroupBySetting($data->area->name.'_'.$data->part.'_group')?->webUrl()}}" class="btn btn-outline-primary">
{{getSetting($data->area->name.'_'.$data->part.'_btn')}}
</a>
</div>

@ -1,12 +1,12 @@
<section class='PostsIconSimple py-4'>
<div class="{{gfx()['container']}}">
<h1>
<a href="{{getGroupBySetting($data->area->name.'_'.$data->part)->webUrl()}}">
{{getGroupBySetting($data->area->name.'_'.$data->part)->name}}
<a href="{{getGroupBySetting($data->area->name.'_'.$data->part)?->webUrl()}}">
{{getGroupBySetting($data->area->name.'_'.$data->part)?->name}}
</a>
</h1>
<p>
{{getGroupBySetting($data->area->name.'_'.$data->part)->description}}
{{getGroupBySetting($data->area->name.'_'.$data->part)?->description}}
</p>
<div class="row">
@foreach(getGroupPostsBySetting($data->area->name.'_'.$data->part, getSetting($data->area->name.'_'.$data->part.'_limit')) as $post)
@ -20,7 +20,7 @@
{{$post->subtitle}}
</p>
<a href="{{$post->webUrl()}}" class="btn btn-outline-primary w-100">
<a href="{{$post?->webUrl()}}" class="btn btn-outline-primary w-100">
{{__("Read more")}}
</a>
</div>

@ -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;

@ -357,7 +357,7 @@ Route::prefix(config('app.panel.prefix'))->name('admin.')->group(
});
Route::get('theme/variable.css', [\App\Http\Controllers\ThemeController::class, 'cssVariables'])->name('theme.variable.css');
Route::get('/theme/variable', [\App\Http\Controllers\ThemeController::class, 'cssVariables'])->name('theme.variable.css');
Route::middleware([\App\Http\Middleware\VisitorCounter::class])
->name('client.')->group(function () {

@ -0,0 +1,75 @@
<?php
namespace Tests\Feature;
use App\Models\Category;
use App\Models\Group;
use App\Models\Post;
use App\Models\Product;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
class ClientWebPagesTest extends TestCase
{
public function test_web_client_index(): void
{
$response = $this->get(route('client.welcome'));
$response->assertStatus(200);
}
public function test_web_client_posts(): void
{
$response = $this->get(route('client.posts'));
$response->assertStatus(200);
}
public function test_web_client_products(): void
{
$response = $this->get(route('client.products'));
$response->assertStatus(200);
}
public function test_web_client_product(): void
{
if (Product::count() == 0) {
Product::factory(1)->create();
}
$response = $this->get(Product::first()->webUrl());
$response->assertStatus(200);
}
public function test_web_client_post(): void
{
if (Post::count() == 0) {
Post::factory(1)->create();
}
$response = $this->get(Post::first()->webUrl());
$response->assertStatus(200);
}
public function test_web_client_group(): void
{
if (Group::count() == 0) {
Group::factory(1)->create();
}
$response = $this->get(Group::first()->webUrl());
$response->assertStatus(200);
}
public function test_web_client_category(): void
{
if (Category::count() == 0) {
Category::factory(1)->create();
}
$response = $this->get(Category::first()->webUrl());
$response->assertStatus(200);
}
}

@ -0,0 +1,29 @@
<?php
namespace Tests\Feature;
use App\Models\Customer;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
class CustomerTest extends TestCase
{
public function check(){
if (Customer::count() == 0){
Customer::factory(1)->create();
}
}
/**
* A basic feature test example.
*/
public function test_customer_profile(): void
{
$this->check();
$response = $this->actingAs(Customer::inRandomOrder()->first(),'customer')->get(route('client.profile'));
$response->assertStatus(200);
}
}

@ -3,17 +3,22 @@
namespace Tests\Feature;
// use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Log;
use Tests\TestCase;
class ExampleTest extends TestCase
{
/**
* A basic test example.
*/
public function test_the_application_returns_a_successful_response(): void
{
$response = $this->get('/');
$response = $this->get(route('client.welcome'));
$response->assertStatus(200);
}
}

@ -0,0 +1,20 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
class SiteMapTest extends TestCase
{
/**
* A basic feature test example.
*/
public function test_sitemap(): void
{
$response = $this->get(route('sitemap'));
$response->assertStatus(200);
}
}

@ -4,12 +4,12 @@ namespace Tests\Unit;
use PHPUnit\Framework\TestCase;
class ExampleTest extends TestCase
class SampleTest extends TestCase
{
/**
* A basic test example.
* A basic unit test example.
*/
public function test_that_true_is_true(): void
public function test_example(): void
{
$this->assertTrue(true);
}
Loading…
Cancel
Save