first commit
This commit is contained in:
@@ -0,0 +1,134 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="pull-right">
|
||||
<button type="submit" form="form-banner" data-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa fa-save"></i></button>
|
||||
<a href="{{ cancel }}" data-toggle="tooltip" title="{{ button_cancel }}" class="btn btn-default"><i class="fa fa-reply"></i></a></div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ul class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
{% if error_warning %}
|
||||
<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-pencil"></i> {{ text_form }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-banner" class="form-horizontal">
|
||||
<div class="form-group required">
|
||||
<label class="col-sm-2 control-label" for="input-name">{{ entry_name }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="name" value="{{ name }}" placeholder="{{ entry_name }}" id="input-name" class="form-control" />
|
||||
{% if error_name %}
|
||||
<div class="text-danger">{{ error_name }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-status">{{ entry_status }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="status" id="input-status" class="form-control">
|
||||
{% if status %}
|
||||
<option value="1" selected="selected">{{ text_enabled }}</option>
|
||||
<option value="0">{{ text_disabled }}</option>
|
||||
{% else %}
|
||||
<option value="1">{{ text_enabled }}</option>
|
||||
<option value="0" selected="selected">{{ text_disabled }}</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<ul class="nav nav-tabs" id="language">
|
||||
{% for language in languages %}
|
||||
<li><a href="#language{{ language.language_id }}" data-toggle="tab"><img src="language/{{ language.code }}/{{ language.code }}.png" title="{{ language.name }}" /> {{ language.name }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
{% set image_row = 0 %}
|
||||
{% for language in languages %}
|
||||
<div class="tab-pane" id="language{{ language.language_id }}">
|
||||
<table id="images{{ language.language_id }}" class="table table-striped table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-left">{{ entry_title }}</td>
|
||||
<td class="text-left">{{ entry_link }}</td>
|
||||
<td class="text-left">{{ entry_description }}</td>
|
||||
<td class="text-left">{{ entry_button_text }}</td>
|
||||
<td class="text-center">{{ entry_image }}</td>
|
||||
<td class="text-center">{{ entry_image_mobile }}</td>
|
||||
<td class="text-right">{{ 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-left" style="width: 15%;"><input type="text" name="banner_image[{{ language.language_id }}][{{ image_row }}][title]" value="{{ banner_image.title }}" placeholder="{{ entry_title }}" class="form-control" />
|
||||
{% if error_banner_image[language.language_id][image_row] %}
|
||||
<div class="text-danger">{{ error_banner_image[language.language_id][image_row] }}</div>
|
||||
{% endif %}</td>
|
||||
<td class="text-left" style="width: 15%;"><input type="text" name="banner_image[{{ language.language_id }}][{{ image_row }}][link]" value="{{ banner_image.link }}" placeholder="{{ entry_link }}" class="form-control" /></td>
|
||||
<td class="text-left"><textarea name="banner_image[{{ language.language_id }}][{{ image_row }}][description]" rows="2" placeholder="{{ entry_description }}" class="form-control">{{ banner_image.description }}</textarea></td>
|
||||
<td class="text-left" style="width: 10%;"><input type="text" name="banner_image[{{ language.language_id }}][{{ image_row }}][button_text]" value="{{ banner_image.button_text }}" placeholder="{{ entry_button_text }}" class="form-control" /></td>
|
||||
<td class="text-center"><a href="" id="thumb-image{{ image_row }}" data-toggle="image" class="img-thumbnail"><img src="{{ banner_image.thumb }}" alt="" title="" data-placeholder="{{ placeholder }}" /></a>
|
||||
<input type="hidden" name="banner_image[{{ language.language_id }}][{{ image_row }}][image]" value="{{ banner_image.image }}" id="input-image{{ image_row }}" /></td>
|
||||
<td class="text-center"><a href="" id="thumb-mobile{{ image_row }}" data-toggle="image" class="img-thumbnail"><img src="{{ banner_image.mobile_thumb }}" alt="" title="" data-placeholder="{{ placeholder }}" /></a>
|
||||
<input type="hidden" name="banner_image[{{ language.language_id }}][{{ image_row }}][image_mobile]" value="{{ banner_image.image_mobile }}" id="input-image-mobile{{ image_row }}" /></td>
|
||||
<td class="text-right" style="width: 8%;"><input type="text" name="banner_image[{{ language.language_id }}][{{ image_row }}][sort_order]" value="{{ banner_image.sort_order }}" placeholder="{{ entry_sort_order }}" class="form-control" /></td>
|
||||
<td class="text-left"><button type="button" onclick="$('#image-row{{ image_row }}, .tooltip').remove();" data-toggle="tooltip" title="{{ button_remove }}" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>
|
||||
</tr>
|
||||
{% set image_row = image_row + 1 %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="7"></td>
|
||||
<td class="text-left"><button type="button" onclick="addImage('{{ language.language_id }}');" data-toggle="tooltip" title="{{ button_banner_add }}" class="btn btn-primary"><i class="fa fa-plus-circle"></i></button></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
var image_row = {{ image_row }};
|
||||
|
||||
function addImage(language_id) {
|
||||
html = '<tr id="image-row' + image_row + '">';
|
||||
html += ' <td class="text-left" style="width: 15%;"><input type="text" name="banner_image[' + language_id + '][' + image_row + '][title]" value="" placeholder="{{ entry_title }}" class="form-control" /></td>';
|
||||
html += ' <td class="text-left" style="width: 15%;"><input type="text" name="banner_image[' + language_id + '][' + image_row + '][link]" value="" placeholder="{{ entry_link }}" class="form-control" /></td>';
|
||||
html += ' <td class="text-left"><textarea name="banner_image[' + language_id + '][' + image_row + '][description]" rows="2" placeholder="{{ entry_description }}" class="form-control"></textarea></td>';
|
||||
html += ' <td class="text-left" style="width: 10%;"><input type="text" name="banner_image[' + language_id + '][' + image_row + '][button_text]" value="" placeholder="{{ entry_button_text }}" class="form-control" /></td>';
|
||||
html += ' <td class="text-center"><a href="" id="thumb-image' + image_row + '" data-toggle="image" class="img-thumbnail"><img src="{{ placeholder }}" alt="" title="" data-placeholder="{{ placeholder }}" /></a><input type="hidden" name="banner_image[' + language_id + '][' + image_row + '][image]" value="" id="input-image' + image_row + '" /></td>';
|
||||
html += ' <td class="text-center"><a href="" id="thumb-mobile' + image_row + '" data-toggle="image" class="img-thumbnail"><img src="{{ placeholder }}" alt="" title="" data-placeholder="{{ placeholder }}" /></a><input type="hidden" name="banner_image[' + language_id + '][' + image_row + '][image_mobile]" value="" id="input-image-mobile' + image_row + '" /></td>';
|
||||
html += ' <td class="text-right" style="width: 8%;"><input type="text" name="banner_image[' + language_id + '][' + image_row + '][sort_order]" value="" placeholder="{{ entry_sort_order }}" class="form-control" /></td>';
|
||||
html += ' <td class="text-left"><button type="button" onclick="$(\'#image-row' + image_row + ', .tooltip\').remove();" data-toggle="tooltip" title="{{ button_remove }}" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>';
|
||||
html += '</tr>';
|
||||
|
||||
$('#images' + language_id + ' tbody').append(html);
|
||||
|
||||
image_row++;
|
||||
}
|
||||
//--></script>
|
||||
<script type="text/javascript"><!--
|
||||
$('#language a:first').tab('show');
|
||||
//--></script>
|
||||
</div>
|
||||
{{ footer }}
|
||||
@@ -0,0 +1,82 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="pull-right"><a href="{{ add }}" data-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i class="fa fa-plus"></i></a>
|
||||
<button type="button" data-toggle="tooltip" title="{{ button_delete }}" class="btn btn-danger" onclick="confirm('{{ text_confirm }}') ? $('#form-banner').submit() : false;"><i class="fa fa-trash-o"></i></button>
|
||||
</div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ul class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
{% if error_warning %}
|
||||
<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if success %}
|
||||
<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> {{ success }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-list"></i> {{ text_list }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form action="{{ delete }}" method="post" enctype="multipart/form-data" id="form-banner">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width: 1px;" class="text-center"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', this.checked);" /></td>
|
||||
<td class="text-left">{% if sort == 'name' %}
|
||||
<a href="{{ sort_name }}" class="{{ order|lower }}">{{ column_name }}</a>
|
||||
{% else %}
|
||||
<a href="{{ sort_name }}">{{ column_name }}</a>
|
||||
{% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'status' %}
|
||||
<a href="{{ sort_status }}" class="{{ order|lower }}">{{ column_status }}</a>
|
||||
{% else %}
|
||||
<a href="{{ sort_status }}">{{ column_status }}</a>
|
||||
{% endif %}</td>
|
||||
<td class="text-right">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if banners %}
|
||||
{% for banner in banners %}
|
||||
<tr>
|
||||
<td class="text-center">{% if banner.banner_id in selected %}
|
||||
<input type="checkbox" name="selected[]" value="{{ banner.banner_id }}" checked="checked" />
|
||||
{% else %}
|
||||
<input type="checkbox" name="selected[]" value="{{ banner.banner_id }}" />
|
||||
{% endif %}</td>
|
||||
<td class="text-left">{{ banner.name }}</td>
|
||||
<td class="text-left">{{ banner.status }}</td>
|
||||
<td class="text-right"><a href="{{ banner.edit }}" data-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa fa-pencil"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="4">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-left">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-right">{{ results }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ footer }}
|
||||
@@ -0,0 +1,440 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="pull-right">
|
||||
<button type="submit" form="form-layout" data-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa fa-save"></i></button>
|
||||
<a href="{{ cancel }}" data-toggle="tooltip" title="{{ button_cancel }}" class="btn btn-default"><i class="fa fa-reply"></i></a></div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ul class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
{% if error_warning %}
|
||||
<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-pencil"></i> {{ text_form }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-layout" class="form-horizontal">
|
||||
<fieldset>
|
||||
<legend>{{ text_route }}</legend>
|
||||
<div class="form-group required">
|
||||
<label class="col-sm-2 control-label" for="input-name">{{ entry_name }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="name" value="{{ name }}" placeholder="{{ entry_name }}" id="input-name" class="form-control" />
|
||||
{% if error_name %}
|
||||
<div class="text-danger">{{ error_name }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<table id="route" class="table table-striped table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-left">{{ entry_store }}</td>
|
||||
<td class="text-left">{{ 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-left"><select name="layout_route[{{ route_row }}][store_id]" class="form-control">
|
||||
<option value="0">{{ text_default }}</option>
|
||||
{% for store in stores %}
|
||||
{% if store.store_id == layout_route.store_id %}
|
||||
<option value="{{ store.store_id }}" selected="selected">{{ store.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ store.store_id }}">{{ store.name }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select></td>
|
||||
<td class="text-left"><input type="text" name="layout_route[{{ route_row }}][route]" value="{{ layout_route.route }}" placeholder="{{ entry_route }}" class="form-control" /></td>
|
||||
<td class="text-left"><button type="button" onclick="$('#route-row{{ route_row }}').remove();" data-toggle="tooltip" title="{{ button_remove }}" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>
|
||||
</tr>
|
||||
{% set route_row = route_row + 1 %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2"></td>
|
||||
<td class="text-left"><button type="button" onclick="addRoute();" data-toggle="tooltip" title="{{ button_route_add }}" class="btn btn-primary"><i class="fa 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-striped 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-left"><div class="input-group">
|
||||
<select name="layout_module[{{ module_row }}][code]" class="form-control input-sm">
|
||||
{% for extension in extensions %}
|
||||
<optgroup label="{{ extension.name }}">
|
||||
{% if not extension.module %}
|
||||
{% if extension.code == layout_module.code %}
|
||||
<option value="{{ extension.code }}" selected="selected">{{ extension.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ extension.code }}">{{ extension.name }}</option>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% for module in extension.module %}
|
||||
{% if module.code == layout_module.code %}
|
||||
<option value="{{ module.code }}" selected="selected">{{ module.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ module.code }}">{{ module.name }}</option>
|
||||
{% endif %}
|
||||
{% 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 }}" />
|
||||
<div class="input-group-btn"><a href="{{ layout_module.edit }}" type="button" data-toggle="tooltip" title="{{ button_edit }}" target="_blank" class="btn btn-primary btn-sm"><i class="fa fa-pencil"></i></a>
|
||||
<button type="button" onclick="$('#module-row{{ module_row }}').remove();" data-toggle="tooltip" title="{{ button_remove }}" class="btn btn-danger btn-sm"><i class="fa fa fa-minus-circle"></i></button>
|
||||
</div>
|
||||
</div></td>
|
||||
</tr>
|
||||
{% set module_row = module_row + 1 %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td class="text-left"><div class="input-group">
|
||||
<select class="form-control input-sm">
|
||||
<option value=""></option>
|
||||
{% for extension in extensions %}
|
||||
<optgroup label="{{ extension.name }}">
|
||||
{% if not extension.module %}
|
||||
<option value="{{ extension.code }}">{{ extension.name }}</option>
|
||||
{% else %}
|
||||
{% for module in extension.module %}
|
||||
<option value="{{ module.code }}">{{ module.name }}</option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</optgroup>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div class="input-group-btn">
|
||||
<button type="button" onclick="addModule('column-left');" data-toggle="tooltip" title="{{ button_module_add }}" class="btn btn-primary btn-sm"><i class="fa fa-plus-circle"></i></button>
|
||||
</div>
|
||||
</div></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-4 col-sm-12">
|
||||
<table id="module-content-top" class="table table-striped 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-left"><div class="input-group">
|
||||
<select name="layout_module[{{ module_row }}][code]" class="form-control input-sm">
|
||||
{% for extension in extensions %}
|
||||
<optgroup label="{{ extension.name }}">
|
||||
{% if not extension.module %}
|
||||
{% if extension.code == layout_module.code %}
|
||||
<option value="{{ extension.code }}" selected="selected">{{ extension.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ extension.code }}">{{ extension.name }}</option>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% for module in extension.module %}
|
||||
{% if module.code == layout_module.code %}
|
||||
<option value="{{ module.code }}" selected="selected">{{ module.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ module.code }}">{{ module.name }}</option>
|
||||
{% endif %}
|
||||
{% 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 }}" />
|
||||
<div class="input-group-btn"> <a href="{{ layout_module.edit }}" type="button" data-toggle="tooltip" title="{{ button_edit }}" target="_blank" class="btn btn-primary btn-sm"><i class="fa fa-pencil"></i></a>
|
||||
<button type="button" onclick="$('#module-row{{ module_row }}').remove();" data-toggle="tooltip" title="{{ button_remove }}" class="btn btn-danger btn-sm"><i class="fa fa fa-minus-circle"></i></button>
|
||||
</div>
|
||||
</div></td>
|
||||
</tr>
|
||||
{% set module_row = module_row + 1 %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td class="text-left"><div class="input-group">
|
||||
<select class="form-control input-sm">
|
||||
<option value=""></option>
|
||||
{% for extension in extensions %}
|
||||
<optgroup label="{{ extension.name }}">
|
||||
{% if not extension.module %}
|
||||
<option value="{{ extension.code }}">{{ extension.name }}</option>
|
||||
{% else %}
|
||||
{% for module in extension.module %}
|
||||
<option value="{{ module.code }}">{{ module.name }}</option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</optgroup>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div class="input-group-btn">
|
||||
<button type="button" onclick="addModule('content-top');" data-toggle="tooltip" title="{{ button_module_add }}" class="btn btn-primary btn-sm"><i class="fa fa-plus-circle"></i></button>
|
||||
</div>
|
||||
</div></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<table id="module-content-bottom" class="table table-striped 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-left"><div class="input-group">
|
||||
<select name="layout_module[{{ module_row }}][code]" class="form-control input-sm">
|
||||
{% for extension in extensions %}
|
||||
<optgroup label="{{ extension.name }}">
|
||||
{% if not extension.module %}
|
||||
{% if extension.code == layout_module.code %}
|
||||
<option value="{{ extension.code }}" selected="selected">{{ extension.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ extension.code }}">{{ extension.name }}</option>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% for module in extension.module %}
|
||||
{% if module.code == layout_module.code %}
|
||||
<option value="{{ module.code }}" selected="selected">{{ module.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ module.code }}">{{ module.name }}</option>
|
||||
{% endif %}
|
||||
{% 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 }}" />
|
||||
<div class="input-group-btn"><a href="{{ layout_module.edit }}" type="button" data-toggle="tooltip" title="{{ button_edit }}" target="_blank" class="btn btn-primary btn-sm"><i class="fa fa-pencil"></i></a>
|
||||
<button type="button" onclick="$('#module-row{{ module_row }}').remove();" data-toggle="tooltip" title="{{ button_remove }}" class="btn btn-danger btn-sm"><i class="fa fa fa-minus-circle"></i></button>
|
||||
</div>
|
||||
</div></td>
|
||||
</tr>
|
||||
{% set module_row = module_row + 1 %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td class="text-left"><div class="input-group">
|
||||
<select class="form-control input-sm">
|
||||
<option value=""></option>
|
||||
{% for extension in extensions %}
|
||||
<optgroup label="{{ extension.name }}">
|
||||
{% if not extension.module %}
|
||||
<option value="{{ extension.code }}">{{ extension.name }}</option>
|
||||
{% else %}
|
||||
{% for module in extension.module %}
|
||||
<option value="{{ module.code }}">{{ module.name }}</option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</optgroup>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div class="input-group-btn">
|
||||
<button type="button" onclick="addModule('content-bottom');" data-toggle="tooltip" title="{{ button_module_add }}" class="btn btn-primary btn-sm"><i class="fa fa-plus-circle"></i></button>
|
||||
</div>
|
||||
</div></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-4 col-sm-12">
|
||||
<table id="module-column-right" class="table table-striped 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-left"><div class="input-group">
|
||||
<select name="layout_module[{{ module_row }}][code]" class="form-control input-sm">
|
||||
{% for extension in extensions %}
|
||||
<optgroup label="{{ extension.name }}">
|
||||
{% if not extension.module %}
|
||||
{% if extension.code == layout_module.code %}
|
||||
<option value="{{ extension.code }}" selected="selected">{{ extension.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ extension.code }}">{{ extension.name }}</option>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% for module in extension.module %}
|
||||
{% if module.code == layout_module.code %}
|
||||
<option value="{{ module.code }}" selected="selected">{{ module.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ module.code }}">{{ module.name }}</option>
|
||||
{% endif %}
|
||||
{% 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 }}" />
|
||||
<div class="input-group-btn"><a href="{{ layout_module.edit }}" data-toggle="tooltip" title="{{ button_edit }}" target="_blank" class="btn btn-primary btn-sm"><i class="fa fa-pencil"></i></a>
|
||||
<button type="button" onclick="$('#module-row{{ module_row }}').remove();" data-toggle="tooltip" title="{{ button_remove }}" class="btn btn-danger btn-sm"><i class="fa fa fa-minus-circle"></i></button>
|
||||
</div>
|
||||
</div></td>
|
||||
</tr>
|
||||
{% set module_row = module_row + 1 %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td class="text-left"><div class="input-group">
|
||||
<select class="form-control input-sm">
|
||||
<option value=""></option>
|
||||
{% for extension in extensions %}
|
||||
<optgroup label="{{ extension.name }}">
|
||||
{% if not extension.module %}
|
||||
<option value="{{ extension.code }}">{{ extension.name }}</option>
|
||||
{% else %}
|
||||
{% for module in extension.module %}
|
||||
<option value="{{ module.code }}">{{ module.name }}</option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</optgroup>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div class="input-group-btn">
|
||||
<button type="button" onclick="addModule('column-right');" data-toggle="tooltip" title="{{ button_module_add }}" class="btn btn-primary btn-sm"><i class="fa fa-plus-circle"></i></button>
|
||||
</div>
|
||||
</div></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
// Reorderable drag-and-drop lists
|
||||
$('.row table tbody .input-group-btn').prepend('<span data-toggle="tooltip" title="{{ text_move }}" class="btn btn-success btn-sm handle"><i class="fa fa-hand-grab-o"></i></span>');
|
||||
$('.row table tbody').sortable({
|
||||
handle: '.handle',
|
||||
chosenClass: 'handle-active',
|
||||
onEnd: function (evt) {
|
||||
var orderIndex = 1;
|
||||
$($(evt.item).parent().find('input[name*="sort_order"]')).each(function() {
|
||||
$(this).val(orderIndex);
|
||||
orderIndex++;
|
||||
});
|
||||
}
|
||||
});
|
||||
var route_row = {{ route_row }};
|
||||
|
||||
function addRoute() {
|
||||
html = '<tr id="route-row' + route_row + '">';
|
||||
html += ' <td class="text-left"><select name="layout_route[' + route_row + '][store_id]" class="form-control">';
|
||||
html += ' <option value="0">{{ text_default }}</option>';
|
||||
{% for store in stores %}
|
||||
html += '<option value="{{ store.store_id }}">{{ store.name|escape('js') }}</option>';
|
||||
{% endfor %}
|
||||
html += ' </select></td>';
|
||||
html += ' <td class="text-left"><input type="text" name="layout_route[' + route_row + '][route]" value="" placeholder="{{ entry_route }}" class="form-control" /></td>';
|
||||
html += ' <td class="text-left"><button type="button" onclick="$(\'#route-row' + route_row + '\').remove();" data-toggle="tooltip" title="{{ button_remove }}" class="btn btn-danger"><i class="fa 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-left"><div class="input-group"><select name="layout_module[' + module_row + '][code]" class="form-control input-sm">';
|
||||
{% for extension in extensions %}
|
||||
html += ' <optgroup label="{{ extension.name|escape('js') }}">';
|
||||
{% if not extension.module %}
|
||||
html += ' <option value="{{ extension.code }}">{{ extension.name|escape('js') }}</option>';
|
||||
{% else %}
|
||||
{% for module in extension.module %}
|
||||
html += ' <option value="{{ module.code }}">{{ module.name|escape('js') }}</option>';
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
html += ' </optgroup>';
|
||||
{% endfor %}
|
||||
html += ' </select>';
|
||||
html += ' <input type="hidden" name="layout_module[' + module_row + '][position]" value="' + type.replace('-', '_') + '" />';
|
||||
html += ' <input type="hidden" name="layout_module[' + module_row + '][sort_order]" value="" />';
|
||||
html += ' <div class="input-group-btn"><span data-toggle="tooltip" title="<?php echo $text_move; ?>" class="btn btn-success btn-sm handle"><i class="fa fa-hand-grab-o"></i></span><a href="" target="_blank" type="button" data-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary btn-sm"><i class="fa fa-pencil"></i></a><button type="button" onclick="$(\'#module-row' + module_row + '\').remove();" data-toggle="tooltip" title="{{ button_remove }}" class="btn btn-danger btn-sm"><i class="fa fa fa-minus-circle"></i></button></div></div></td>';
|
||||
html += '</tr>';
|
||||
|
||||
$('#module-' + type + ' tbody').append(html);
|
||||
|
||||
$('#module-' + type + ' tbody select[name=\'layout_module[' + module_row + '][code]\']').val($('#module-' + type + ' tfoot select').val());
|
||||
|
||||
$('#module-' + type + ' select[name*=\'code\']').trigger('change');
|
||||
|
||||
$('#module-' + type + ' tbody input[name*=\'sort_order\']').each(function(i, element) {
|
||||
$(element).val(i);
|
||||
});
|
||||
|
||||
module_row++;
|
||||
}
|
||||
|
||||
$('#module-column-left, #module-column-right, #module-content-top, #module-content-bottom').delegate('select[name*=\'code\']', 'change', function() {
|
||||
var part = this.value.split('.');
|
||||
|
||||
if (!part[1]) {
|
||||
$(this).parent().find('a').attr('href', 'index.php?route=extension/module/' + part[0] + '&user_token={{ user_token }}');
|
||||
} else {
|
||||
$(this).parent().find('a').attr('href', 'index.php?route=extension/module/' + part[0] + '&user_token={{ user_token }}&module_id=' + part[1]);
|
||||
}
|
||||
});
|
||||
|
||||
$('#module-column-left, #module-column-right, #module-content-top, #module-content-bottom').trigger('change');
|
||||
//--></script>
|
||||
</div>
|
||||
{{ footer }}
|
||||
@@ -0,0 +1,76 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="pull-right"><a href="{{ add }}" data-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i class="fa fa-plus"></i></a>
|
||||
<button type="button" data-toggle="tooltip" title="{{ button_delete }}" class="btn btn-danger" onclick="confirm('{{ text_confirm }}') ? $('#form-layout').submit() : false;"><i class="fa fa-trash-o"></i></button>
|
||||
</div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ul class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
{% if error_warning %}
|
||||
<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if success %}
|
||||
<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> {{ success }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-list"></i> {{ text_list }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form action="{{ delete }}" method="post" enctype="multipart/form-data" id="form-layout">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width: 1px;" class="text-center"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', this.checked);" /></td>
|
||||
<td class="text-left">{% if sort == 'name' %}
|
||||
<a href="{{ sort_name }}" class="{{ order|lower }}">{{ column_name }}</a>
|
||||
{% else %}
|
||||
<a href="{{ sort_name }}">{{ column_name }}</a>
|
||||
{% endif %}</td>
|
||||
<td class="text-right">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if layouts %}
|
||||
{% for layout in layouts %}
|
||||
<tr>
|
||||
<td class="text-center">{% if layout.layout_id in selected %}
|
||||
<input type="checkbox" name="selected[]" value="{{ layout.layout_id }}" checked="checked" />
|
||||
{% else %}
|
||||
<input type="checkbox" name="selected[]" value="{{ layout.layout_id }}" />
|
||||
{% endif %}</td>
|
||||
<td class="text-left">{{ layout.name }}</td>
|
||||
<td class="text-right"><a href="{{ layout.edit }}" data-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa fa-pencil"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="3">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-left">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-right">{{ results }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ footer }}
|
||||
@@ -0,0 +1,79 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="pull-right">
|
||||
<button type="submit" form="form-seo-url" data-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa fa-save"></i></button>
|
||||
<a href="{{ cancel }}" data-toggle="tooltip" title="{{ button_cancel }}" class="btn btn-default"><i class="fa fa-reply"></i></a></div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ul class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">{% if error_warning %}
|
||||
<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-pencil"></i> {{ text_form }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-seo-url" class="form-horizontal">
|
||||
<div class="form-group required">
|
||||
<label class="col-sm-2 control-label" for="input-query">{{ entry_query }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="query" value="{{ query }}" placeholder="{{ entry_query }}" id="input-query" class="form-control" />
|
||||
{% if error_query %}
|
||||
<div class="text-danger">{{ error_query }}</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group required">
|
||||
<label class="col-sm-2 control-label" for="input-keyword">{{ entry_keyword }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="keyword" value="{{ keyword }}" placeholder="{{ entry_keyword }}" id="input-keyword" class="form-control" />
|
||||
{% if error_keyword %}
|
||||
<div class="text-danger">{{ error_keyword }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-store">{{ entry_store }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="store_id" id="input-store" class="form-control">
|
||||
{% for store in stores %}
|
||||
{% if store.store_id == store_id %}
|
||||
<option value="{{ store.store_id }}" selected="selected">{{ store.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ store.store_id }}">{{ store.name }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-language">{{ entry_language }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="language_id" id="input-language" class="form-control">
|
||||
{% for language in languages %}
|
||||
{% if language.language_id == language_id %}
|
||||
<option value="{{ language.language_id }}" selected="selected">{{ language.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ language.language_id }}">{{ language.name }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ footer }}
|
||||
@@ -0,0 +1,227 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="pull-right">
|
||||
<button type="button" data-toggle="tooltip" title="{{ button_filter }}" onclick="$('#filter-seo').toggleClass('hidden-sm hidden-xs');" class="btn btn-default hidden-md hidden-lg"><i class="fa fa-filter"></i></button>
|
||||
<a href="{{ add }}" data-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i class="fa fa-plus"></i></a>
|
||||
<button type="button" data-toggle="tooltip" title="{{ button_delete }}" class="btn btn-danger" onclick="confirm('{{ text_confirm }}') ? $('#form-url-alias').submit() : false;"><i class="fa fa-trash-o"></i></button>
|
||||
</div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ul class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">{% if error_warning %}
|
||||
<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if success %}
|
||||
<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> {{ success }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="row">
|
||||
<div id="filter-seo" class="col-md-3 col-md-push-9 col-sm-12 hidden-sm hidden-xs">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-filter"></i> {{ text_filter }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="input-query">{{ entry_query }}</label>
|
||||
<input type="text" name="filter_query" value="{{ filter_query }}" placeholder="{{ entry_query }}" id="input-query" class="form-control" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="input-keyword">{{ entry_keyword }}</label>
|
||||
<input type="text" name="filter_keyword" value="{{ filter_keyword }}" placeholder="{{ entry_keyword }}" id="input-keyword" class="form-control" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="input-store">{{ entry_store }}</label>
|
||||
<select name="filter_store_id" id="input-store" class="form-control">
|
||||
<option value=""></option>
|
||||
{% if filter_store_id == '0' %}
|
||||
<option value="0" selected="selected">{{ text_default }}</option>
|
||||
{% else %}
|
||||
<option value="0">{{ text_default }}</option>
|
||||
{% endif %}
|
||||
{% for store in stores %}
|
||||
{% if store.store_id == filter_store_id %}
|
||||
<option value="{{ store.store_id }}" selected="selected">{{ store.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ store.store_id }}">{{ store.name }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="input-language">{{ entry_language }}</label>
|
||||
<select name="filter_language_id" id="input-language" class="form-control">
|
||||
<option value=""></option>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% for language in languages %}
|
||||
{% if language.language_id == filter_language_id %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<option value="{{ language.language_id }}" selected="selected">{{ language.name }}</option>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% else %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<option value="{{ language.language_id }}">{{ language.name }}</option>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<button type="button" id="button-filter" class="btn btn-default"><i class="fa fa-filter"></i> {{ button_filter }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9 col-md-pull-3 col-sm-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-list"></i> {{ text_list }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form action="{{ delete }}" method="post" enctype="multipart/form-data" id="form-url-alias">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width: 1px;" class="text-center"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', this.checked);" /></td>
|
||||
<td class="text-left">{% if sort == 'query' %}<a href="{{ sort_query }}" class="{{ order|lower }}">{{ column_query }}</a>{% else %}<a href="{{ sort_query }}">{{ column_query }}</a>{% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'keyword' %}<a href="{{ sort_keyword }}" class="{{ order|lower }}">{{ column_keyword }}</a> {% else %}<a href="{{ sort_keyword }}">{{ column_keyword }}</a>{% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'store' %}<a href="{{ sort_store }}" class="{{ order|lower }}">{{ column_store }}</a>{% else %}<a href="{{ sort_store }}">{{ column_store }}</a>{% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'language' %}<a href="{{ sort_language }}" class="{{ order|lower }}">{{ column_language }}</a>{% else %}<a href="{{ sort_language }}">{{ column_language }}</a>{% endif %}</td>
|
||||
<td class="text-right">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{% if seo_urls %}
|
||||
{% for seo_url in seo_urls %}
|
||||
<tr>
|
||||
<td class="text-center">{% if seo_url.seo_url_id in selected %}
|
||||
<input type="checkbox" name="selected[]" value="{{ seo_url.seo_url_id }}" checked="checked" />
|
||||
{% else %}
|
||||
<input type="checkbox" name="selected[]" value="{{ seo_url.seo_url_id }}" />
|
||||
{% endif %}</td>
|
||||
<td class="text-left">{{ seo_url.query }}</td>
|
||||
<td class="text-left">{{ seo_url.keyword }}</td>
|
||||
<td class="text-left">{{ seo_url.store }}</td>
|
||||
<td class="text-left">{{ seo_url.language }}</td>
|
||||
<td class="text-right"><a href="{{ seo_url.edit }}" data-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa fa-pencil"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="6">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-left">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-right">{{ results }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#button-filter').on('click', function() {
|
||||
var url = 'index.php?route=design/seo_url&user_token={{ user_token }}';
|
||||
|
||||
var filter_query = $('input[name=\'filter_query\']').val();
|
||||
|
||||
if (filter_query) {
|
||||
url += '&filter_query=' + encodeURIComponent(filter_query);
|
||||
}
|
||||
|
||||
var filter_keyword = $('input[name=\'filter_keyword\']').val();
|
||||
|
||||
if (filter_keyword) {
|
||||
url += '&filter_keyword=' + encodeURIComponent(filter_keyword);
|
||||
}
|
||||
|
||||
var filter_store_id = $('select[name=\'filter_store_id\']').val();
|
||||
|
||||
if (filter_store_id) {
|
||||
url += '&filter_store_id=' + encodeURIComponent(filter_store_id);
|
||||
}
|
||||
|
||||
var filter_language_id = $('select[name=\'filter_language_id\']').val();
|
||||
|
||||
if (filter_language_id) {
|
||||
url += '&filter_language_id=' + encodeURIComponent(filter_language_id);
|
||||
}
|
||||
|
||||
location = url;
|
||||
});
|
||||
//--></script>
|
||||
</div>
|
||||
{{ footer }}
|
||||
@@ -0,0 +1,412 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ul class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-list"></i> {{ text_edit }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-md-3 col-sm-12">
|
||||
<div class="list-group">
|
||||
<div class="list-group-item">
|
||||
<h4 class="list-group-item-heading">{{ text_store }}</h4>
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
<select name="store_id" class="form-control">
|
||||
<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-9 col-sm-12">
|
||||
<div class="alert alert-info"><i class="fa 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>
|
||||
<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/lib/xml.js"></script>
|
||||
<script type="text/javascript" src="view/javascript/codemirror/lib/formatting.js"></script>
|
||||
<script type="text/javascript"><!--
|
||||
$('select[name="store_id"]').on('change', function(e) {
|
||||
$.ajax({
|
||||
url: 'index.php?route=design/theme/path&user_token={{ user_token }}&store_id=' + $('select[name="store_id"]').val(),
|
||||
dataType: 'json',
|
||||
beforeSend: function() {
|
||||
$('select[name="store_id"]').prop('disabled', true);
|
||||
},
|
||||
complete: function() {
|
||||
$('select[name="store_id"]').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 directory">' + json['directory'][i]['name'] + ' <i class="fa fa-arrow-right fa-fw pull-right"></i></a>';
|
||||
}
|
||||
}
|
||||
|
||||
if (json['file']) {
|
||||
for (i = 0; i < json['file'].length; i++) {
|
||||
html += '<a href="' + json['file'][i]['path'] + '" class="list-group-item file">' + json['file'][i]['name'] + ' <i class="fa fa-arrow-right fa-fw pull-right"></i></a>';
|
||||
}
|
||||
}
|
||||
|
||||
$('#path').html(html);
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('select[name="store_id"]').trigger('change');
|
||||
|
||||
$('#path').on('click', 'a.directory', function(e) {
|
||||
console.log($(node).attr('href'));
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
var node = this;
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php?route=design/theme/path&user_token={{ user_token }}&store_id=' + $('select[name="store_id"]').val() + '&path=' + $(node).attr('href'),
|
||||
dataType: 'json',
|
||||
beforeSend: function() {
|
||||
$(node).find('i').removeClass('fa-arrow-right');
|
||||
$(node).find('i').addClass('fa-circle-o-notch fa-spin');
|
||||
},
|
||||
complete: function() {
|
||||
$(node).find('i').removeClass('fa-circle-o-notch fa-spin');
|
||||
$(node).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 directory">' + json['directory'][i]['name'] + ' <i class="fa fa-arrow-right fa-fw pull-right"></i></a>';
|
||||
}
|
||||
}
|
||||
|
||||
if (json['file']) {
|
||||
for (i = 0; i < json['file'].length; i++) {
|
||||
html += '<a href="' + json['file'][i]['path'] + '" class="list-group-item file">' + json['file'][i]['name'] + ' <i class="fa fa-arrow-right fa-fw pull-right"></i></a>';
|
||||
}
|
||||
}
|
||||
|
||||
if (json['back']) {
|
||||
html += '<a href="' + json['back']['path'] + '" class="list-group-item directory">' + json['back']['name'] + ' <i class="fa fa-arrow-left fa-fw pull-right"></i></a>';
|
||||
}
|
||||
|
||||
$('#path').html(html);
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#path').on('click', 'a.file', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var node = this;
|
||||
|
||||
// Check if the file has an extension
|
||||
var pos = $(node).attr('href').lastIndexOf('.');
|
||||
|
||||
if (pos != -1) {
|
||||
var tab_id = $('select[name="store_id"]').val() + '-' + $(node).attr('href').slice(0, pos).replace(/\//g, '-').replace(/_/g, '-');
|
||||
} else {
|
||||
var tab_id = $('select[name="store_id"]').val() + '-' + $(node).attr('href').replace(/\//g, '-').replace(/_/g, '-');
|
||||
}
|
||||
|
||||
if (!$('#tab-' + tab_id).length) {
|
||||
$.ajax({
|
||||
url: 'index.php?route=design/theme/template&user_token={{ user_token }}&store_id=' + $('select[name="store_id"]').val() + '&path=' + $(node).attr('href'),
|
||||
dataType: 'json',
|
||||
beforeSend: function() {
|
||||
$(node).find('i').removeClass('fa-arrow-right');
|
||||
$(node).find('i').addClass('fa-circle-o-notch fa-spin');
|
||||
},
|
||||
complete: function() {
|
||||
$(node).find('i').removeClass('fa-circle-o-notch fa-spin');
|
||||
$(node).find('i').addClass('fa-arrow-right');
|
||||
},
|
||||
success: function(json) {
|
||||
if (json['code']) {
|
||||
$('#code').show();
|
||||
$('#recent').hide();
|
||||
|
||||
$('.nav-tabs').append('<li><a href="#tab-' + tab_id + '" data-toggle="tab">' + $(node).attr('href').split('/').join(' / ') + ' <i class="fa 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="' + $('select[name="store_id"]').val() + '" />';
|
||||
html += ' <input type="hidden" name="path" value="' + $(node).attr('href') + '" />';
|
||||
html += ' <br />';
|
||||
html += ' <div class="pull-right">';
|
||||
html += ' <button type="button" data-loading-text="{{ text_loading }}" class="btn btn-primary"><i class="fa fa-floppy-o"></i> {{ button_save }}</button>';
|
||||
html += ' <button data-loading-text="{{ text_loading }}" class="btn btn-danger"><i class="fa fa-recycle"></i> {{ button_reset }}</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',
|
||||
height: '500px',
|
||||
lineNumbers: true,
|
||||
autofocus: true,
|
||||
theme: 'monokai'
|
||||
});
|
||||
|
||||
codemirror.setValue(json['code']);
|
||||
}
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$('.nav-tabs a[href=\'#tab-' + tab_id + '\']').tab('show');
|
||||
}
|
||||
});
|
||||
|
||||
$('.nav-tabs').on('click', 'i.fa-minus-circle', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
if ($(this).parent().parent().is('li.active')) {
|
||||
index = $(this).parent().parent().index();
|
||||
|
||||
if (index == 0) {
|
||||
$(this).parent().parent().parent().find('li').eq(index + 1).find('a').tab('show');
|
||||
} else {
|
||||
$(this).parent().parent().parent().find('li').eq(index - 1).find('a').tab('show');
|
||||
}
|
||||
}
|
||||
|
||||
$(this).parent().parent().remove();
|
||||
|
||||
$($(this).parent().attr('href')).remove();
|
||||
|
||||
if (!$('#code > ul > li').length) {
|
||||
$('#code').hide();
|
||||
$('#recent').show();
|
||||
}
|
||||
});
|
||||
|
||||
$('.tab-content').on('click', '.btn-primary', function(e) {
|
||||
var node = 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() {
|
||||
$(node).button('loading');
|
||||
},
|
||||
complete: function() {
|
||||
$(node).button('reset');
|
||||
},
|
||||
success: function(json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#content > .container-fluid').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + ' <button type="button" class="close" data-dismiss="alert">×</button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#content > .container-fluid').prepend('<div class="alert alert-success alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">×</button></div>');
|
||||
|
||||
$('#history').load('index.php?route=design/theme/history&user_token={{ user_token }}');
|
||||
}
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.tab-content').on('click', '.btn-danger', function(e) {
|
||||
if (confirm('{{ text_confirm }}')) {
|
||||
var node = this;
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php?route=design/theme/reset&user_token={{ user_token }}&store_id=' + $('.tab-content .active input[name="store_id"]').val() + '&path=' + $('.tab-content .active input[name="path"]').val(),
|
||||
dataType: 'json',
|
||||
beforeSend: function() {
|
||||
$(node).button('loading');
|
||||
},
|
||||
complete: function() {
|
||||
$(node).button('reset');
|
||||
},
|
||||
success: function(json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#content > .container-fluid').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + ' <button type="button" class="close" data-dismiss="alert">×</button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#content > .container-fluid').prepend('<div class="alert alert-success alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">×</button></div>');
|
||||
}
|
||||
|
||||
var codemirror = $('.tab-content .active .CodeMirror')[0].CodeMirror;
|
||||
|
||||
codemirror.setValue(json['code']);
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#history').delegate('.pagination a', 'click', 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 node = this;
|
||||
|
||||
// Check if the file has an extension
|
||||
var tab_id = $(node).parent().parent().find('input[name="store_id"]').val() + '-' + $(node).parent().parent().find('input[name="path"]').val().replace(/\//g, '-').replace(/_/g, '-');
|
||||
|
||||
if (!$('#tab-' + tab_id).length) {
|
||||
$.ajax({
|
||||
url: 'index.php?route=design/theme/template&user_token={{ user_token }}&store_id=' + $(node).parent().parent().find('input[name="store_id"]').val() + '&path=' + $(node).parent().parent().find('input[name="path"]').val(),
|
||||
dataType: 'json',
|
||||
beforeSend: function() {
|
||||
$(node).button('loading');
|
||||
},
|
||||
complete: function() {
|
||||
$(node).button('reset');
|
||||
},
|
||||
success: function(json) {
|
||||
if (json['code']) {
|
||||
$('#code').show();
|
||||
$('#recent').hide();
|
||||
|
||||
$('.nav-tabs').append('<li><a href="#tab-' + tab_id + '" data-toggle="tab">' + $(node).parent().parent().find('input[name="path"]').val().split('/').join(' / ') + ' <i class="fa 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="' + $(node).parent().parent().find('input[name="store_id"]').val() + '" />';
|
||||
html += ' <input type="hidden" name="path" value="' + $(node).parent().parent().find('input[name="path"]').val() + '.twig" />';
|
||||
html += ' <br />';
|
||||
html += ' <div class="pull-right">';
|
||||
html += ' <button type="button" data-loading-text="{{ text_loading }}" class="btn btn-primary"><i class="fa fa-floppy-o"></i> {{ button_save }}</button>';
|
||||
html += ' <button data-loading-text="{{ text_loading }}" class="btn btn-danger"><i class="fa fa-recycle"></i> {{ button_reset }}</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',
|
||||
height: '500px',
|
||||
lineNumbers: true,
|
||||
autofocus: true,
|
||||
theme: 'monokai'
|
||||
});
|
||||
|
||||
codemirror.setValue(json['code']);
|
||||
}
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
alert(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 node = this;
|
||||
|
||||
$.ajax({
|
||||
url: $(node).attr('href'),
|
||||
dataType: 'json',
|
||||
beforeSend: function() {
|
||||
$(node).button('loading');
|
||||
},
|
||||
complete: function() {
|
||||
$(node).button('reset');
|
||||
},
|
||||
success: function(json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#history').before('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + ' <button type="button" class="close" data-dismiss="alert">×</button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#history').before('<div class="alert alert-success alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">×</button></div>');
|
||||
|
||||
$('#history').load('index.php?route=design/theme/history&user_token={{ user_token }}');
|
||||
}
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
//--></script>
|
||||
</div>
|
||||
{{ footer }}
|
||||
@@ -0,0 +1,36 @@
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-left">{{ column_store }}</td>
|
||||
<td class="text-left">{{ column_route }}</td>
|
||||
<td class="text-left">{{ column_theme }}</td>
|
||||
<td class="text-left">{{ column_date_added }}</td>
|
||||
<td class="text-right">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if histories %}
|
||||
{% for history in histories %}
|
||||
<tr>
|
||||
<td class="text-left">{{ history.store }}
|
||||
<input type="hidden" name="store_id" value="{{ history.store_id }}" /></td>
|
||||
<td class="text-left">{{ history.route }}
|
||||
<input type="hidden" name="path" value="{{ history.route }}" /></td>
|
||||
<td class="text-left">{{ history.theme }}</td>
|
||||
<td class="text-left">{{ history.date_added }}</td>
|
||||
<td class="text-right"><a href="{{ history.edit }}" data-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa fa-pencil"></i></a> <a href="{{ history.delete }}" data-loading-text="{{ text_loading }}" data-toggle="tooltip" title="{{ button_delete }}" class="btn btn-danger"><i class="fa fa fa-trash-o"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="5">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-left">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-right">{{ results }}</div>
|
||||
</div>
|
||||
@@ -0,0 +1,219 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="pull-right">
|
||||
<button type="submit" form="form-translation" data-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa fa-save"></i></button>
|
||||
<a href="{{ cancel }}" data-toggle="tooltip" title="{{ button_cancel }}" class="btn btn-default"><i class="fa fa-reply"></i></a></div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ul class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
{% if error_warning %}
|
||||
<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-pencil"></i> {{ text_form }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-translation" class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-store">{{ entry_store }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="store_id" id="input-store" class="form-control">
|
||||
<option value="0">{{ text_default }}</option>
|
||||
{% for store in stores %}
|
||||
{% if store.store_id == store_id %}
|
||||
<option value="{{ store.store_id }}" selected="selected">{{ store.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ store.store_id }}">{{ store.name }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-language">{{ entry_language }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="language_id" id="input-language" class="form-control">
|
||||
{% for language in languages %}
|
||||
{% if language.language_id == language_id %}
|
||||
<option value="{{ language.language_id }}" selected="selected">{{ language.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ language.language_id }}">{{ language.name }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-route">{{ entry_route }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="route" id="input-route" class="form-control">
|
||||
{% if route %}
|
||||
<option value="{{ route }}" selected="selected">{{ route }}</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-key">{{ entry_key }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="key" id="input-key" class="form-control">
|
||||
{% if key %}
|
||||
<option value="{{ key }}" selected="selected">{{ key }}</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
<input type="text" name="key" value="{{ key }}" placeholder="{{ entry_key }}" class="form-control" />
|
||||
{% if error_key %}
|
||||
<div class="text-danger">{{ error_key }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-default">{{ entry_default }}</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea name="default" placeholder="{{ entry_default }}" rows="5" id="input-default" class="form-control" disabled="disabled">{% if default %}{{ default }}{% endif %}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-value">{{ 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>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
{% if key %}
|
||||
$('select[name="store_id"]').prop('disabled', true);
|
||||
$('select[name="language_id"]').prop('disabled', true);
|
||||
$('select[name="route"]').prop('disabled', true);
|
||||
$('select[name="key"]').prop('disabled', true);
|
||||
$('input[name="key"]').prop('disabled', true);
|
||||
{% else %}
|
||||
$('select[name="language_id"]').on('change', function() {
|
||||
$.ajax({
|
||||
url: 'index.php?route=design/translation/path&user_token={{ user_token }}&language_id=' + $('select[name="language_id"]').val(),
|
||||
dataType: 'json',
|
||||
beforeSend: function() {
|
||||
$('select[name="route"]').html('');
|
||||
$('select[name="key"]').html('');
|
||||
$('input[name="key"]').val('');
|
||||
$('textarea[name="default"]').val('');
|
||||
$('select[name="store_id"]').prop('disabled', true);
|
||||
$('select[name="language_id"]').prop('disabled', true);
|
||||
$('select[name="route"]').prop('disabled', true);
|
||||
$('select[name="key"]').prop('disabled', true);
|
||||
$('input[name="key"]').prop('disabled', true);
|
||||
$('textarea[name="value"]').prop('disabled', true);
|
||||
},
|
||||
complete: function() {
|
||||
$('select[name="store_id"]').prop('disabled', false);
|
||||
$('select[name="language_id"]').prop('disabled', false);
|
||||
$('select[name="route"]').prop('disabled', false);
|
||||
},
|
||||
success: function(json) {
|
||||
html = '<option value=""></option>';
|
||||
|
||||
if (json) {
|
||||
for (i = 0; i < json.length; i++) {
|
||||
if (i == 0) {
|
||||
html += '<option value="' + json[i] + '" selected="selected">' + json[i] + '</option>';
|
||||
} else {
|
||||
html += '<option value="' + json[i] + '">' + json[i] + '</option>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$('select[name="route"]').html(html);
|
||||
|
||||
$('select[name="route"]').trigger('change');
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var translation = [];
|
||||
|
||||
$('select[name="route"]').on('change', function() {
|
||||
$.ajax({
|
||||
url: 'index.php?route=design/translation/translation&user_token={{ user_token }}&language_id=' + $('select[name="language_id"]').val() + '&path=' + $('select[name="route"]').val(),
|
||||
dataType: 'json',
|
||||
{% if not key %}
|
||||
beforeSend: function() {
|
||||
$('select[name="key"]').html('');
|
||||
$('input[name="key"]').val('');
|
||||
$('textarea[name="default"]').val('');
|
||||
$('textarea[name="value"]').val('');
|
||||
$('select[name="store_id"]').prop('disabled', true);
|
||||
$('select[name="language_id"]').prop('disabled', true);
|
||||
$('select[name="route"]').prop('disabled', true);
|
||||
$('select[name="key"]').prop('disabled', true);
|
||||
$('textarea[name="value"]').prop('disabled', true);
|
||||
},
|
||||
complete: function() {
|
||||
$('select[name="store_id"]').prop('disabled', false);
|
||||
$('select[name="language_id"]').prop('disabled', false);
|
||||
$('select[name="route"]').prop('disabled', false);
|
||||
$('select[name="key"]').prop('disabled', false);
|
||||
$('textarea[name="value"]').prop('disabled', false);
|
||||
},
|
||||
{% endif %}
|
||||
success: function(json) {
|
||||
translation = [];
|
||||
|
||||
html = '<option value=""></option>';
|
||||
|
||||
if (json) {
|
||||
for (i = 0; i < json.length; i++) {
|
||||
translation[json[i]['key']] = json[i]['value'];
|
||||
|
||||
if (i == 0) {
|
||||
html += '<option value="' + json[i]['key'] + '" selected="selected">' + json[i]['key'] + '</option>';
|
||||
} else {
|
||||
html += '<option value="' + json[i]['key'] + '">' + json[i]['key'] + '</option>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$('select[name="key"]').html(html);
|
||||
|
||||
$('select[name="key"]').trigger('change');
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('select[name="language_id"]').trigger('change');
|
||||
|
||||
$('select[name="key"]').on('change', function() {
|
||||
if ($(this).val()) {
|
||||
$('textarea[name="default"]').val(translation[$('select[name="key"]').val()]);
|
||||
$('input[name="key"]').val($('select[name="key"]').val());
|
||||
|
||||
$('input[name="key"]').prop('disabled', true);
|
||||
} else {
|
||||
$('textarea[name="default"]').val('');
|
||||
|
||||
$('input[name="key"]').prop('disabled', false);
|
||||
}
|
||||
});
|
||||
{% endif %}
|
||||
//--></script>
|
||||
</div>
|
||||
{{ footer }}
|
||||
@@ -0,0 +1,79 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="pull-right"><a href="{{ add }}" data-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i class="fa fa-plus"></i></a>
|
||||
<button type="button" data-toggle="tooltip" title="{{ button_delete }}" class="btn btn-danger" onclick="confirm('{{ text_confirm }}') ? $('#form-translation').submit() : false;"><i class="fa fa-trash-o"></i></button>
|
||||
</div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ul class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">{% if error_warning %}
|
||||
<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if success %}
|
||||
<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> {{ success }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-list"></i> {{ text_list }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form action="{{ delete }}" method="post" enctype="multipart/form-data" id="form-translation">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width: 1px;" class="text-center"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', this.checked);" /></td>
|
||||
<td class="text-left">{% if sort == 'store' %}<a href="{{ sort_store }}" class="{{ order|lower }}">{{ column_store }}</a> {% else %}<a href="{{ sort_store }}">{{ column_store }}</a>{% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'language' %}<a href="{{ sort_language }}" class="{{ order|lower }}">{{ column_language }}</a>{% else %}<a href="{{ sort_language }}">{{ column_language }}</a>{% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'route' %}<a href="{{ sort_route }}" class="{{ order|lower }}">{{ column_route }}</a> {% else %}<a href="{{ sort_route }}">{{ column_route }}</a>{% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'key' %}<a href="{{ sort_key }}" class="{{ order|lower }}">{{ column_key }}</a>{% else %}<a href="{{ sort_key }}">{{ column_key }}</a>{% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'value' %}<a href="{{ sort_value }}" class="{{ order|lower }}">{{ column_value }}</a>{% else %}<a href="{{ sort_value }}">{{ column_value }}</a>{% endif %}</td>
|
||||
<td class="text-right">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if translations %}
|
||||
{% for translation in translations %}
|
||||
<tr>
|
||||
<td class="text-center">{% if translation.translation_id in selected %}
|
||||
<input type="checkbox" name="selected[]" value="{{ translation.translation_id }}" checked="checked" />
|
||||
{% else %}
|
||||
<input type="checkbox" name="selected[]" value="{{ translation.translation_id }}" />
|
||||
{% endif %}</td>
|
||||
<td class="text-left">{{ translation.store }}</td>
|
||||
<td class="text-left">{{ translation.language }}</td>
|
||||
<td class="text-left">{{ translation.route }}</td>
|
||||
<td class="text-left">{{ translation.key }}</td>
|
||||
<td class="text-left">{{ translation.value }}</td>
|
||||
<td class="text-right"><a href="{{ translation.edit }}" data-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa fa-pencil"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="7">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-left">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-right">{{ results }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ footer }}
|
||||
Reference in New Issue
Block a user