first commit
This commit is contained in:
30
admininistrator/view/template/design/banner.twig
Normal file
30
admininistrator/view/template/design/banner.twig
Normal file
@ -0,0 +1,30 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end"><a href="{{ add }}" data-bs-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i class="fa-solid fa-plus"></i></a>
|
||||
<button type="submit" form="form-banner" formaction="{{ delete }}" data-bs-toggle="tooltip" title="{{ button_delete }}" onclick="return confirm('{{ text_confirm }}');" class="btn btn-danger"><i class="fa-regular fa-trash-can"></i></button>
|
||||
</div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-list"></i> {{ text_list }}</div>
|
||||
<div id="banner" class="card-body">{{ list }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#banner').on('click', 'thead a, .pagination a', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#banner').load(this.href);
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
135
admininistrator/view/template/design/banner_form.twig
Normal file
135
admininistrator/view/template/design/banner_form.twig
Normal file
@ -0,0 +1,135 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end">
|
||||
<button type="submit" form="form-banner" data-bs-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa-solid fa-floppy-disk"></i></button>
|
||||
<a href="{{ back }}" data-bs-toggle="tooltip" title="{{ button_back }}" class="btn btn-light"><i class="fa-solid fa-reply"></i></a></div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-pencil"></i> {{ text_form }}</div>
|
||||
<div class="card-body">
|
||||
<form id="form-banner" action="{{ save }}" method="post" data-oc-toggle="ajax">
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-name" class="col-sm-2 col-form-label">{{ entry_name }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="name" value="{{ name }}" placeholder="{{ entry_name }}" id="input-name" class="form-control"/>
|
||||
<div id="error-name" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label">{{ entry_status }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="form-check form-switch form-switch-lg">
|
||||
<input type="hidden" name="status" value="0"/>
|
||||
<input type="checkbox" name="status" value="1" id="input-status" class="form-check-input"{% if status %} checked{% endif %}/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<ul class="nav nav-tabs">
|
||||
{% for language in languages %}
|
||||
<li class="nav-item"><a href="#language-{{ language.language_id }}" data-bs-toggle="tab" class="nav-link{% if loop.first %} active{% endif %}"><img src="{{ language.image }}" title="{{ language.name }}"/> {{ language.name }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
{% set image_row = 0 %}
|
||||
{% for language in languages %}
|
||||
<div id="language-{{ language.language_id }}" class="tab-pane{% if loop.first %} active{% endif %}">
|
||||
<table id="image-{{ language.language_id }}" class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-start required">{{ entry_title }}</td>
|
||||
<td class="text-start">{{ entry_link }}</td>
|
||||
<td class="text-center">{{ entry_image }}</td>
|
||||
<td class="text-end">{{ entry_sort_order }}</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if banner_images[language.language_id] %}
|
||||
{% for banner_image in banner_images[language.language_id] %}
|
||||
|
||||
<tr id="image-row-{{ image_row }}">
|
||||
|
||||
<td class="text-start">
|
||||
<input type="text" name="banner_image[{{ language.language_id }}][{{ image_row }}][title]" value="{{ banner_image.title }}" placeholder="{{ entry_title }}" id="input-image-{{ language.language_id }}-{{ image_row }}-title" class="form-control"/>
|
||||
<div id="error-image-{{ language.language_id }}-{{ image_row }}-title" class="invalid-feedback"></div>
|
||||
</td>
|
||||
|
||||
<td class="text-start" style="width: 30%;"><input type="text" name="banner_image[{{ language.language_id }}][{{ image_row }}][link]" value="{{ banner_image.link }}" placeholder="{{ entry_link }}" id="input-image-{{ language.language_id }}-{{ image_row }}-link" class="form-control"/></td>
|
||||
<td class="text-center">
|
||||
|
||||
<div class="card">
|
||||
|
||||
<img src="{{ banner_image.thumb }}" alt="" title="" id="thumb-image-{{ language.language_id }}-{{ image_row }}" data-oc-placeholder="{{ placeholder }}" class="card-img-top"/>
|
||||
<input type="hidden" name="banner_image[{{ language.language_id }}][{{ image_row }}][image]" value="{{ banner_image.image }}" id="input-image-{{ language.language_id }}-{{ image_row }}-image"/>
|
||||
<div class="card-body">
|
||||
<button type="button" data-oc-toggle="image" data-oc-target="#input-image-{{ language.language_id }}-{{ image_row }}-image" data-oc-thumb="#thumb-image-{{ language.language_id }}-{{ image_row }}" class="btn btn-primary btn-sm btn-block"><i class="fa-solid fa-pencil"></i> {{ button_edit }}</button>
|
||||
<button type="button" data-oc-toggle="clear" data-oc-target="#input-image-{{ language.language_id }}-{{ image_row }}-image" data-oc-thumb="#thumb-image-{{ language.language_id }}-{{ image_row }}" class="btn btn-warning btn-sm btn-block"><i class="fa-regular fa-trash-can"></i> {{ button_clear }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-end" style="width: 10%;"><input type="text" name="banner_image[{{ language.language_id }}][{{ image_row }}][sort_order]" value="{{ banner_image.sort_order }}" placeholder="{{ entry_sort_order }}" id="input-image-{{ language.language_id }}-{{ image_row }}-sort-order" class="form-control"/></td>
|
||||
<td class="text-end"><button type="button" onclick="$('#image-row-{{ image_row }}').remove();" data-bs-toggle="tooltip" title="{{ button_remove|escape('js') }}" class="btn btn-danger"><i class="fa-solid fa-minus-circle"></i></button></td>
|
||||
</tr>
|
||||
{% set image_row = image_row + 1 %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="4"></td>
|
||||
<td class="text-end"><button type="button" id="button-banner-{{ language.language_id }}" data-language="{{ language.language_id }}" data-bs-toggle="tooltip" title="{{ button_banner_add }}" class="btn btn-primary"><i class="fa-solid fa-plus-circle"></i></button></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<input type="hidden" name="banner_id" value="{{ banner_id }}" id="input-banner-id"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
var image_row = {{ image_row }};
|
||||
|
||||
$('button[id^=\'button-banner\']').on('click', function () {
|
||||
var element = this;
|
||||
|
||||
html = '<tr id="image-row-' + image_row + '">';
|
||||
html += ' <td class="text-start">';
|
||||
html += ' <input type="text" name="banner_image[' + $(element).attr('data-language') + '][' + image_row + '][title]" value="" placeholder="{{ entry_title|escape('js') }}" id="input-image-' + $(element).attr('data-language') + '-' + image_row + '-title" class="form-control"/>';
|
||||
html += ' <div id="error-image-' + $(element).attr('data-language') + '-' + image_row + '-title" class="invalid-feedback"></div>';
|
||||
html += ' </td>';
|
||||
html += ' <td class="text-start"><input type="text" name="banner_image[' + $(element).attr('data-language') + '][' + image_row + '][link]" value="" placeholder="{{ entry_link|escape('js') }}" id="input-image-' + $(element).attr('data-language') + '-' + image_row + '-link" class="form-control"/></td>';
|
||||
html += ' <td class="text-center">';
|
||||
html += ' <div class="card">';
|
||||
html += ' <img src="{{ placeholder|escape('js') }}" alt="" title="" id="thumb-image-' + $(element).attr('data-language') + '-' + image_row + '" data-oc-placeholder="{{ placeholder|escape('js') }}" class="card-img-top"/>';
|
||||
html += ' <input type="hidden" name="banner_image[' + $(element).attr('data-language') + '][' + image_row + '][image]" value="" id="input-image-' + $(element).attr('data-language') + '-' + image_row + '-image"/>';
|
||||
html += ' <div class="card-body">';
|
||||
html += ' <button type="button" data-oc-toggle="image" data-oc-target="#input-image-' + $(element).attr('data-language') + '-' + image_row + '-image" data-oc-thumb="#thumb-image-' + $(element).attr('data-language') + '-' + image_row + '" class="btn btn-primary btn-sm btn-block"><i class="fa-solid fa-pencil"></i> {{ button_edit|escape('js') }}</button>';
|
||||
html += ' <button type="button" data-oc-toggle="clear" data-oc-target="#input-image-' + $(element).attr('data-language') + '-' + image_row + '-image" data-oc-thumb="#thumb-image-' + $(element).attr('data-language') + '-' + image_row + '" class="btn btn-warning btn-sm btn-block"><i class="fa-regular fa-trash-can"></i> {{ button_clear|escape('js') }}</button>';
|
||||
html += ' </div>';
|
||||
html += ' </div>';
|
||||
html += ' </td>';
|
||||
html += ' <td class="text-end"><input type="text" name="banner_image[' + $(element).attr('data-language') + '][' + image_row + '][sort_order]" value="" placeholder="{{ entry_sort_order|escape('js') }}" id="input-image-' + $(element).attr('data-language') + '-' + image_row + '-sort-order" class="form-control"/></td>';
|
||||
html += ' <td class="text-end"><button type="button" onclick="$(\'#image-row-' + image_row + '\').remove();" data-bs-toggle="tooltip" title="{{ button_remove|escape('js') }}" class="btn btn-danger"><i class="fa-solid fa-minus-circle"></i></button></td>';
|
||||
html += '</tr>';
|
||||
|
||||
$('#image-' + $(element).attr('data-language') + ' tbody').append(html);
|
||||
|
||||
image_row++;
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
39
admininistrator/view/template/design/banner_list.twig
Normal file
39
admininistrator/view/template/design/banner_list.twig
Normal file
@ -0,0 +1,39 @@
|
||||
<form id="form-banner" method="post" data-oc-toggle="ajax" data-oc-load="{{ action }}" data-oc-target="#banner">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-center" style="width: 1px;"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', $(this).prop('checked'));" class="form-check-input"/></td>
|
||||
<td class="text-start"><a href="{{ sort_name }}"{% if sort == 'name' %} class="{{ order|lower }}"{% endif %}>{{ column_name }}</a></td>
|
||||
<td class="text-end">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if banners %}
|
||||
{% for banner in banners %}
|
||||
<tr>
|
||||
<td class="text-center"><input type="checkbox" name="selected[]" value="{{ banner.banner_id }}" class="form-check-input"/></td>
|
||||
<td class="text-start">{{ banner.name }}
|
||||
<br/>
|
||||
{% if banner.status %}
|
||||
<small class="text-success">{{ text_enabled }}</small>
|
||||
{% else %}
|
||||
<small class="text-danger">{{ text_disabled }}</small>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-end"><a href="{{ banner.edit }}" data-bs-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa-solid fa-pencil"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="3">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
||||
</form>
|
30
admininistrator/view/template/design/layout.twig
Normal file
30
admininistrator/view/template/design/layout.twig
Normal file
@ -0,0 +1,30 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end"><a href="{{ add }}" data-bs-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i class="fa-solid fa-plus"></i></a>
|
||||
<button type="submit" form="form-layout" formaction="{{ delete }}" data-bs-toggle="tooltip" title="{{ button_delete }}" onclick="return confirm('{{ text_confirm }}');" class="btn btn-danger"><i class="fa-regular fa-trash-can"></i></button>
|
||||
</div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-list"></i> {{ text_list }}</div>
|
||||
<div id="layout" class="card-body">{{ list }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#layout').on('click', 'thead a, .pagination a', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#layout').load(this.href);
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
302
admininistrator/view/template/design/layout_form.twig
Normal file
302
admininistrator/view/template/design/layout_form.twig
Normal file
@ -0,0 +1,302 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end">
|
||||
<button type="submit" form="form-layout" data-bs-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa-solid fa-floppy-disk"></i></button>
|
||||
<a href="{{ back }}" data-bs-toggle="tooltip" title="{{ button_back }}" class="btn btn-light"><i class="fa-solid fa-reply"></i></a></div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-pencil"></i> {{ text_form }}</div>
|
||||
<div class="card-body">
|
||||
<form id="form-layout" action="{{ save }}" method="post" data-oc-toggle="ajax">
|
||||
<fieldset>
|
||||
<legend>{{ text_route }}</legend>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-name" class="col-sm-2 col-form-label">{{ entry_name }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="name" value="{{ name }}" placeholder="{{ entry_name }}" id="input-name" class="form-control"/>
|
||||
<div id="error-name" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<table id="route" class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-start">{{ entry_store }}</td>
|
||||
<td class="text-start">{{ entry_route }}</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% set route_row = 0 %}
|
||||
{% for layout_route in layout_routes %}
|
||||
<tr id="route-row-{{ route_row }}">
|
||||
<td class="text-start"><select name="layout_route[{{ route_row }}][store_id]" class="form-select">
|
||||
<option value="0">{{ text_default }}</option>
|
||||
{% for store in stores %}
|
||||
<option value="{{ store.store_id }}"{% if store.store_id == layout_route.store_id %} selected{% endif %}>{{ store.name }}</option>
|
||||
{% endfor %}
|
||||
</select></td>
|
||||
<td class="text-start"><input type="text" name="layout_route[{{ route_row }}][route]" value="{{ layout_route.route }}" placeholder="{{ entry_route|escape('js') }}" class="form-control"/></td>
|
||||
<td class="text-end"><button type="button" onclick="$('#route-row-{{ route_row }}').remove();" data-bs-toggle="tooltip" title="{{ button_remove|escape('js') }}" class="btn btn-danger"><i class="fa-solid fa-minus-circle"></i></button></td>
|
||||
</tr>
|
||||
{% set route_row = route_row + 1 %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2"></td>
|
||||
<td class="text-end"><button type="button" onclick="addRoute();" data-bs-toggle="tooltip" title="{{ button_route_add|escape('js') }}" class="btn btn-primary"><i class="fa-solid fa-plus-circle"></i></button></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{{ text_module }}</legend>
|
||||
{% set module_row = 0 %}
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-md-4 col-sm-12">
|
||||
<table id="module-column-left" class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-center">{{ text_column_left }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for layout_module in layout_modules %}
|
||||
{% if layout_module.position == 'column_left' %}
|
||||
<tr id="module-row-{{ module_row }}">
|
||||
<td class="text-start">
|
||||
<div class="input-group input-group-sm">
|
||||
<select name="layout_module[{{ module_row }}][code]" class="form-select input-sm">
|
||||
{% for extension in extensions %}
|
||||
<optgroup label="{{ extension.name }}">
|
||||
{% if not extension.module %}
|
||||
<option value="{{ extension.code }}"{% if extension.code == layout_module.code %} selected{% endif %}>{{ extension.name }}</option>
|
||||
{% else %}
|
||||
{% for module in extension.module %}
|
||||
<option value="{{ module.code }}"{% if module.code == layout_module.code %} selected{% endif %}>{{ module.name }}</option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</optgroup>
|
||||
{% endfor %}
|
||||
</select> <input type="hidden" name="layout_module[{{ module_row }}][position]" value="{{ layout_module.position }}"/> <input type="hidden" name="layout_module[{{ module_row }}][sort_order]" value="{{ layout_module.sort_order }}"/> <a href="{{ layout_module.edit }}" data-bs-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary btn-sm"><i class="fa-solid fa-pencil fa-fw"></i></a>
|
||||
<button type="button" onclick="$('#module-row-{{ module_row }}').remove();" data-bs-toggle="tooltip" title="{{ button_remove|escape('js') }}" class="btn btn-danger btn-sm"><i class="fa-solid fa-minus-circle fa-fw"></i></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% set module_row = module_row + 1 %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td class="text-end"><button type="button" onclick="addModule('column-left');" data-bs-toggle="tooltip" title="{{ button_module_add|escape('js') }}" class="btn btn-primary btn-sm"><i class="fa-solid fa-plus-circle fa-fw"></i></button></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-4 col-sm-12">
|
||||
<table id="module-content-top" class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-center">{{ text_content_top }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for layout_module in layout_modules %}
|
||||
{% if layout_module.position == 'content_top' %}
|
||||
<tr id="module-row-{{ module_row }}">
|
||||
<td class="text-start">
|
||||
<div class="input-group input-group-sm">
|
||||
<select name="layout_module[{{ module_row }}][code]" class="form-select input-sm">
|
||||
{% for extension in extensions %}
|
||||
<optgroup label="{{ extension.name }}">
|
||||
{% if not extension.module %}
|
||||
<option value="{{ extension.code }}"{% if extension.code == layout_module.code %} selected{% endif %}>{{ extension.name }}</option>
|
||||
{% else %}
|
||||
{% for module in extension.module %}
|
||||
<option value="{{ module.code }}"{% if module.code == layout_module.code %} selected{% endif %}>{{ module.name }}</option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</optgroup>
|
||||
{% endfor %}
|
||||
</select><input type="hidden" name="layout_module[{{ module_row }}][position]" value="{{ layout_module.position }}"/> <input type="hidden" name="layout_module[{{ module_row }}][sort_order]" value="{{ layout_module.sort_order }}"/> <a href="{{ layout_module.edit }}" data-bs-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary btn-sm"><i class="fa-solid fa-pencil fa-fw"></i></a>
|
||||
<button type="button" onclick="$('#module-row-{{ module_row }}').remove();" data-bs-toggle="tooltip" title="{{ button_remove }}" class="btn btn-danger btn-sm"><i class="fa-solid fa-minus-circle fa-fw"></i></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% set module_row = module_row + 1 %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td class="text-end"><button type="button" onclick="addModule('content-top');" data-bs-toggle="tooltip" title="{{ button_module_add }}" class="btn btn-primary btn-sm"><i class="fa-solid fa-plus-circle fa-fw"></i></button></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<table id="module-content-bottom" class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-center">{{ text_content_bottom }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for layout_module in layout_modules %}
|
||||
{% if layout_module.position == 'content_bottom' %}
|
||||
<tr id="module-row-{{ module_row }}">
|
||||
<td class="text-start">
|
||||
<div class="input-group input-group-sm">
|
||||
<select name="layout_module[{{ module_row }}][code]" class="form-select input-sm">
|
||||
{% for extension in extensions %}
|
||||
<optgroup label="{{ extension.name }}">
|
||||
{% if not extension.module %}
|
||||
<option value="{{ extension.code }}"{% if extension.code == layout_module.code %} selected{% endif %}>{{ extension.name }}</option>
|
||||
{% else %}
|
||||
{% for module in extension.module %}
|
||||
<option value="{{ module.code }}"{% if module.code == layout_module.code %} selected{% endif %}>{{ module.name }}</option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</optgroup>
|
||||
{% endfor %}
|
||||
</select> <input type="hidden" name="layout_module[{{ module_row }}][position]" value="{{ layout_module.position }}"/> <input type="hidden" name="layout_module[{{ module_row }}][sort_order]" value="{{ layout_module.sort_order }}"/> <a href="{{ layout_module.edit }}" data-bs-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary btn-sm"><i class="fa-solid fa-pencil fa-fw"></i></a>
|
||||
<button type="button" onclick="$('#module-row-{{ module_row }}').remove();" data-bs-toggle="tooltip" title="{{ button_remove }}" class="btn btn-danger btn-sm"><i class="fa-solid fa-minus-circle fa-fw"></i></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% set module_row = module_row + 1 %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td class="text-end"><button type="button" onclick="addModule('content-bottom');" data-bs-toggle="tooltip" title="{{ button_module_add }}" class="btn btn-primary btn-sm"><i class="fa-solid fa-plus-circle fa-fw"></i></button></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-4 col-sm-12">
|
||||
<table id="module-column-right" class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-center">{{ text_column_right }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for layout_module in layout_modules %}
|
||||
{% if layout_module.position == 'column_right' %}
|
||||
<tr id="module-row-{{ module_row }}">
|
||||
<td class="text-end">
|
||||
<div class="input-group input-group-sm">
|
||||
<select name="layout_module[{{ module_row }}][code]" class="form-select input-sm">
|
||||
{% for extension in extensions %}
|
||||
<optgroup label="{{ extension.name }}">
|
||||
{% if not extension.module %}
|
||||
<option value="{{ extension.code }}"{% if extension.code == layout_module.code %} selected{% endif %}>{{ extension.name }}</option>
|
||||
{% else %}
|
||||
{% for module in extension.module %}
|
||||
<option value="{{ module.code }}"{% if module.code == layout_module.code %} selected{% endif %}>{{ module.name }}</option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</optgroup>
|
||||
{% endfor %}
|
||||
</select> <input type="hidden" name="layout_module[{{ module_row }}][position]" value="{{ layout_module.position }}"/> <input type="hidden" name="layout_module[{{ module_row }}][sort_order]" value="{{ layout_module.sort_order }}"/> <a href="{{ layout_module.edit }}" data-bs-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary btn-sm"><i class="fa-solid fa-pencil fa-fw"></i></a>
|
||||
<button type="button" onclick="$('#module-row-{{ module_row }}').remove();" data-bs-toggle="tooltip" title="{{ button_remove }}" class="btn btn-danger btn-sm"><i class="fa-solid fa-minus-circle fa-fw"></i></button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% set module_row = module_row + 1 %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td class="text-end"><button type="button" onclick="addModule('column-right');" data-bs-toggle="tooltip" title="{{ button_module_add }}" class="btn btn-primary btn-sm"><i class="fa-solid fa-plus-circle fa-fw"></i></button></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<input type="hidden" name="layout_id" value="{{ layout_id }}" id="input-layout-id"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
var route_row = {{ route_row }};
|
||||
|
||||
function addRoute() {
|
||||
html = '<tr id="route-row-' + route_row + '">';
|
||||
html += ' <td class="text-start"><select name="layout_route[' + route_row + '][store_id]" class="form-select">';
|
||||
html += ' <option value="0">{{ text_default|escape('js') }}</option>';
|
||||
{% for store in stores %}
|
||||
html += '<option value="{{ store.store_id }}">{{ store.name|escape('js') }}</option>';
|
||||
{% endfor %}
|
||||
html += ' </select></td>';
|
||||
html += ' <td class="text-start"><input type="text" name="layout_route[' + route_row + '][route]" value="" placeholder="{{ entry_route|escape('js') }}" class="form-control"/></td>';
|
||||
html += ' <td class="text-end"><button type="button" onclick="$(\'#route-row-' + route_row + '\').remove();" data-bs-toggle="tooltip" title="{{ button_remove|escape('js') }}" class="btn btn-danger"><i class="fa-solid fa-minus-circle"></i></button></td>';
|
||||
html += '</tr>';
|
||||
|
||||
$('#route tbody').append(html);
|
||||
|
||||
route_row++;
|
||||
}
|
||||
|
||||
var module_row = {{ module_row }};
|
||||
|
||||
function addModule(type) {
|
||||
html = '<tr id="module-row-' + module_row + '">';
|
||||
html += ' <td class="text-start"><div class="input-group input-group-sm">';
|
||||
html += ' <select name="layout_module[' + module_row + '][code]" class="form-select input-sm">';
|
||||
{% for extension in extensions %}
|
||||
html += ' <optgroup label="{{ extension.name|escape('js') }}">';
|
||||
{% if not extension.module %}
|
||||
html += ' <option value="{{ extension.code|escape('js') }}">{{ extension.name|escape('js') }}</option>';
|
||||
{% else %}
|
||||
{% for module in extension.module %}
|
||||
html += ' <option value="{{ module.code|escape('js') }}">{{ module.name|escape('js') }}</option>';
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
html += ' </optgroup>';
|
||||
{% endfor %}
|
||||
html += ' </select>';
|
||||
html += ' <input type="hidden" name="layout_module[' + module_row + '][position]" value="' + type.replaceAll('-', '_') + '" />';
|
||||
html += ' <input type="hidden" name="layout_module[' + module_row + '][sort_order]" value="" />';
|
||||
html += ' <a href=" data-bs-toggle="tooltip" title="{{ button_edit|escape('js') }}" class="btn btn-primary btn-sm"><i class="fa-solid fa-pencil fa-fw"></i></a><button type="button" onclick="$(\'#module-row-' + module_row + '\').remove();" data-bs-toggle="tooltip" title="{{ button_remove|escape('js') }}" class="btn btn-danger btn-sm"><i class="fa-solid fa-minus-circle fa-fw"></i></button>';
|
||||
html += ' </div></td>';
|
||||
html += '</tr>';
|
||||
|
||||
$('#module-' + type + ' tbody').append(html);
|
||||
|
||||
$('#module-' + type + ' tbody input[name*=\'sort_order\']').each(function (i, element) {
|
||||
$(element).val(i);
|
||||
});
|
||||
|
||||
$('#module-' + type + ' select:last').trigger('change');
|
||||
|
||||
module_row++;
|
||||
}
|
||||
|
||||
$('#module-column-left, #module-column-right, #module-content-top, #module-content-bottom').on('change', 'select[name*=\'code\']', function () {
|
||||
var part = this.value.split('.');
|
||||
|
||||
if (typeof part[2] == 'undefined') {
|
||||
$(this).parent().find('a').attr('href', 'index.php?route=extension/' + part[0] + '/module/' + part[1] + '&user_token={{ user_token }}');
|
||||
} else {
|
||||
$(this).parent().find('a').attr('href', 'index.php?route=extension/' + part[0] + '/module/' + part[1] + '&user_token={{ user_token }}&module_id=' + part[2]);
|
||||
}
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
32
admininistrator/view/template/design/layout_list.twig
Normal file
32
admininistrator/view/template/design/layout_list.twig
Normal file
@ -0,0 +1,32 @@
|
||||
<form id="form-layout" method="post" data-oc-toggle="ajax" data-oc-load="{{ action }}" data-oc-target="#layout">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-center" style="width: 1px;"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', $(this).prop('checked'));" class="form-check-input"/></td>
|
||||
<td class="text-start"><a href="{{ sort_name }}"{% if sort == 'name' %} class="{{ order|lower }}"{% endif %}>{{ column_name }}</a></td>
|
||||
<td class="text-end">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if layouts %}
|
||||
{% for layout in layouts %}
|
||||
<tr>
|
||||
<td class="text-center"><input type="checkbox" name="selected[]" value="{{ layout.layout_id }}" class="form-check-input"/></td>
|
||||
<td class="text-start">{{ layout.name }}</td>
|
||||
<td class="text-end"><a href="{{ layout.edit }}" data-bs-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa-solid fa-pencil"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="3">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
||||
</form>
|
110
admininistrator/view/template/design/seo_url.twig
Normal file
110
admininistrator/view/template/design/seo_url.twig
Normal file
@ -0,0 +1,110 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end">
|
||||
<button type="button" data-bs-toggle="tooltip" title="{{ button_filter }}" onclick="$('#filter-seo').toggleClass('d-none');" class="btn btn-light d-md-none d-lg-none"><i class="fa-solid fa-filter"></i></button>
|
||||
<a href="{{ add }}" data-bs-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i class="fa-solid fa-plus"></i></a>
|
||||
<button type="submit" form="form-seo-url" formaction="{{ delete }}" data-bs-toggle="tooltip" title="{{ button_delete }}" onclick="return confirm('{{ text_confirm }}');" class="btn btn-danger"><i class="fa-regular fa-trash-can"></i></button>
|
||||
</div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div id="filter-seo" class="col-lg-3 col-md-12 order-lg-last d-none d-lg-block mb-3">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-filter"></i> {{ text_filter }}</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-3">
|
||||
<label for="input-keyword" class="form-label">{{ entry_keyword }}</label> <input type="text" name="filter_keyword" value="{{ filter_keyword }}" placeholder="{{ entry_keyword }}" id="input-keyword" class="form-control"/>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-key" class="form-label">{{ entry_key }}</label> <input type="text" name="filter_key" value="{{ filter_key }}" placeholder="{{ entry_key }}" id="input-key" class="form-control"/>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-value" class="form-label">{{ entry_value }}</label> <input type="text" name="filter_value" value="{{ filter_value }}" placeholder="{{ entry_value }}" id="input-value" class="form-control"/>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-store" class="form-label">{{ entry_store }}</label> <select name="filter_store_id" id="input-store" class="form-select">
|
||||
<option value=""></option>
|
||||
<option value="0"{% if filter_store_id == '0' %} selected{% endif %}>{{ text_default }}</option>
|
||||
{% for store in stores %}
|
||||
<option value="{{ store.store_id }}"{% if store.store_id == filter_store_id %} selected{% endif %}>{{ store.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-language" class="form-label">{{ entry_language }}</label> <select name="filter_language_id" id="input-language" class="form-select">
|
||||
<option value=""></option>
|
||||
{% for language in languages %}
|
||||
<option value="{{ language.language_id }}"{% if language.language_id == filter_language_id %} selected{% endif %}>{{ language.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<button type="button" id="button-filter" class="btn btn-light"><i class="fa-solid fa-filter"></i> {{ button_filter }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-9 col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-list"></i> {{ text_list }}</div>
|
||||
<div id="seo-url" class="card-body">{{ list }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#seo-url').on('click', 'thead a, .pagination a', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#seo-url').load(this.href);
|
||||
});
|
||||
|
||||
$('#button-filter').on('click', function () {
|
||||
var url = '';
|
||||
|
||||
var filter_keyword = $('#input-keyword').val();
|
||||
|
||||
if (filter_keyword) {
|
||||
url += '&filter_keyword=' + encodeURIComponent(filter_keyword);
|
||||
}
|
||||
|
||||
var filter_key = $('#input-key').val();
|
||||
|
||||
if (filter_key) {
|
||||
url += '&filter_key=' + encodeURIComponent(filter_key);
|
||||
}
|
||||
|
||||
var filter_value = $('#input-value').val();
|
||||
|
||||
if (filter_value) {
|
||||
url += '&filter_value=' + encodeURIComponent(filter_value);
|
||||
}
|
||||
|
||||
var filter_store_id = $('#input-store').val();
|
||||
|
||||
if (filter_store_id) {
|
||||
url += '&filter_store_id=' + filter_store_id;
|
||||
}
|
||||
|
||||
var filter_language_id = $('#input-language').val();
|
||||
|
||||
if (filter_language_id) {
|
||||
url += '&filter_language_id=' + filter_language_id;
|
||||
}
|
||||
|
||||
window.history.pushState({}, null, 'index.php?route=design/seo_url&user_token={{ user_token }}' + url);
|
||||
|
||||
$('#seo-url').load('index.php?route=design/seo_url.list&user_token={{ user_token }}' + url);
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
76
admininistrator/view/template/design/seo_url_form.twig
Normal file
76
admininistrator/view/template/design/seo_url_form.twig
Normal file
@ -0,0 +1,76 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end">
|
||||
<button type="submit" form="form-seo-url" data-bs-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa-solid fa-floppy-disk"></i></button>
|
||||
<a href="{{ back }}" data-bs-toggle="tooltip" title="{{ button_back }}" class="btn btn-light"><i class="fa-solid fa-reply"></i></a></div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-pencil"></i> {{ text_form }}</div>
|
||||
<div class="card-body">
|
||||
<form id="form-seo-url" action="{{ save }}" method="post" data-oc-toggle="ajax">
|
||||
<div class="row mb-3">
|
||||
<label for="input-store" class="col-sm-2 col-form-label">{{ entry_store }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="store_id" id="input-store" class="form-select">
|
||||
{% for store in stores %}
|
||||
<option value="{{ store.store_id }}"{% if store.store_id == store_id %} selected{% endif %}>{{ store.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-language" class="col-sm-2 col-form-label">{{ entry_language }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="language_id" id="input-language" class="form-select">
|
||||
{% for language in languages %}
|
||||
<option value="{{ language.language_id }}"{% if language.language_id == language_id %} selected{% endif %}>{{ language.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-key" class="col-sm-2 col-form-label">{{ entry_key }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="key" value="{{ key }}" placeholder="{{ entry_key }}" id="input-key" class="form-control"/>
|
||||
<div id="error-key" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-value" class="col-sm-2 col-form-label">{{ entry_value }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="value" value="{{ value }}" placeholder="{{ entry_value }}" id="input-value" class="form-control"/>
|
||||
<div id="error-value" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-keyword" class="col-sm-2 col-form-label">{{ entry_keyword }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="keyword" value="{{ keyword }}" placeholder="{{ entry_keyword }}" id="input-keyword" class="form-control"/>
|
||||
<div class="form-text">{{ help_keyword }}</div>
|
||||
<div id="error-keyword" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-sort-order" class="col-sm-2 col-form-label">{{ entry_sort_order }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="sort_order" value="{{ sort_order }}" placeholder="{{ entry_sort_order }}" id="input-sort-order" class="form-control"/>
|
||||
<div class="form-text">{{ help_sort_order }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="seo_url_id" value="{{ seo_url_id }}" id="input-seo-url-id"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ footer }}
|
42
admininistrator/view/template/design/seo_url_list.twig
Normal file
42
admininistrator/view/template/design/seo_url_list.twig
Normal file
@ -0,0 +1,42 @@
|
||||
<form id="form-seo-url" method="post" data-oc-toggle="ajax" data-oc-load="{{ action }}" data-oc-target="#seo-url">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-center" style="width: 1px;"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', $(this).prop('checked'));" class="form-check-input"/></td>
|
||||
<td class="text-start"><a href="{{ sort_keyword }}"{% if sort == 'keyword' %} class="{{ order|lower }}"{% endif %}>{{ column_keyword }}</a></td>
|
||||
<td class="text-start"><a href="{{ sort_key }}"{% if sort == 'key' %} class="{{ order|lower }}"{% endif %}>{{ column_key }}</a></td>
|
||||
<td class="text-start"><a href="{{ sort_value }}"{% if sort == 'value' %} class="{{ order|lower }}"{% endif %}>{{ column_value }}</a></td>
|
||||
<td class="text-start"><a href="{{ sort_sort_order }}"{% if sort == 'sort_order' %} class="{{ order|lower }}"{% endif %}>{{ column_sort_order }}</a></td>
|
||||
<td class="text-start d-none d-lg-table-cell"><a href="{{ sort_store }}"{% if sort == 'store' %} class="{{ order|lower }}"{% endif %}>{{ column_store }}</a></td>
|
||||
<td class="text-center d-none d-lg-table-cell"><a href="{{ sort_language }}"{% if sort == 'language' %} class="{{ order|lower }}"{% endif %}>{{ column_language }}</a></td>
|
||||
<td class="text-end">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if seo_urls %}
|
||||
{% for seo_url in seo_urls %}
|
||||
<tr>
|
||||
<td class="text-center"><input type="checkbox" name="selected[]" value="{{ seo_url.seo_url_id }}" class="form-check-input"/></td>
|
||||
<td class="text-start">{{ seo_url.keyword }}</td>
|
||||
<td class="text-start">{{ seo_url.key }}</td>
|
||||
<td class="text-start">{{ seo_url.value }}</td>
|
||||
<td class="text-start">{{ seo_url.sort_order }}</td>
|
||||
<td class="text-start d-none d-lg-table-cell">{{ seo_url.store }}</td>
|
||||
<td class="text-center d-none d-lg-table-cell"><img src="{{ seo_url.image }}" alt="{{ seo_url.language }}" title="{{ seo_url.language }}"></td>
|
||||
<td class="text-end"><a href="{{ seo_url.edit }}" data-bs-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa-solid fa-pencil"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="7">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
||||
</form>
|
434
admininistrator/view/template/design/theme.twig
Normal file
434
admininistrator/view/template/design/theme.twig
Normal file
@ -0,0 +1,434 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-list"></i> {{ text_edit }}</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-md-3 col-sm-12">
|
||||
<div class="list-group mb-3">
|
||||
<div class="list-group-item">
|
||||
<h4 class="list-group-item-heading">{{ text_store }}</h4>
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
<select name="store_id" id="input-store" class="form-select">
|
||||
<option value="0">{{ text_default }}</option>
|
||||
{% for store in stores %}
|
||||
<option value="{{ store.store_id }}">{{ store.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-group">
|
||||
<div class="list-group-item">
|
||||
<h4 class="list-group-item-heading">{{ text_template }}</h4>
|
||||
</div>
|
||||
<div id="path"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-9 col-md-12">
|
||||
<div class="alert alert-info"><i class="fa-solid fa-info-circle"></i> {{ text_twig }}</div>
|
||||
<div id="recent">
|
||||
<fieldset>
|
||||
<legend>{{ text_history }}</legend>
|
||||
<div id="history"></div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div id="code" style="display: none;">
|
||||
<ul class="nav nav-tabs"></ul>
|
||||
<div class="tab-content"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<link href="view/javascript/codemirror/lib/codemirror.css" rel="stylesheet"/>
|
||||
<link href="view/javascript/codemirror/theme/monokai.css" rel="stylesheet"/>
|
||||
<script type="text/javascript" src="view/javascript/codemirror/lib/codemirror.js"></script>
|
||||
<script type="text/javascript" src="view/javascript/codemirror/mode/xml/xml.js"></script>
|
||||
<script type="text/javascript" src="view/javascript/codemirror/mode/htmlmixed/htmlmixed.js"></script>
|
||||
<script type="text/javascript"><!--
|
||||
$('#input-store').on('change', function (e) {
|
||||
var element = this;
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php?route=design/theme.path&user_token={{ user_token }}&store_id=' + $(element).val(),
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
$(element).prop('disabled', true);
|
||||
},
|
||||
complete: function () {
|
||||
$(element).prop('disabled', false);
|
||||
},
|
||||
success: function (json) {
|
||||
html = '';
|
||||
|
||||
if (json['directory']) {
|
||||
for (i = 0; i < json['directory'].length; i++) {
|
||||
html += '<a href="' + json['directory'][i]['path'] + '" class="list-group-item list-group-item-action directory">' + json['directory'][i]['name'] + ' <i class="fa-solid fa-arrow-right fa-fw float-end"></i></a>';
|
||||
}
|
||||
}
|
||||
|
||||
if (json['file']) {
|
||||
for (i = 0; i < json['file'].length; i++) {
|
||||
html += '<a href="' + json['file'][i]['path'] + '" class="list-group-item list-group-item-action file">' + json['file'][i]['name'] + ' <i class="fa-solid fa-arrow-right fa-fw float-end"></i></a>';
|
||||
}
|
||||
}
|
||||
|
||||
$('#path').html(html);
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#input-store').trigger('change');
|
||||
|
||||
$('#path').on('click', 'a.directory', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var element = this;
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php?route=design/theme.path&user_token={{ user_token }}&store_id=' + $('#input-store').val() + '&path=' + $(element).attr('href'),
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
$(element).find('i').removeClass('fa-arrow-right');
|
||||
$(element).find('i').addClass('fa-circle-notch fa-spin');
|
||||
},
|
||||
complete: function () {
|
||||
$(element).find('i').removeClass('fa-circle-notch fa-spin');
|
||||
$(element).find('i').addClass('fa-arrow-right');
|
||||
},
|
||||
success: function (json) {
|
||||
html = '';
|
||||
|
||||
if (json['directory']) {
|
||||
for (i = 0; i < json['directory'].length; i++) {
|
||||
html += '<a href="' + json['directory'][i]['path'] + '" class="list-group-item list-group-item-action directory">' + json['directory'][i]['name'] + ' <i class="fa-solid fa-arrow-right fa-fw float-end"></i></a>';
|
||||
}
|
||||
}
|
||||
|
||||
if (json['file']) {
|
||||
for (i = 0; i < json['file'].length; i++) {
|
||||
html += '<a href="' + json['file'][i]['path'] + '" class="list-group-item list-group-item-action file">' + json['file'][i]['name'] + ' <i class="fa-solid fa-arrow-right fa-fw float-end"></i></a>';
|
||||
}
|
||||
}
|
||||
|
||||
if (json['extension']) {
|
||||
if (json['extension']['directory']) {
|
||||
for (i = 0; i < json['extension']['directory'].length; i++) {
|
||||
html += '<a href="' + json['extension']['directory'][i]['path'] + '" class="list-group-item list-group-item-action directory">' + json['extension']['directory'][i]['name'] + ' <i class="fa-solid fa-arrow-right fa-fw float-end"></i></a>';
|
||||
}
|
||||
}
|
||||
|
||||
if (json['extension']['file']) {
|
||||
for (i = 0; i < json['extension']['file'].length; i++) {
|
||||
html += '<a href="' + json['extension']['file'][i]['path'] + '" class="list-group-item list-group-item-action file">' + json['extension']['file'][i]['name'] + ' <i class="fa-solid fa-arrow-right fa-fw float-end"></i></a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (json['back']) {
|
||||
html += '<a href="' + json['back']['path'] + '" class="list-group-item list-group-item-action directory">' + json['back']['name'] + ' <i class="fa-solid fa-arrow-left fa-fw float-end"></i></a>';
|
||||
}
|
||||
|
||||
$('#path').html(html);
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var editor = [];
|
||||
|
||||
$('#path').on('click', 'a.file', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var element = this;
|
||||
|
||||
// Check if the file has an extension
|
||||
var pos = $(element).attr('href').lastIndexOf('.');
|
||||
|
||||
if (pos != -1) {
|
||||
var tab_id = $('#input-store').val() + '-' + $(element).attr('href').slice(0, pos).replace(/\//g, '-').replace(/_/g, '-');
|
||||
} else {
|
||||
var tab_id = $('#input-store').val() + '-' + $(element).attr('href').replace(/\//g, '-').replace(/_/g, '-');
|
||||
}
|
||||
|
||||
if (!editor['#tab-' + tab_id]) {
|
||||
editor['#tab-' + tab_id] = $.ajax({
|
||||
url: 'index.php?route=design/theme.template&user_token={{ user_token }}&store_id=' + $('#input-store').val() + '&path=' + $(element).attr('href'),
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
$(element).find('i').removeClass('fa-arrow-right');
|
||||
$(element).find('i').addClass('fa-circle-notch fa-spin');
|
||||
},
|
||||
complete: function () {
|
||||
$(element).find('i').removeClass('fa-circle-notch fa-spin');
|
||||
$(element).find('i').addClass('fa-arrow-right');
|
||||
},
|
||||
success: function (json) {
|
||||
if (json['code']) {
|
||||
$('#code').show();
|
||||
$('#recent').hide();
|
||||
|
||||
$('.nav-tabs').append('<li class="nav-item"><a href="#tab-' + tab_id + '" data-bs-toggle="tab" class="nav-link">' + $(element).attr('href').split('/').join(' / ') + ' <i class="fa-solid fa-minus-circle"></i></a></li>');
|
||||
|
||||
html = '<div class="tab-pane" id="tab-' + tab_id + '">';
|
||||
html += ' <textarea name="code" id="input-code" rows="10" class="form-control"></textarea>';
|
||||
html += ' <input type="hidden" name="store_id" value="' + $('#input-store').val() + '" id="input-' + tab_id + '-store"/>';
|
||||
html += ' <input type="hidden" name="path" value="' + $(element).attr('href') + '" id="input-' + tab_id + '-path"/>';
|
||||
html += ' <br/>';
|
||||
html += ' <div class="float-end">';
|
||||
html += ' <button type="button" class="btn btn-primary"><i class="fa-solid fa-floppy-disk"></i> {{ button_save|escape('js') }}</button>';
|
||||
html += ' <button class="btn btn-danger"><i class="fa-solid fa-recycle"></i> {{ button_reset|escape('js') }}</button>';
|
||||
html += ' </div>';
|
||||
html += '</div>';
|
||||
|
||||
$('.tab-content').append(html);
|
||||
|
||||
$('.nav-tabs a[href=\'#tab-' + tab_id + '\']').tab('show');
|
||||
|
||||
// Initialize codemirrror
|
||||
var codemirror = CodeMirror.fromTextArea(document.querySelector('.tab-content .active textarea'), {
|
||||
mode: 'text/html',
|
||||
lineNumbers: true,
|
||||
lineWrapping: true,
|
||||
autofocus: true,
|
||||
theme: 'monokai'
|
||||
});
|
||||
|
||||
codemirror.setValue(json['code']);
|
||||
codemirror.setSize('100%', '500px');
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$('.nav-tabs a[href=\'#tab-' + tab_id + '\']').tab('show');
|
||||
}
|
||||
});
|
||||
|
||||
$('#code .nav-tabs').on('click', 'i.fas.fa-minus-circle', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
// 1. Remove tab functionality
|
||||
$(this).parent().removeAttr('data-bs-toggle');
|
||||
|
||||
var remove = $(this).parent().attr('href');
|
||||
|
||||
// 2. Remove entry in the editor array
|
||||
if (editor[remove]) {
|
||||
delete editor[remove];
|
||||
}
|
||||
|
||||
// 3. Remove the tab
|
||||
$(this).parent().parent().remove();
|
||||
|
||||
// 4. Remove the tab panel
|
||||
$(remove).remove();
|
||||
|
||||
if ($(this).parent().hasClass('active')) {
|
||||
$('.nav-tabs li:last-child a').tab('show');
|
||||
}
|
||||
|
||||
if (!$('#code > ul > li').length) {
|
||||
$('#code').hide();
|
||||
$('#recent').show();
|
||||
}
|
||||
});
|
||||
|
||||
$('.tab-content').on('click', '.btn-primary', function (e) {
|
||||
var element = this;
|
||||
|
||||
var editor = $('.tab-content .active .CodeMirror')[0].CodeMirror;
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php?route=design/theme.save&user_token={{ user_token }}&store_id=' + $('.tab-content .active input[name=\'store_id\']').val() + '&path=' + $('.tab-content .active input[name=\'path\']').val(),
|
||||
type: 'post',
|
||||
data: 'code=' + encodeURIComponent(editor.getValue()),
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
$(element).button('loading');
|
||||
},
|
||||
complete: function () {
|
||||
$(element).button('reset');
|
||||
},
|
||||
success: function (json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#alert').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
|
||||
$('#history').load('index.php?route=design/theme.history&user_token={{ user_token }}');
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.tab-content').on('click', '.btn-danger', function (e) {
|
||||
if (confirm('{{ text_confirm }}')) {
|
||||
var element = this;
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php?route=design/theme.reset&user_token={{ user_token }}&store_id=' + $('.tab-content .active #input-store').val() + '&path=' + $('.tab-content .active input[name=\'path\']').val(),
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
$(element).button('loading');
|
||||
},
|
||||
complete: function () {
|
||||
$(element).button('reset');
|
||||
},
|
||||
success: function (json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#alert').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
var codemirror = $('.tab-content .active .CodeMirror')[0].CodeMirror;
|
||||
|
||||
codemirror.setValue(json['code']);
|
||||
codemirror.setSize('100%', '500px');
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#history').on('click', '.pagination a', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#history').load(this.href);
|
||||
});
|
||||
|
||||
$('#history').load('index.php?route=design/theme.history&user_token={{ user_token }}');
|
||||
|
||||
$('#history').on('click', '.btn-primary', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var element = this;
|
||||
|
||||
// Check if the file has an extension
|
||||
var tab_id = $(element).parent().parent().find('input[name=\'store_id\']').val() + '-' + $(element).parent().parent().find('input[name=\'path\']').val().replace(/\//g, '-').replace(/_/g, '-');
|
||||
|
||||
if (!editor['#tab-' + tab_id]) {
|
||||
$.ajax({
|
||||
url: 'index.php?route=design/theme.template&user_token={{ user_token }}&store_id=' + $(element).parent().parent().find('input[name=\'store_id\']').val() + '&path=' + $(element).parent().parent().find('input[name=\'path\']').val(),
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
$(element).button('loading');
|
||||
},
|
||||
complete: function () {
|
||||
$(element).button('reset');
|
||||
},
|
||||
success: function (json) {
|
||||
if (json['code']) {
|
||||
$('#code').show();
|
||||
$('#recent').hide();
|
||||
|
||||
$('.nav-tabs').append('<li class="nav-item"><a href="#tab-' + tab_id + '" data-bs-toggle="tab" class="nav-link">' + $(element).parent().parent().find('input[name=\'path\']').val().split('/').join(' / ') + ' <i class="fa-solid fa-minus-circle"></i></a></li>');
|
||||
|
||||
html = '<div class="tab-pane" id="tab-' + tab_id + '">';
|
||||
html += ' <textarea name="code" rows="10"></textarea>';
|
||||
html += ' <input type="hidden" name="store_id" value="' + $(element).parent().parent().find('input[name=\'store_id\']').val() + '" />';
|
||||
html += ' <input type="hidden" name="path" value="' + $(element).parent().parent().find('input[name=\'path\']').val() + '.twig" />';
|
||||
html += ' <br/>';
|
||||
html += ' <div class="float-end">';
|
||||
html += ' <button type="button" class="btn btn-primary"><i class="fa-solid fa-floppy-disk"></i> {{ button_save|escape('js') }}</button>';
|
||||
html += ' <button class="btn btn-danger"><i class="fa-solid fa-recycle"></i> {{ button_reset|escape('js') }}</button>';
|
||||
html += ' </div>';
|
||||
html += '</div>';
|
||||
|
||||
$('.tab-content').append(html);
|
||||
|
||||
$('.nav-tabs a[href=\'#tab-' + tab_id + '\']').tab('show');
|
||||
|
||||
// Initialize codemirrror
|
||||
var codemirror = CodeMirror.fromTextArea(document.querySelector('.tab-content .active textarea'), {
|
||||
mode: 'text/html',
|
||||
lineNumbers: true,
|
||||
lineWrapping: true,
|
||||
autofocus: true,
|
||||
theme: 'monokai'
|
||||
});
|
||||
|
||||
codemirror.setValue(json['code']);
|
||||
codemirror.setSize('100%', '500px');
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$('.nav-tabs a[href=\'#tab-' + tab_id + '\']').tab('show');
|
||||
}
|
||||
});
|
||||
|
||||
$('#history').on('click', '.btn-danger', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
if (confirm('{{ text_confirm }}')) {
|
||||
var element = this;
|
||||
|
||||
$.ajax({
|
||||
url: $(element).attr('href'),
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
$(element).button('loading');
|
||||
},
|
||||
complete: function () {
|
||||
$(element).button('reset');
|
||||
},
|
||||
success: function (json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#history').before('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#history').before('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
|
||||
$('#history').load('index.php?route=design/theme.history&user_token={{ user_token }}');
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
34
admininistrator/view/template/design/theme_history.twig
Normal file
34
admininistrator/view/template/design/theme_history.twig
Normal file
@ -0,0 +1,34 @@
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-start">{{ column_store }}</td>
|
||||
<td class="text-start">{{ column_route }}</td>
|
||||
<td class="text-start">{{ column_date_added }}</td>
|
||||
<td class="text-end">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if histories %}
|
||||
{% for history in histories %}
|
||||
<tr>
|
||||
<td class="text-start">{{ history.store }}
|
||||
<input type="hidden" name="store_id" value="{{ history.store_id }}"/></td>
|
||||
<td class="text-start">{{ history.route }}
|
||||
<input type="hidden" name="path" value="{{ history.route }}"/></td>
|
||||
<td class="text-start">{{ history.date_added }}</td>
|
||||
<td class="text-end text-nowrap"><a href="{{ history.edit }}" data-bs-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa-solid fa-pencil"></i></a> <a href="{{ history.delete }}" data-bs-toggle="tooltip" title="{{ button_delete }}" class="btn btn-danger"><i class="fa-regular fa-trash-can"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="4">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
30
admininistrator/view/template/design/translation.twig
Normal file
30
admininistrator/view/template/design/translation.twig
Normal file
@ -0,0 +1,30 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end"><a href="{{ add }}" data-bs-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i class="fa-solid fa-plus"></i></a>
|
||||
<button type="submit" form="form-translation" formaction="{{ delete }}" data-bs-toggle="tooltip" title="{{ button_delete }}" onclick="return confirm('{{ text_confirm }}');" class="btn btn-danger"><i class="fa-regular fa-trash-can"></i></button>
|
||||
</div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-list"></i> {{ text_list }}</div>
|
||||
<div id="translation" class="card-body">{{ list }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#translation').on('click', 'thead a, .pagination a', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#translation').load(this.href);
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
165
admininistrator/view/template/design/translation_form.twig
Normal file
165
admininistrator/view/template/design/translation_form.twig
Normal file
@ -0,0 +1,165 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end">
|
||||
<button type="submit" form="form-translation" data-bs-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa-solid fa-floppy-disk"></i></button>
|
||||
<a href="{{ back }}" data-bs-toggle="tooltip" title="{{ button_back }}" class="btn btn-light"><i class="fa-solid fa-reply"></i></a></div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-pencil"></i> {{ text_form }}</div>
|
||||
<div class="card-body">
|
||||
<form id="form-translation" action="{{ save }}" method="post" data-oc-toggle="ajax">
|
||||
<div class="row mb-3">
|
||||
<label for="input-store" class="col-sm-2 col-form-label">{{ entry_store }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="store_id" id="input-store" class="form-select">
|
||||
<option value="0">{{ text_default }}</option>
|
||||
{% for store in stores %}
|
||||
<option value="{{ store.store_id }}"{% if store.store_id == store_id %} selected{% endif %}>{{ store.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-language" class="col-sm-2 col-form-label">{{ entry_language }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="language_id" id="input-language" class="form-select">
|
||||
{% for language in languages %}
|
||||
<option value="{{ language.language_id }}"{% if language.language_id == language_id %} selected{% endif %}>{{ language.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-route" class="col-sm-2 col-form-label">{{ entry_route }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="route" id="input-route" class="form-select"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-key" class="col-sm-2 col-form-label">{{ entry_key }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select id="input-keys" class="form-select"></select>
|
||||
<input type="text" name="key" value="{{ key }}" placeholder="{{ entry_key }}" id="input-key" class="form-control"/>
|
||||
<div id="error-key" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-default" class="col-sm-2 col-form-label">{{ entry_default }}</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea name="default" rows="5" placeholder="{{ entry_default }}" id="input-default" class="form-control" disabled="disabled">{% if default %}{{ default }}{% endif %}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-value" class="col-sm-2 col-form-label">{{ entry_value }}</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea name="value" rows="5" placeholder="{{ entry_value }}" id="input-value" class="form-control">{{ value }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="translation_id" value="{{ translation_id }}" id="input-translation-id"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#input-language').on('change', function () {
|
||||
$.ajax({
|
||||
url: 'index.php?route=design/translation.path&user_token={{ user_token }}&language_id=' + $('#input-language').val(),
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
$('#input-language').prop('disabled', true);
|
||||
$('#input-route').prop('disabled', true);
|
||||
$('#input-key').prop('disabled', true);
|
||||
},
|
||||
complete: function () {
|
||||
$('#input-language').prop('disabled', false);
|
||||
$('#input-route').prop('disabled', false);
|
||||
$('#input-key').prop('disabled', false);
|
||||
},
|
||||
success: function (json) {
|
||||
html = '';
|
||||
|
||||
if (json) {
|
||||
for (i = 0; i < json.length; i++) {
|
||||
if (json[i] == '{{ route }}') {
|
||||
html += '<option value="' + json[i] + '" selected>' + json[i] + '</option>';
|
||||
} else {
|
||||
html += '<option value="' + json[i] + '">' + json[i] + '</option>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$('#input-route').html(html);
|
||||
|
||||
$('#input-route').trigger('change');
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#input-route').on('change', function () {
|
||||
$.ajax({
|
||||
url: 'index.php?route=design/translation.translation&user_token={{ user_token }}&language_id=' + $('#input-language').val() + '&path=' + $('#input-route').val(),
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
$('#input-language').prop('disabled', true);
|
||||
$('#input-route').prop('disabled', true);
|
||||
$('#input-key').prop('disabled', true);
|
||||
},
|
||||
complete: function () {
|
||||
$('#input-language').prop('disabled', false);
|
||||
$('#input-route').prop('disabled', false);
|
||||
$('#input-key').prop('disabled', false);
|
||||
},
|
||||
success: function (json) {
|
||||
translation = [];
|
||||
|
||||
html = '<option value=""></option>';
|
||||
|
||||
if (json) {
|
||||
for (i = 0; i < json.length; i++) {
|
||||
if (json[i]['key'] == $('#input-key').val()) {
|
||||
html += '<option value="' + json[i]['key'] + '" selected>' + json[i]['key'] + '</option>';
|
||||
} else {
|
||||
html += '<option value="' + json[i]['key'] + '">' + json[i]['key'] + '</option>';
|
||||
}
|
||||
|
||||
translation[json[i]['key']] = json[i]['value'];
|
||||
}
|
||||
}
|
||||
|
||||
$('#input-keys').html(html);
|
||||
|
||||
$('#input-keys').trigger('change');
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#input-keys').on('change', function () {
|
||||
if (translation[$('#input-keys').val()]) {
|
||||
$('#input-default').val(translation[$('#input-keys').val()]);
|
||||
|
||||
$('#input-key').val($('#input-keys').val());
|
||||
} else {
|
||||
$('#input-default').val('');
|
||||
}
|
||||
});
|
||||
|
||||
$('#input-language').trigger('change');
|
||||
//--></script>
|
||||
{{ footer }}
|
40
admininistrator/view/template/design/translation_list.twig
Normal file
40
admininistrator/view/template/design/translation_list.twig
Normal file
@ -0,0 +1,40 @@
|
||||
<form id="form-translation" method="post" data-oc-toggle="ajax" data-oc-load="{{ action }}" data-oc-target="#translation">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-center" style="width: 1px;"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', $(this).prop('checked'));" class="form-check-input"/></td>
|
||||
<td class="text-start"><a href="{{ sort_store }}"{% if sort == 'store' %} class="{{ order|lower }}"{% endif %}>{{ column_store }}</a></td>
|
||||
<td class="text-center"><a href="{{ sort_language }}"{% if sort == 'language' %} class="{{ order|lower }}"{% endif %}>{{ column_language }}</a></td>
|
||||
<td class="text-start"><a href="{{ sort_route }}"{% if sort == 'route' %} class="{{ order|lower }}"{% endif %}>{{ column_route }}</a></td>
|
||||
<td class="text-start"><a href="{{ sort_key }}"{% if sort == 'key' %} class="{{ order|lower }}"{% endif %}>{{ column_key }}</a></td>
|
||||
<td class="text-start"><a href="{{ sort_value }}"{% if sort == 'value' %} class="{{ order|lower }}"{% endif %}>{{ column_value }}</a></td>
|
||||
<td class="text-end">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if translations %}
|
||||
{% for translation in translations %}
|
||||
<tr>
|
||||
<td class="text-center"><input type="checkbox" name="selected[]" value="{{ translation.translation_id }}" class="form-check-input"/></td>
|
||||
<td class="text-start">{{ translation.store }}</td>
|
||||
<td class="text-center"><img src="{{ translation.image }}" alt="{{ translation.language }}" title="{{ translation.language }}"></td>
|
||||
<td class="text-start">{{ translation.route }}</td>
|
||||
<td class="text-start">{{ translation.key }}</td>
|
||||
<td class="text-start">{{ translation.value }}</td>
|
||||
<td class="text-end"><a href="{{ translation.edit }}" data-bs-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa-solid fa-pencil"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="7">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
||||
</form>
|
Reference in New Issue
Block a user