sarga/packages/Webkul/Admin/src/Resources/views/configuration/index.blade.php

100 lines
3.6 KiB
PHP
Raw Normal View History

@extends('admin::layouts.content')
@section('page_title')
{{ __('admin::app.configuration.title') }}
@stop
@section('content')
<div class="content">
<?php $locale = request()->get('locale') ?: app()->getLocale(); ?>
<?php $channel = request()->get('channel') ?: core()->getDefaultChannelCode(); ?>
<form method="POST" action="" @submit.prevent="onSubmit" enctype="multipart/form-data">
<div class="page-header">
<div class="page-title">
<h1>
{{ __('admin::app.configuration.title') }}
</h1>
<div class="control-group">
<select class="control" id="channel-switcher" name="channel">
2019-01-15 11:54:41 +00:00
@foreach (core()->getAllChannels() as $channelModel)
<option value="{{ $channelModel->code }}" {{ ($channelModel->code) == $channel ? 'selected' : '' }}>
{{ $channelModel->name }}
</option>
@endforeach
</select>
</div>
<div class="control-group">
<select class="control" id="locale-switcher" name="locale">
2019-01-15 11:54:41 +00:00
@foreach (core()->getAllLocales() as $localeModel)
<option value="{{ $localeModel->code }}" {{ ($localeModel->code) == $locale ? 'selected' : '' }}>
{{ $localeModel->name }}
</option>
@endforeach
</select>
</div>
</div>
<div class="page-action">
<button type="submit" class="btn btn-lg btn-primary">
{{ __('admin::app.configuration.save-btn-title') }}
</button>
</div>
</div>
<div class="page-content">
<div class="form-container">
@csrf()
2019-12-30 11:40:38 +00:00
@if ($groups = \Illuminate\Support\Arr::get($config->items, request()->route('slug') . '.children.' . request()->route('slug2') . '.children'))
2018-12-14 06:26:52 +00:00
@foreach ($groups as $key => $item)
<accordian :title="'{{ __($item['name']) }}'" :active="true">
<div slot="body">
@foreach ($item['fields'] as $field)
@include ('admin::configuration.field-type', ['field' => $field])
2018-12-14 06:26:52 +00:00
2020-01-17 13:42:47 +00:00
@php ($hint = $field['title'] . '-hint')
@if ($hint !== __($hint))
{{ __($hint) }}
@endif
@endforeach
</div>
</accordian>
@endforeach
@endif
</div>
</div>
</form>
</div>
@stop
@push('scripts')
<script>
$(document).ready(function () {
$('#channel-switcher, #locale-switcher').on('change', function (e) {
$('#channel-switcher').val()
var query = '?channel=' + $('#channel-switcher').val() + '&locale=' + $('#locale-switcher').val();
2018-12-14 06:26:52 +00:00
window.location.href = "{{ route('admin.configuration.index', [request()->route('slug'), request()->route('slug2')]) }}" + query;
})
});
</script>
@endpush