added button checkbox to homayon menu

master
A1Gard 2 weeks ago
parent 6f17ba0f23
commit fe60d7d4d3

@ -524,7 +524,7 @@
"Transports list": "فهرست حمل و نقل‌ها", "Transports list": "فهرست حمل و نقل‌ها",
"Trashed": "حذف شده‌ها", "Trashed": "حذف شده‌ها",
"Trashed items": "موارد قابل بازیافت", "Trashed items": "موارد قابل بازیافت",
"True": "صحیح", "True": "بلی",
"Type": "نوع", "Type": "نوع",
"Unavailable": "ناموجود", "Unavailable": "ناموجود",
"Unit": "واحد", "Unit": "واحد",

@ -20,9 +20,13 @@
</ul> </ul>
</div> </div>
<div class="col-6 text-end"> <div class="col-6 text-end">
@if(getSetting($data->area_name.'_'.$data->part.'_btn'))
<a href="{{route('client.products')}}" class="btn btn-primary mt-5"> <a href="{{route('client.products')}}" class="btn btn-primary mt-5">
{{getSetting($data->area_name.'_'.$data->part.'_title')}} {{getSetting($data->area_name.'_'.$data->part.'_title')}}
</a> </a>
@else
&nbsp;
@endif
</div> </div>
</div> </div>
</div> </div>

@ -39,7 +39,7 @@ class HomayonMenu
$setting->value = '#dddddd'; $setting->value = '#dddddd';
$setting->type = 'COLOR'; $setting->type = 'COLOR';
$setting->data = json_encode(['name' => 'homayon-bg']); $setting->data = json_encode(['name' => 'homayon-bg']);
$setting->size = 6; $setting->size = 4;
$setting->title = $part->area_name . ' ' . $part->part .' background color'; $setting->title = $part->area_name . ' ' . $part->part .' background color';
$setting->save(); $setting->save();
@ -49,11 +49,22 @@ class HomayonMenu
$setting->value = gfx()['primary']; $setting->value = gfx()['primary'];
$setting->type = 'COLOR'; $setting->type = 'COLOR';
$setting->data = json_encode(['name' => 'homayon-bg-menu']); $setting->data = json_encode(['name' => 'homayon-bg-menu']);
$setting->size = 6; $setting->size = 4;
$setting->title = $part->area_name . ' ' . $part->part .' background color'; $setting->title = $part->area_name . ' ' . $part->part .' background color';
$setting->save(); $setting->save();
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area_name . '_' . $part->part.'_btn';
$setting->value = 1;
$setting->size = 4;
$setting->type = 'CHECKBOX';
// $setting->data = json_encode(['xmin' => 2, 'xmax' => 90]);
$setting->title = $part->area_name . ' ' . $part->part. ' shop btn';
$setting->save();
File::copy(__DIR__.'/../../default-assets/header-circle.svg',public_path('upload/images/').$part->area_name . '.' . $part->part.'.svg'); File::copy(__DIR__.'/../../default-assets/header-circle.svg',public_path('upload/images/').$part->area_name . '.' . $part->part.'.svg');
@ -66,6 +77,7 @@ class HomayonMenu
Setting::where('key',$part->area_name . '_' . $part->part.'_bg')->first()?->delete(); Setting::where('key',$part->area_name . '_' . $part->part.'_bg')->first()?->delete();
Setting::where('key',$part->area_name . '_' . $part->part.'_bg2')->first()?->delete(); Setting::where('key',$part->area_name . '_' . $part->part.'_bg2')->first()?->delete();
Setting::where('key',$part->area_name . '_' . $part->part.'_menu')->first()?->delete(); Setting::where('key',$part->area_name . '_' . $part->part.'_menu')->first()?->delete();
Setting::where('key',$part->area_name . '_' . $part->part.'_btn')->first()?->delete();
} }
public static function onMount(Part $part = null) public static function onMount(Part $part = null)
{ {

Loading…
Cancel
Save