Collapseable extension settings
This commit is contained in:
parent
5cff1e5461
commit
a1d302701a
|
@ -12,7 +12,8 @@
|
||||||
<ol class="breadcrumb float-sm-right">
|
<ol class="breadcrumb float-sm-right">
|
||||||
<li class="breadcrumb-item"><a href="">{{ __('Dashboard') }}</a></li>
|
<li class="breadcrumb-item"><a href="">{{ __('Dashboard') }}</a></li>
|
||||||
<li class="breadcrumb-item"><a class="text-muted"
|
<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>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -24,7 +25,9 @@
|
||||||
<h4>{{ __('The installer is not locked!') }}</h4>
|
<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>{{ __('please create a file called "install.lock" in your dashboard Root directory. Otherwise no settings will be loaded!') }}
|
||||||
</p>
|
</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>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
@ -56,21 +59,54 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@foreach ($settings as $category => $options)
|
@foreach ($settings as $category => $options)
|
||||||
@canany(["settings.".strtolower($category).".read","settings.".strtolower($category).".write"])
|
@if(!str_contains($options['settings_class'],"Extension"))
|
||||||
<li class="nav-item border-bottom-0">
|
@canany(["settings.".strtolower($category).".read","settings.".strtolower($category).".write"])
|
||||||
<a href="#{{ $category }}"
|
<li class="nav-item border-bottom-0">
|
||||||
class="nav-link {{ $loop->first ? 'active' : '' }}" data-toggle="pill"
|
<a href="#{{ $category }}"
|
||||||
role="tab">
|
class="nav-link {{ $loop->first ? 'active' : '' }}"
|
||||||
<i
|
data-toggle="pill"
|
||||||
class="nav-icon fas {{ $options['category_icon'] ?? 'fas fa-cog' }}"></i>
|
role="tab">
|
||||||
<p>
|
<i
|
||||||
{{ $category }}
|
class="nav-icon fas {{ $options['category_icon'] ?? 'fas fa-cog' }}"></i>
|
||||||
</p>
|
<p>
|
||||||
</a>
|
{{ $category }}
|
||||||
</li>
|
</p>
|
||||||
@endcanany
|
</a>
|
||||||
|
</li>
|
||||||
|
@endcanany
|
||||||
|
@endif
|
||||||
@endforeach
|
@endforeach
|
||||||
</ul>
|
</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>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.sidebar-menu -->
|
<!-- /.sidebar-menu -->
|
||||||
|
@ -85,32 +121,41 @@
|
||||||
@csrf
|
@csrf
|
||||||
@method('POST')
|
@method('POST')
|
||||||
<div class="row">
|
<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;">
|
<div class="card ml-5" style="width: 18rem;">
|
||||||
<span class="h3 text-center">{{__("Icon")}} </span>
|
<span class="h3 text-center">{{__("FavIcon")}} </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 class="card-body">
|
||||||
|
|
||||||
</div>
|
</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">
|
name="icon" id="icon">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card ml-5" style="width: 18rem;">
|
<div class="card ml-5" style="width: 18rem;">
|
||||||
<span class="h3 text-center">{{__("Login-page Logo")}} </span>
|
<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 class="card-body">
|
||||||
|
|
||||||
</div>
|
</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">
|
name="logo" id="logo">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -121,104 +166,110 @@
|
||||||
</div>
|
</div>
|
||||||
@foreach ($settings as $category => $options)
|
@foreach ($settings as $category => $options)
|
||||||
@canany(["settings.".strtolower($category).".read","settings.".strtolower($category).".write"])
|
@canany(["settings.".strtolower($category).".read","settings.".strtolower($category).".write"])
|
||||||
<div container class="tab-pane fade container {{ $loop->first ? 'active show' : '' }}"
|
<div
|
||||||
id="{{ $category }}" role="tabpanel">
|
class="tab-pane fade container {{ $loop->first ? 'active show' : '' }}"
|
||||||
|
id="{{ $category }}" role="tabpanel">
|
||||||
|
|
||||||
<form action="{{ route('admin.settings.update') }}" method="POST">
|
<form action="{{ route('admin.settings.update') }}" method="POST">
|
||||||
@csrf
|
@csrf
|
||||||
@method('POST')
|
@method('POST')
|
||||||
<input type="hidden" name="settings_class"
|
<input type="hidden" name="settings_class"
|
||||||
value="{{ $options['settings_class'] }}">
|
value="{{ $options['settings_class'] }}">
|
||||||
<input type="hidden" name="category" value="{{ $category }}">
|
<input type="hidden" name="category" value="{{ $category }}">
|
||||||
|
|
||||||
@foreach ($options as $key => $value)
|
@foreach ($options as $key => $value)
|
||||||
@if ($key == 'category_icon' || $key == 'settings_class')
|
@if ($key == 'category_icon' || $key == 'settings_class')
|
||||||
@continue
|
@continue
|
||||||
@endif
|
@endif
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-4 d-flex align-items-center">
|
<div class="col-4 d-flex align-items-center">
|
||||||
<label for="{{ $key }}">{{ $value['label'] }}</label>
|
<label for="{{ $key }}">{{ $value['label'] }}</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<div class="custom-control mb-3 d-flex align-items-center">
|
<div class="custom-control mb-3 d-flex align-items-center">
|
||||||
@if ($value['description'])
|
@if ($value['description'])
|
||||||
<i class="fas fa-info-circle mr-4" data-toggle="popover"
|
<i class="fas fa-info-circle mr-4"
|
||||||
data-trigger="hover" data-placement="top"
|
data-toggle="popover"
|
||||||
data-html="true"
|
data-trigger="hover" data-placement="top"
|
||||||
data-content="{{ $value['description'] }}"></i>
|
data-html="true"
|
||||||
@else
|
data-content="{{ $value['description'] }}"></i>
|
||||||
<i class="fas fa-info-circle mr-4 invisible"></i>
|
@else
|
||||||
@endif
|
<i class="fas fa-info-circle mr-4 invisible"></i>
|
||||||
|
@endif
|
||||||
|
|
||||||
<div class="w-100">
|
<div class="w-100">
|
||||||
@switch($value)
|
@switch($value)
|
||||||
@case($value['type'] == 'string')
|
@case($value['type'] == 'string')
|
||||||
<input type="text" class="form-control"
|
<input type="text" class="form-control"
|
||||||
name="{{ $key }}"
|
name="{{ $key }}"
|
||||||
value="{{ $value['value'] }}">
|
value="{{ $value['value'] }}">
|
||||||
@break
|
@break
|
||||||
|
|
||||||
@case($value['type'] == 'boolean')
|
@case($value['type'] == 'boolean')
|
||||||
<input type="checkbox" name="{{ $key }}"
|
<input type="checkbox" name="{{ $key }}"
|
||||||
value="{{ $value['value'] }}"
|
value="{{ $value['value'] }}"
|
||||||
{{ $value['value'] ? 'checked' : '' }}>
|
{{ $value['value'] ? 'checked' : '' }}>
|
||||||
@break
|
@break
|
||||||
|
|
||||||
@case($value['type'] == 'number')
|
@case($value['type'] == 'number')
|
||||||
<input type="number" class="form-control"
|
<input type="number" class="form-control"
|
||||||
name="{{ $key }}"
|
name="{{ $key }}"
|
||||||
value="{{ $value['value'] }}">
|
value="{{ $value['value'] }}">
|
||||||
@break
|
@break
|
||||||
|
|
||||||
@case($value['type'] == 'select')
|
@case($value['type'] == 'select')
|
||||||
<select id="{{ $key }}"
|
<select id="{{ $key }}"
|
||||||
class="custom-select w-100" name="{{ $key }}">
|
class="custom-select w-100"
|
||||||
|
name="{{ $key }}">
|
||||||
|
|
||||||
@foreach ($value['options'] as $option=>$display)
|
@foreach ($value['options'] as $option=>$display)
|
||||||
<option value="{{ $option }}"
|
<option value="{{ $option }}"
|
||||||
{{ $value['value'] == $option ? 'selected' : '' }}>
|
{{ $value['value'] == $option ? 'selected' : '' }}>
|
||||||
{{ __($display) }}
|
{{ __($display) }}
|
||||||
</option>
|
</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</select>
|
||||||
@break
|
@break
|
||||||
|
|
||||||
@case($value['type'] == 'multiselect')
|
@case($value['type'] == 'multiselect')
|
||||||
<select id="{{ $key }}"
|
<select id="{{ $key }}"
|
||||||
class="custom-select w-100" name="{{ $key }}[]"
|
class="custom-select w-100"
|
||||||
multiple>
|
name="{{ $key }}[]"
|
||||||
@foreach ($value['options'] as $option)
|
multiple>
|
||||||
<option value="{{ $option }}"
|
@foreach ($value['options'] as $option)
|
||||||
{{ strpos($value['value'],$option) !== false ? 'selected' : '' }}>
|
<option value="{{ $option }}"
|
||||||
{{ __($option) }}
|
{{ strpos($value['value'],$option) !== false ? 'selected' : '' }}>
|
||||||
</option>
|
{{ __($option) }}
|
||||||
@endforeach
|
</option>
|
||||||
</select>
|
@endforeach
|
||||||
@break
|
</select>
|
||||||
|
@break
|
||||||
|
|
||||||
@case($value['type'] == 'textarea')
|
@case($value['type'] == 'textarea')
|
||||||
<textarea class="form-control" name="{{ $key }}" rows="3">{{ $value['value'] }}</textarea>
|
<textarea class="form-control"
|
||||||
@break
|
name="{{ $key }}"
|
||||||
|
rows="3">{{ $value['value'] }}</textarea>
|
||||||
|
@break
|
||||||
|
|
||||||
@default
|
@default
|
||||||
@endswitch
|
@endswitch
|
||||||
@error($key)
|
@error($key)
|
||||||
<div class="text-danger ">
|
<div class="text-danger ">
|
||||||
{{ $message }}
|
{{ $message }}
|
||||||
</div>
|
</div>
|
||||||
@enderror
|
@enderror
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</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="row">
|
||||||
<div class="col-4 d-flex align-items-center">
|
<div class="col-4 d-flex align-items-center">
|
||||||
|
@ -230,10 +281,10 @@
|
||||||
<div class="w-100">
|
<div class="w-100">
|
||||||
<div class="input-group mb-3">
|
<div class="input-group mb-3">
|
||||||
{!! htmlScriptTagJsApi() !!}
|
{!! htmlScriptTagJsApi() !!}
|
||||||
{!! htmlFormSnippet() !!}
|
{!! htmlFormSnippet() !!}
|
||||||
@error('g-recaptcha-response')
|
@error('g-recaptcha-response')
|
||||||
<span class="text-danger" role="alert">
|
<span class="text-danger" role="alert">
|
||||||
<small><strong>{{ $message }}</strong></small>
|
<small><strong>{{ $message }}</strong></small>
|
||||||
</span>
|
</span>
|
||||||
@enderror
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
|
@ -243,16 +294,18 @@
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 d-flex align-items-center justify-content-end">
|
<div class="col-12 d-flex align-items-center justify-content-end">
|
||||||
<button type="submit"
|
<button type="submit"
|
||||||
class="btn btn-primary float-right ">Save</button>
|
class="btn btn-primary float-right ">Save
|
||||||
<button type="reset"
|
</button>
|
||||||
class="btn btn-secondary float-right ml-2">Reset</button>
|
<button type="reset"
|
||||||
|
class="btn btn-secondary float-right ml-2">Reset
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</form>
|
||||||
</form>
|
</div>
|
||||||
</div>
|
|
||||||
@endcanany
|
@endcanany
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
||||||
|
@ -261,9 +314,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- END CUSTOM CONTENT -->
|
<!-- END CUSTOM CONTENT -->
|
||||||
|
@ -277,7 +329,7 @@
|
||||||
$('.nav-item a[href="' + tabPaneHash + '"]').tab('show');
|
$('.nav-item a[href="' + tabPaneHash + '"]').tab('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.nav-pills a').click(function(e) {
|
$('.nav-pills a').click(function (e) {
|
||||||
$(this).tab('show');
|
$(this).tab('show');
|
||||||
const scrollmem = $('body').scrollTop();
|
const scrollmem = $('body').scrollTop();
|
||||||
window.location.hash = this.hash;
|
window.location.hash = this.hash;
|
||||||
|
|
Loading…
Reference in a new issue