Collapseable extension settings
This commit is contained in:
parent
1c179702d0
commit
ce65b9860c
1 changed files with 175 additions and 123 deletions
|
@ -12,7 +12,8 @@
|
|||
<ol class="breadcrumb float-sm-right">
|
||||
<li class="breadcrumb-item"><a href="">{{ __('Dashboard') }}</a></li>
|
||||
<li class="breadcrumb-item"><a class="text-muted"
|
||||
href="{{ route('admin.settings.index') }}">{{ __('Settings') }}</a></li>
|
||||
href="{{ route('admin.settings.index') }}">{{ __('Settings') }}</a>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -24,7 +25,9 @@
|
|||
<h4>{{ __('The installer is not locked!') }}</h4>
|
||||
<p>{{ __('please create a file called "install.lock" in your dashboard Root directory. Otherwise no settings will be loaded!') }}
|
||||
</p>
|
||||
<a href="/install?step=7"><button class="btn btn-outline-danger">{{ __('or click here') }}</button></a>
|
||||
<a href="/install?step=7">
|
||||
<button class="btn btn-outline-danger">{{ __('or click here') }}</button>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
@endif
|
||||
|
@ -56,21 +59,54 @@
|
|||
</a>
|
||||
</li>
|
||||
@foreach ($settings as $category => $options)
|
||||
@canany(["settings.".strtolower($category).".read","settings.".strtolower($category).".write"])
|
||||
<li class="nav-item border-bottom-0">
|
||||
<a href="#{{ $category }}"
|
||||
class="nav-link {{ $loop->first ? 'active' : '' }}" data-toggle="pill"
|
||||
role="tab">
|
||||
<i
|
||||
class="nav-icon fas {{ $options['category_icon'] ?? 'fas fa-cog' }}"></i>
|
||||
<p>
|
||||
{{ $category }}
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
@if(!str_contains($options['settings_class'],"Extension"))
|
||||
@canany(["settings.".strtolower($category).".read","settings.".strtolower($category).".write"])
|
||||
<li class="nav-item border-bottom-0">
|
||||
<a href="#{{ $category }}"
|
||||
class="nav-link {{ $loop->first ? 'active' : '' }}"
|
||||
data-toggle="pill"
|
||||
role="tab">
|
||||
<i
|
||||
class="nav-icon fas {{ $options['category_icon'] ?? 'fas fa-cog' }}"></i>
|
||||
<p>
|
||||
{{ $category }}
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
@endif
|
||||
@endforeach
|
||||
</ul>
|
||||
<i class="fa-solid fa-up-right-from-square"></i>
|
||||
<button class="btn btn-outline-secondary" type="button" data-toggle="collapse"
|
||||
data-target="#collapseExtensions" aria-expanded="false"
|
||||
aria-controls="collapseExample">
|
||||
{{__("Extension Settings")}}
|
||||
</button>
|
||||
</p>
|
||||
<div class="collapse" id="collapseExtensions">
|
||||
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="tablist"
|
||||
data-accordion="false">
|
||||
@foreach ($settings as $category => $options)
|
||||
@if(str_contains($options['settings_class'],"Extension"))
|
||||
|
||||
@canany(["settings.".strtolower($category).".read","settings.".strtolower($category).".write"])
|
||||
<li class="nav-item border-bottom-0">
|
||||
<a href="#{{ $category }}"
|
||||
class="nav-link"
|
||||
data-toggle="pill"
|
||||
role="tab">
|
||||
<i class="nav-icon fas {{ $options['category_icon'] ?? 'fas fa-cog' }}"></i>
|
||||
<p>
|
||||
{{ $category }}
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
@endcanany
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
<!-- /.sidebar-menu -->
|
||||
|
@ -85,32 +121,41 @@
|
|||
@csrf
|
||||
@method('POST')
|
||||
<div class="row">
|
||||
<div class="card ml-5" style="width: 18rem;">
|
||||
<span class="h3 text-center">{{__("FavIcon")}} </span>
|
||||
<div class="card-body">
|
||||
|
||||
</div>
|
||||
<input type="file" accept="image/x-icon" class="form-control" name="favicon"
|
||||
id="favicon">
|
||||
</div>
|
||||
|
||||
<div class="card ml-5" style="width: 18rem;">
|
||||
<span class="h3 text-center">{{__("Icon")}} </span>
|
||||
<img src="{{ Storage::disk('public')->exists('icon.png') ? asset('storage/icon.png') : asset('images/controlpanel_logo.png') }}" style="width:5vw;display: block; margin-left: auto;margin-right: auto" class="card-img-top" alt="..." >
|
||||
<span class="h3 text-center">{{__("FavIcon")}} </span>
|
||||
<div class="card-body">
|
||||
|
||||
</div>
|
||||
<input type="file" accept="image/png,image/jpeg,image/jpg" class="form-control"
|
||||
<input type="file" accept="image/x-icon" class="form-control"
|
||||
name="favicon"
|
||||
id="favicon">
|
||||
</div>
|
||||
|
||||
<div class="card ml-5" style="width: 18rem;">
|
||||
<span class="h3 text-center">{{__("Icon")}} </span>
|
||||
<img
|
||||
src="{{ Storage::disk('public')->exists('icon.png') ? asset('storage/icon.png') : asset('images/controlpanel_logo.png') }}"
|
||||
style="width:5vw;display: block; margin-left: auto;margin-right: auto"
|
||||
class="card-img-top" alt="...">
|
||||
<div class="card-body">
|
||||
|
||||
</div>
|
||||
<input type="file" accept="image/png,image/jpeg,image/jpg"
|
||||
class="form-control"
|
||||
name="icon" id="icon">
|
||||
</div>
|
||||
|
||||
<div class="card ml-5" style="width: 18rem;">
|
||||
<span class="h3 text-center">{{__("Login-page Logo")}} </span>
|
||||
<img src="{{ Storage::disk('public')->exists('logo.png') ? asset('storage/logo.png') : asset('images/controlpanel_logo.png') }}" style="width:5vw;display: block; margin-left: auto;margin-right: auto" class="card-img-top" alt="..." >
|
||||
<img
|
||||
src="{{ Storage::disk('public')->exists('logo.png') ? asset('storage/logo.png') : asset('images/controlpanel_logo.png') }}"
|
||||
style="width:5vw;display: block; margin-left: auto;margin-right: auto"
|
||||
class="card-img-top" alt="...">
|
||||
<div class="card-body">
|
||||
|
||||
</div>
|
||||
<input type="file" accept="image/png,image/jpeg,image/jpg" class="form-control"
|
||||
<input type="file" accept="image/png,image/jpeg,image/jpg"
|
||||
class="form-control"
|
||||
name="logo" id="logo">
|
||||
</div>
|
||||
</div>
|
||||
|
@ -121,104 +166,110 @@
|
|||
</div>
|
||||
@foreach ($settings as $category => $options)
|
||||
@canany(["settings.".strtolower($category).".read","settings.".strtolower($category).".write"])
|
||||
<div container class="tab-pane fade container {{ $loop->first ? 'active show' : '' }}"
|
||||
id="{{ $category }}" role="tabpanel">
|
||||
<div
|
||||
class="tab-pane fade container {{ $loop->first ? 'active show' : '' }}"
|
||||
id="{{ $category }}" role="tabpanel">
|
||||
|
||||
<form action="{{ route('admin.settings.update') }}" method="POST">
|
||||
@csrf
|
||||
@method('POST')
|
||||
<input type="hidden" name="settings_class"
|
||||
value="{{ $options['settings_class'] }}">
|
||||
<input type="hidden" name="category" value="{{ $category }}">
|
||||
<form action="{{ route('admin.settings.update') }}" method="POST">
|
||||
@csrf
|
||||
@method('POST')
|
||||
<input type="hidden" name="settings_class"
|
||||
value="{{ $options['settings_class'] }}">
|
||||
<input type="hidden" name="category" value="{{ $category }}">
|
||||
|
||||
@foreach ($options as $key => $value)
|
||||
@if ($key == 'category_icon' || $key == 'settings_class')
|
||||
@continue
|
||||
@endif
|
||||
<div class="row">
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<label for="{{ $key }}">{{ $value['label'] }}</label>
|
||||
</div>
|
||||
@foreach ($options as $key => $value)
|
||||
@if ($key == 'category_icon' || $key == 'settings_class')
|
||||
@continue
|
||||
@endif
|
||||
<div class="row">
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
<label for="{{ $key }}">{{ $value['label'] }}</label>
|
||||
</div>
|
||||
|
||||
<div class="col-8">
|
||||
<div class="custom-control mb-3 d-flex align-items-center">
|
||||
@if ($value['description'])
|
||||
<i class="fas fa-info-circle mr-4" data-toggle="popover"
|
||||
data-trigger="hover" data-placement="top"
|
||||
data-html="true"
|
||||
data-content="{{ $value['description'] }}"></i>
|
||||
@else
|
||||
<i class="fas fa-info-circle mr-4 invisible"></i>
|
||||
@endif
|
||||
<div class="col-8">
|
||||
<div class="custom-control mb-3 d-flex align-items-center">
|
||||
@if ($value['description'])
|
||||
<i class="fas fa-info-circle mr-4"
|
||||
data-toggle="popover"
|
||||
data-trigger="hover" data-placement="top"
|
||||
data-html="true"
|
||||
data-content="{{ $value['description'] }}"></i>
|
||||
@else
|
||||
<i class="fas fa-info-circle mr-4 invisible"></i>
|
||||
@endif
|
||||
|
||||
<div class="w-100">
|
||||
@switch($value)
|
||||
@case($value['type'] == 'string')
|
||||
<input type="text" class="form-control"
|
||||
name="{{ $key }}"
|
||||
value="{{ $value['value'] }}">
|
||||
@break
|
||||
<div class="w-100">
|
||||
@switch($value)
|
||||
@case($value['type'] == 'string')
|
||||
<input type="text" class="form-control"
|
||||
name="{{ $key }}"
|
||||
value="{{ $value['value'] }}">
|
||||
@break
|
||||
|
||||
@case($value['type'] == 'boolean')
|
||||
<input type="checkbox" name="{{ $key }}"
|
||||
value="{{ $value['value'] }}"
|
||||
{{ $value['value'] ? 'checked' : '' }}>
|
||||
@break
|
||||
@case($value['type'] == 'boolean')
|
||||
<input type="checkbox" name="{{ $key }}"
|
||||
value="{{ $value['value'] }}"
|
||||
{{ $value['value'] ? 'checked' : '' }}>
|
||||
@break
|
||||
|
||||
@case($value['type'] == 'number')
|
||||
<input type="number" class="form-control"
|
||||
name="{{ $key }}"
|
||||
value="{{ $value['value'] }}">
|
||||
@break
|
||||
@case($value['type'] == 'number')
|
||||
<input type="number" class="form-control"
|
||||
name="{{ $key }}"
|
||||
value="{{ $value['value'] }}">
|
||||
@break
|
||||
|
||||
@case($value['type'] == 'select')
|
||||
<select id="{{ $key }}"
|
||||
class="custom-select w-100" name="{{ $key }}">
|
||||
@case($value['type'] == 'select')
|
||||
<select id="{{ $key }}"
|
||||
class="custom-select w-100"
|
||||
name="{{ $key }}">
|
||||
|
||||
@foreach ($value['options'] as $option=>$display)
|
||||
<option value="{{ $option }}"
|
||||
{{ $value['value'] == $option ? 'selected' : '' }}>
|
||||
{{ __($display) }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@break
|
||||
@foreach ($value['options'] as $option=>$display)
|
||||
<option value="{{ $option }}"
|
||||
{{ $value['value'] == $option ? 'selected' : '' }}>
|
||||
{{ __($display) }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@break
|
||||
|
||||
@case($value['type'] == 'multiselect')
|
||||
<select id="{{ $key }}"
|
||||
class="custom-select w-100" name="{{ $key }}[]"
|
||||
multiple>
|
||||
@foreach ($value['options'] as $option)
|
||||
<option value="{{ $option }}"
|
||||
{{ strpos($value['value'],$option) !== false ? 'selected' : '' }}>
|
||||
{{ __($option) }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@break
|
||||
@case($value['type'] == 'multiselect')
|
||||
<select id="{{ $key }}"
|
||||
class="custom-select w-100"
|
||||
name="{{ $key }}[]"
|
||||
multiple>
|
||||
@foreach ($value['options'] as $option)
|
||||
<option value="{{ $option }}"
|
||||
{{ strpos($value['value'],$option) !== false ? 'selected' : '' }}>
|
||||
{{ __($option) }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@break
|
||||
|
||||
@case($value['type'] == 'textarea')
|
||||
<textarea class="form-control" name="{{ $key }}" rows="3">{{ $value['value'] }}</textarea>
|
||||
@break
|
||||
@case($value['type'] == 'textarea')
|
||||
<textarea class="form-control"
|
||||
name="{{ $key }}"
|
||||
rows="3">{{ $value['value'] }}</textarea>
|
||||
@break
|
||||
|
||||
@default
|
||||
@endswitch
|
||||
@error($key)
|
||||
@default
|
||||
@endswitch
|
||||
@error($key)
|
||||
<div class="text-danger ">
|
||||
{{ $message }}
|
||||
</div>
|
||||
@enderror
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endforeach
|
||||
@endforeach
|
||||
|
||||
<!-- TODO: Display this only on the General tab
|
||||
<!-- TODO: Display this only on the General tab
|
||||
|
||||
<div class="row">
|
||||
<div class="col-4 d-flex align-items-center">
|
||||
|
@ -230,10 +281,10 @@
|
|||
<div class="w-100">
|
||||
<div class="input-group mb-3">
|
||||
{!! htmlScriptTagJsApi() !!}
|
||||
{!! htmlFormSnippet() !!}
|
||||
@error('g-recaptcha-response')
|
||||
<span class="text-danger" role="alert">
|
||||
<small><strong>{{ $message }}</strong></small>
|
||||
{!! htmlFormSnippet() !!}
|
||||
@error('g-recaptcha-response')
|
||||
<span class="text-danger" role="alert">
|
||||
<small><strong>{{ $message }}</strong></small>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
|
@ -243,16 +294,18 @@
|
|||
-->
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 d-flex align-items-center justify-content-end">
|
||||
<button type="submit"
|
||||
class="btn btn-primary float-right ">Save</button>
|
||||
<button type="reset"
|
||||
class="btn btn-secondary float-right ml-2">Reset</button>
|
||||
<div class="row">
|
||||
<div class="col-12 d-flex align-items-center justify-content-end">
|
||||
<button type="submit"
|
||||
class="btn btn-primary float-right ">Save
|
||||
</button>
|
||||
<button type="reset"
|
||||
class="btn btn-secondary float-right ml-2">Reset
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endcanany
|
||||
@endforeach
|
||||
|
||||
|
@ -261,9 +314,8 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- END CUSTOM CONTENT -->
|
||||
|
@ -277,7 +329,7 @@
|
|||
$('.nav-item a[href="' + tabPaneHash + '"]').tab('show');
|
||||
}
|
||||
|
||||
$('.nav-pills a').click(function(e) {
|
||||
$('.nav-pills a').click(function (e) {
|
||||
$(this).tab('show');
|
||||
const scrollmem = $('body').scrollTop();
|
||||
window.location.hash = this.hash;
|
||||
|
|
Loading…
Add table
Reference in a new issue