@ -13,7 +13,7 @@
@switch($setting->type)
@switch($setting->type)
@case('LONGTEXT')
@case('LONGTEXT')
< textarea name = "{{$setting->key}}" @ if ( $ setting- > ltr) dir="ltr" @endif id="{{$setting->key}}"
< textarea name = "{{$setting->key}}" @ if ( $ setting- > ltr) dir="ltr" @endif id="{{$setting->key}}"
class="form-control"
class="form-control"
rows="5">{{old($setting->key, $setting->value)}}< / textarea >
rows="5">{{old($setting->key, $setting->value)}}< / textarea >
@break
@break
@ -31,23 +31,29 @@
@break
@break
@case('DATE')
@case('DATE')
< vue-datetime-picker-input
< vue-datetime-picker-input
xid="{{$setting->key}}" xname="{{$setting->key}}" @if(app()->getLocale() == 'fa') xshow="pdate" @else xshow="date" @endif xtitle="{{$setting->title}}" @if(app()->getLocale() != 'fa') def-tab="1" @endif
xid="{{$setting->key}}" xname="{{$setting->key}}" @if(app()->getLocale() == 'fa') xshow="pdate"
:xvalue="{{$setting->value}}"
@else xshow="date" @endif xtitle="{{$setting->title}}" @if(app()->getLocale() != 'fa') def-tab="1"
@endif
:xvalue="{{$setting->value}}"
>< / vue-datetime-picker-input >
>< / vue-datetime-picker-input >
@break
@break
@case('DATETIME')
@case('DATETIME')
< vue-datetime-picker-input
< vue-datetime-picker-input
xid="{{$setting->key}}" xname="{{$setting->key}}" @if(app()->getLocale() == 'fa') xshow="pdatetime" @else xshow="datetime" @endif xtitle="{{$setting->title}}" @if(app()->getLocale() != 'fa') def-tab="1" @endif
xid="{{$setting->key}}" xname="{{$setting->key}}" @if(app()->getLocale() == 'fa') xshow="pdatetime"
:xvalue="{{$setting->value}}"
@else xshow="datetime" @endif xtitle="{{$setting->title}}" @if(app()->getLocale() != 'fa') def-tab="1"
@endif
:xvalue="{{$setting->value}}"
:timepicker="true"
:timepicker="true"
>< / vue-datetime-picker-input >
>< / vue-datetime-picker-input >
@break
@break
@case('ICON')
@case('ICON')
< remix-icon-picker xname = "{{$setting->key}}" xvalue = "{{old($setting->key, $setting->value)}}" > < / remix-icon-picker >
< remix-icon-picker xname = "{{$setting->key}}"
xvalue="{{old($setting->key, $setting->value)}}">< / remix-icon-picker >
@break
@break
@case('LOCATION')
@case('LOCATION')
@php($latlng = explode(',',old($setting->key, $setting->value)))
@php($latlng = explode(',',old($setting->key, $setting->value)))
< lat-lng xname = "{{$setting->key}}" :ilat = "{{$latlng[0]}}" :ilng = "{{$latlng[1]}}" :izoom = "{{$latlng[2]}}" :dark-mode = "true" > < / lat-lng >
< lat-lng xname = "{{$setting->key}}" :ilat = "{{$latlng[0]}}" :ilng = "{{$latlng[1]}}" :izoom = "{{$latlng[2]}}"
:dark-mode="true">< / lat-lng >
@break
@break
@case('EDITOR')
@case('EDITOR')
< textarea name = "{{$setting->key}}" id = "{{$setting->key}}"
< textarea name = "{{$setting->key}}" id = "{{$setting->key}}"
@ -65,7 +71,7 @@
@break
@break
@case('CATEGORY')
@case('CATEGORY')
< searchable-select
< searchable-select
@error('category_id' ) :err="true" @enderror
@error($setting->key ) :err="true" @enderror
:items='@json($cats)'
:items='@json($cats)'
title-field="name"
title-field="name"
value-field="id"
value-field="id"
@ -78,7 +84,7 @@
@break
@break
@case('GROUP')
@case('GROUP')
< searchable-select
< searchable-select
@error('category_id' ) :err="true" @enderror
@error($setting->key ) :err="true" @enderror
:items='@json($groups)'
:items='@json($groups)'
title-field="name"
title-field="name"
value-field="id"
value-field="id"
@ -89,9 +95,101 @@
xvalue='{{old($setting->key,$setting->value??null)}}'
xvalue='{{old($setting->key,$setting->value??null)}}'
:close-on-Select="true">< / searchable-select >
:close-on-Select="true">< / searchable-select >
@break
@break
@case('PRODUCT_QUERY')
< div class = "row" >
@php($vals = explode(',',old($setting->key,$setting->value??null)))
< div class = "col-md" >
< span >
{{__("Category")}}
< / span >
< searchable-select
@error($setting->key) :err="true" @enderror
:items='@json($catz)'
title-field="name"
value-field="id"
xlang="{{config('app.locale')}}"
xid="{{$setting->key}}"
xname="{{$setting->key}}[category]"
@error('category_id') :err="true" @enderror
xvalue='{{$vals[0]}}'
:close-on-Select="true">< / searchable-select >
< / div >
< div class = "col-md" >
< label id = "{{$setting->key}}i" >
{{__("Item")}}
< / label >
< select name = "{{$setting->key}}[item]" id = "{{$setting->key}}i" class = "form-control" >
< option value = "id" > {{__("ID")}} < / option >
< option value = "view" @ if ( $ vals [ 1 ] = = ' view ' ) selected @ endif > {{__("View")}} < / option >
< option value = "sell" @ if ( $ vals [ 1 ] = = ' sell ' ) selected @ endif > {{__("Sell")}} < / option >
< option value = "average_rating" @ if ( $ vals [ 1 ] = = ' average_rating ' ) selected @ endif > {{__("Rate")}} < / option >
< option value = "price" @ if ( $ vals [ 1 ] = = ' price ' ) selected @ endif > {{__("Price")}} < / option >
< option value = "stock_quantity" @ if ( $ vals [ 1 ] = = ' stock_quantity ' ) selected @ endif > {{__("Stock quantity")}} < / option >
< option value = "updated_at" @ if ( $ vals [ 1 ] = = ' updated_at ' ) selected @ endif > {{__("Update")}} < / option >
< / select >
< / div >
< div class = "col-md" >
< label id = "{{$setting->key}}s" >
{{__("Sort")}}
< / label >
< select name = "{{$setting->key}}[sort]" id = "{{$setting->key}}s" class = "form-control" >
< option value = "DESC" > {{__("Descending")}} < / option >
< option value = "ASC" @ if ( $ vals [ 2 ] = = ' ASC ' ) selected @ endif > {{__("Ascending")}} < / option >
< / select >
< / div >
< / div >
@break
@case('POST_QUERY')
< div class = "row" >
@php($vals = explode(',',old($setting->key,$setting->value??null)))
< div class = "col-md" >
< span >
{{__("Group")}}
< / span >
< searchable-select
@error($setting->key) :err="true" @enderror
:items='@json($groups)'
title-field="name"
value-field="id"
xlang="{{config('app.locale')}}"
xid="{{$setting->key}}"
xname="{{$setting->key}}[group]"
@error('category_id') :err="true" @enderror
xvalue='{{$vals[0]}}'
:close-on-Select="true">< / searchable-select >
< / div >
< div class = "col-md" >
< label id = "{{$setting->key}}i" >
{{__("Item")}}
< / label >
< select name = "{{$setting->key}}[item]" id = "{{$setting->key}}i" class = "form-control" >
< option value = "id" > {{__("ID")}} < / option >
< option value = "view" @ if ( $ vals [ 1 ] = = ' view ' ) selected @ endif > {{__("View")}} < / option >
< option value = "sell" @ if ( $ vals [ 1 ] = = ' sell ' ) selected @ endif > {{__("Sell")}} < / option >
< option value = "average_rating" @ if ( $ vals [ 1 ] = = ' average_rating ' ) selected @ endif > {{__("Rate")}} < / option >
< option value = "price" @ if ( $ vals [ 1 ] = = ' price ' ) selected @ endif > {{__("Price")}} < / option >
< option value = "stock_quantity" @ if ( $ vals [ 1 ] = = ' stock_quantity ' ) selected @ endif > {{__("Stock quantity")}} < / option >
< option value = "updated_at" @ if ( $ vals [ 1 ] = = ' updated_at ' ) selected @ endif > {{__("Update")}} < / option >
< / select >
< / div >
< div class = "col-md" >
< label id = "{{$setting->key}}s" >
{{__("Sort")}}
< / label >
< select name = "{{$setting->key}}[sort]" id = "{{$setting->key}}s" class = "form-control" >
< option value = "DESC" > {{__("Descending")}} < / option >
< option value = "ASC" @ if ( $ vals [ 2 ] = = ' ASC ' ) selected @ endif > {{__("Ascending")}} < / option >
< / select >
< / div >
< / div >
@break
@case('MENU')
@case('MENU')
< searchable-select
< searchable-select
@error('category_id') :err="true" @enderror
@error($setting->key ) :err="true" @enderror
:items='@json($menus)'
:items='@json($menus)'
title-field="name"
title-field="name"
value-field="id"
value-field="id"
@ -105,34 +203,41 @@
< br >
< br >
< input type = "color" id = "{{$setting->key}}"
< input type = "color" id = "{{$setting->key}}"
name="{{$setting->key}}" class="form-control-color w-100"
name="{{$setting->key}}" class="form-control-color w-100"
value="{{old($setting->key, $setting->value)}}" >
value="{{old($setting->key, $setting->value)}}">
@break
@break
@case('NUMBER')
@case('NUMBER')
< br >
< br >
{{-- < input type = "number" id = "{{$setting->key}}" -- } }
{{-- < input type = "number" id = "{{$setting->key}}" -- } }
{{-- name="" class="form-control"--}}
{{-- name="" class="form-control"--}}
{{-- value="" @if($setting->ltr) dir="ltr" @endif>--}}
{{-- value="" @if($setting->ltr) dir="ltr" @endif>--}}
< increment xname = "{{$setting->key}}" xvalue = "{{old($setting->key, $setting->value)}}" @ foreach ( $ setting- > getData() as $k => $v) {{$k}}="{{$v}}" @endforeach >< / increment >
< increment xname = "{{$setting->key}}"
xvalue="{{old($setting->key, $setting->value)}}" @foreach($setting->getData() as $k => $v)
{{$k}}="{{$v}}"
@endforeach >< / increment >
@break
@break
@case('FILE')
@case('FILE')
< div class = "row" >
< div class = "row" >
@php($ext = strtolower(pathinfo(str_replace('_','.',$setting->key), PATHINFO_EXTENSION)))
@php($ext = strtolower(pathinfo(str_replace('_','.',$setting->key), PATHINFO_EXTENSION)))
< div class = "col-md-5 " >
< div class = "col-md-5 " >
< input type = "file" accept = ".{{pathinfo(str_replace('_','.',$setting->key), PATHINFO_EXTENSION)}}" class = "form-control" name = "file[{{$setting->key}}]" id = "{{$setting->key}}" >
< input type = "file" accept = ".{{pathinfo(str_replace('_','.',$setting->key), PATHINFO_EXTENSION)}}"
class="form-control" name="file[{{$setting->key}}]" id="{{$setting->key}}">
< / div >
< / div >
@if(!in_array($ext, ['svg','jpg','png','gif','webp'] ) )
@if(!in_array($ext, ['svg','jpg','png','gif','webp'] ) )
< div class = "col-md-2" >
< div class = "col-md-2" >
< a class = "btn btn-primary w-100" href = "{{asset('upload/file/'.str_replace('_','.',$setting->key))}}?{{time()}}" >
< a class = "btn btn-primary w-100"
href="{{asset('upload/file/'.str_replace('_','.',$setting->key))}}?{{time()}}">
< i class = "ri-download-2-line" > < / i >
< i class = "ri-download-2-line" > < / i >
< / a >
< / a >
< / div >
< / div >
@endif
@endif
< div class = "col-md-5 text-center" >
< div class = "col-md-5 text-center" >
@if($ext == 'mp4')
@if($ext == 'mp4')
< video controls src = "{{asset('upload/media/'.str_replace('_','.',$setting->key))}}?{{time()}}" style = "max-height: 150px;max-width: 45%" > < / video >
< video controls src = "{{asset('upload/media/'.str_replace('_','.',$setting->key))}}?{{time()}}"
style="max-height: 150px;max-width: 45%">< / video >
< br >
< br >
@elseif($ext == 'mp3')
@elseif($ext == 'mp3')
< audio controls src = "{{asset('upload/media/'.str_replace('_','.',$setting->key))}}?{{time()}}" class = "img-fluid" style = "max-height: 150px;max-width: 45%" > < / audio >
< audio controls src = "{{asset('upload/media/'.str_replace('_','.',$setting->key))}}?{{time()}}"
class="img-fluid" style="max-height: 150px;max-width: 45%">< / audio >
< br >
< br >
@elseif(in_array($ext, ['svg','jpg','png','gif','webp'] ) )
@elseif(in_array($ext, ['svg','jpg','png','gif','webp'] ) )
< img src = "{{asset('upload/images/'.str_replace('_','.',$setting->key))}}?{{time()}}"
< img src = "{{asset('upload/images/'.str_replace('_','.',$setting->key))}}?{{time()}}"
@ -144,7 +249,7 @@
@break
@break
@default
@default
@if($setting->key == 'optimize')
@if($setting->key == 'optimize')
< select class = "form-control" name = "{{$setting->key}}" id = "{{$setting->key}}" >
< select class = "form-control" name = "{{$setting->key}}" id = "{{$setting->key}}" >
< option value = "jpg"
< option value = "jpg"
@if (old($setting->key, $setting->value??'webp') == 'jpg' ) selected @endif >{{__("jpg")}} < / option >
@if (old($setting->key, $setting->value??'webp') == 'jpg' ) selected @endif >{{__("jpg")}} < / option >
< option value = "webp"
< option value = "webp"