Merge branch 'master' of https://github.com/thelia/thelia
Conflicts: .gitignore
This commit is contained in:
@@ -18,11 +18,13 @@
|
||||
{* -- Bootstrap CSS section --------------------------------------------- *}
|
||||
|
||||
{block name="before-bootstrap-css"}{/block}
|
||||
|
||||
|
||||
{stylesheets file='assets/less/*' filters='less,cssembed'}
|
||||
<link rel="stylesheet" href="{$asset_url}">
|
||||
{/stylesheets}
|
||||
|
||||
{debugbar_renderHead}
|
||||
|
||||
{block name="after-bootstrap-css"}{/block}
|
||||
|
||||
{* -- Admin CSS section ------------------------------------------------- *}
|
||||
@@ -47,15 +49,15 @@
|
||||
|
||||
<div class="topbar">
|
||||
<div class="container">
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="version-info">{intl l='Version %ver' ver="{$THELIA_VERSION}"}</div>
|
||||
</div>
|
||||
|
||||
{module_include location='inside_topbar'}
|
||||
|
||||
<div class="col-md-6 clearfix">
|
||||
{module_include location='inside_topbar'}
|
||||
|
||||
<div class="col-md-6 clearfix">
|
||||
|
||||
<div class="btn-group pull-right">
|
||||
<a href="{navigate to="index"}" title="{intl l='View site'}" target="_blank" class="btn btn-default"><span class="glyphicon glyphicon-eye-open"></span> {intl l="View shop"}</a>
|
||||
@@ -64,14 +66,14 @@
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a class="profile" href="{url path='admin/edit_profile'}"><span class="glyphicon glyphicon-edit"></span> {intl l="Profil"}</a></li>
|
||||
<li><a class="profile" href="{url path='admin/edit_profile'}"><span class="glyphicon glyphicon-edit"></span> {intl l="Profil"}</a></li>
|
||||
<li><a class="logout" href="{url path='admin/logout'}" title="{intl l='Close administation session'}"><span class="glyphicon glyphicon-off"></span> {intl l="Logout"}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -82,7 +84,7 @@
|
||||
{module_include location='before_top_menu'}
|
||||
|
||||
<nav class="navbar navbar-default" role="navigation">
|
||||
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="navbar-header">
|
||||
@@ -91,7 +93,7 @@
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="collapse navbar-collapse navbar-collapse">
|
||||
@@ -163,13 +165,13 @@
|
||||
|
||||
{/loop}
|
||||
</ul>
|
||||
|
||||
|
||||
{loop name="top-bar-search" type="auth" roles="ADMIN" permissions="admin.search"}
|
||||
<form class="navbar-form pull-right" action="{url path='/admin/search'}">
|
||||
<form class="navbar-form pull-right" action="{url path='/admin/search'}">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" id="search_term" name="search_term" placeholder="{intl l='Search'}">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search"></span></button>
|
||||
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search"></span></button>
|
||||
</form>
|
||||
{/loop}
|
||||
|
||||
@@ -221,15 +223,15 @@
|
||||
|
||||
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
|
||||
|
||||
{block name="after-javascript-include"}{/block}
|
||||
|
||||
{javascripts file='assets/js/bootstrap/bootstrap.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
{block name="after-javascript-include"}{/block}
|
||||
|
||||
{block name="javascript-initialization"}{/block}
|
||||
|
||||
{debugbar_render}
|
||||
{* Modules scripts are included now *}
|
||||
{module_include location='footer_js'}
|
||||
|
||||
{javascripts file='assets/js/bootstrap/bootstrap.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
</body>
|
||||
</html>
|
||||
474
templates/admin/default/assets/bootstrap-datepicker/js/bootstrap-datepicker.js
vendored
Executable file
474
templates/admin/default/assets/bootstrap-datepicker/js/bootstrap-datepicker.js
vendored
Executable file
@@ -0,0 +1,474 @@
|
||||
/* =========================================================
|
||||
* bootstrap-datepicker.js
|
||||
* http://www.eyecon.ro/bootstrap-datepicker
|
||||
* =========================================================
|
||||
* Copyright 2012 Stefan Petre
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ========================================================= */
|
||||
|
||||
!function( $ ) {
|
||||
|
||||
// Picker object
|
||||
|
||||
var Datepicker = function(element, options){
|
||||
this.element = $(element);
|
||||
this.format = DPGlobal.parseFormat(options.format||this.element.data('date-format')||'mm/dd/yyyy');
|
||||
this.picker = $(DPGlobal.template)
|
||||
.appendTo('body')
|
||||
.on({
|
||||
click: $.proxy(this.click, this)//,
|
||||
//mousedown: $.proxy(this.mousedown, this)
|
||||
});
|
||||
this.isInput = this.element.is('input');
|
||||
this.component = this.element.is('.date') ? this.element.find('.add-on') : false;
|
||||
|
||||
if (this.isInput) {
|
||||
this.element.on({
|
||||
focus: $.proxy(this.show, this),
|
||||
//blur: $.proxy(this.hide, this),
|
||||
keyup: $.proxy(this.update, this)
|
||||
});
|
||||
} else {
|
||||
if (this.component){
|
||||
this.component.on('click', $.proxy(this.show, this));
|
||||
} else {
|
||||
this.element.on('click', $.proxy(this.show, this));
|
||||
}
|
||||
}
|
||||
|
||||
this.minViewMode = options.minViewMode||this.element.data('date-minviewmode')||0;
|
||||
if (typeof this.minViewMode === 'string') {
|
||||
switch (this.minViewMode) {
|
||||
case 'months':
|
||||
this.minViewMode = 1;
|
||||
break;
|
||||
case 'years':
|
||||
this.minViewMode = 2;
|
||||
break;
|
||||
default:
|
||||
this.minViewMode = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.viewMode = options.viewMode||this.element.data('date-viewmode')||0;
|
||||
if (typeof this.viewMode === 'string') {
|
||||
switch (this.viewMode) {
|
||||
case 'months':
|
||||
this.viewMode = 1;
|
||||
break;
|
||||
case 'years':
|
||||
this.viewMode = 2;
|
||||
break;
|
||||
default:
|
||||
this.viewMode = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.startViewMode = this.viewMode;
|
||||
this.weekStart = options.weekStart||this.element.data('date-weekstart')||0;
|
||||
this.weekEnd = this.weekStart === 0 ? 6 : this.weekStart - 1;
|
||||
this.onRender = options.onRender;
|
||||
this.fillDow();
|
||||
this.fillMonths();
|
||||
this.update();
|
||||
this.showMode();
|
||||
};
|
||||
|
||||
Datepicker.prototype = {
|
||||
constructor: Datepicker,
|
||||
|
||||
show: function(e) {
|
||||
this.picker.show();
|
||||
this.height = this.component ? this.component.outerHeight() : this.element.outerHeight();
|
||||
this.place();
|
||||
$(window).on('resize', $.proxy(this.place, this));
|
||||
if (e ) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
}
|
||||
if (!this.isInput) {
|
||||
}
|
||||
var that = this;
|
||||
$(document).on('mousedown', function(ev){
|
||||
if ($(ev.target).closest('.datepicker').length == 0) {
|
||||
that.hide();
|
||||
}
|
||||
});
|
||||
this.element.trigger({
|
||||
type: 'show',
|
||||
date: this.date
|
||||
});
|
||||
},
|
||||
|
||||
hide: function(){
|
||||
this.picker.hide();
|
||||
$(window).off('resize', this.place);
|
||||
this.viewMode = this.startViewMode;
|
||||
this.showMode();
|
||||
if (!this.isInput) {
|
||||
$(document).off('mousedown', this.hide);
|
||||
}
|
||||
//this.set();
|
||||
this.element.trigger({
|
||||
type: 'hide',
|
||||
date: this.date
|
||||
});
|
||||
},
|
||||
|
||||
set: function() {
|
||||
var formated = DPGlobal.formatDate(this.date, this.format);
|
||||
if (!this.isInput) {
|
||||
if (this.component){
|
||||
this.element.find('input').prop('value', formated);
|
||||
}
|
||||
this.element.data('date', formated);
|
||||
} else {
|
||||
this.element.prop('value', formated);
|
||||
}
|
||||
},
|
||||
|
||||
setValue: function(newDate) {
|
||||
if (typeof newDate === 'string') {
|
||||
this.date = DPGlobal.parseDate(newDate, this.format);
|
||||
} else {
|
||||
this.date = new Date(newDate);
|
||||
}
|
||||
this.set();
|
||||
this.viewDate = new Date(this.date.getFullYear(), this.date.getMonth(), 1, 0, 0, 0, 0);
|
||||
this.fill();
|
||||
},
|
||||
|
||||
place: function(){
|
||||
var offset = this.component ? this.component.offset() : this.element.offset();
|
||||
this.picker.css({
|
||||
top: offset.top + this.height,
|
||||
left: offset.left
|
||||
});
|
||||
},
|
||||
|
||||
update: function(newDate){
|
||||
this.date = DPGlobal.parseDate(
|
||||
typeof newDate === 'string' ? newDate : (this.isInput ? this.element.prop('value') : this.element.data('date')),
|
||||
this.format
|
||||
);
|
||||
this.viewDate = new Date(this.date.getFullYear(), this.date.getMonth(), 1, 0, 0, 0, 0);
|
||||
this.fill();
|
||||
},
|
||||
|
||||
fillDow: function(){
|
||||
var dowCnt = this.weekStart;
|
||||
var html = '<tr>';
|
||||
while (dowCnt < this.weekStart + 7) {
|
||||
html += '<th class="dow">'+DPGlobal.dates.daysMin[(dowCnt++)%7]+'</th>';
|
||||
}
|
||||
html += '</tr>';
|
||||
this.picker.find('.datepicker-days thead').append(html);
|
||||
},
|
||||
|
||||
fillMonths: function(){
|
||||
var html = '';
|
||||
var i = 0
|
||||
while (i < 12) {
|
||||
html += '<span class="month">'+DPGlobal.dates.monthsShort[i++]+'</span>';
|
||||
}
|
||||
this.picker.find('.datepicker-months td').append(html);
|
||||
},
|
||||
|
||||
fill: function() {
|
||||
var d = new Date(this.viewDate),
|
||||
year = d.getFullYear(),
|
||||
month = d.getMonth(),
|
||||
currentDate = this.date.valueOf();
|
||||
this.picker.find('.datepicker-days th:eq(1)')
|
||||
.text(DPGlobal.dates.months[month]+' '+year);
|
||||
var prevMonth = new Date(year, month-1, 28,0,0,0,0),
|
||||
day = DPGlobal.getDaysInMonth(prevMonth.getFullYear(), prevMonth.getMonth());
|
||||
prevMonth.setDate(day);
|
||||
prevMonth.setDate(day - (prevMonth.getDay() - this.weekStart + 7)%7);
|
||||
var nextMonth = new Date(prevMonth);
|
||||
nextMonth.setDate(nextMonth.getDate() + 42);
|
||||
nextMonth = nextMonth.valueOf();
|
||||
var html = [];
|
||||
var clsName,
|
||||
prevY,
|
||||
prevM;
|
||||
while(prevMonth.valueOf() < nextMonth) {
|
||||
if (prevMonth.getDay() === this.weekStart) {
|
||||
html.push('<tr>');
|
||||
}
|
||||
clsName = this.onRender(prevMonth);
|
||||
prevY = prevMonth.getFullYear();
|
||||
prevM = prevMonth.getMonth();
|
||||
if ((prevM < month && prevY === year) || prevY < year) {
|
||||
clsName += ' old';
|
||||
} else if ((prevM > month && prevY === year) || prevY > year) {
|
||||
clsName += ' new';
|
||||
}
|
||||
if (prevMonth.valueOf() === currentDate) {
|
||||
clsName += ' active';
|
||||
}
|
||||
html.push('<td class="day '+clsName+'">'+prevMonth.getDate() + '</td>');
|
||||
if (prevMonth.getDay() === this.weekEnd) {
|
||||
html.push('</tr>');
|
||||
}
|
||||
prevMonth.setDate(prevMonth.getDate()+1);
|
||||
}
|
||||
this.picker.find('.datepicker-days tbody').empty().append(html.join(''));
|
||||
var currentYear = this.date.getFullYear();
|
||||
|
||||
var months = this.picker.find('.datepicker-months')
|
||||
.find('th:eq(1)')
|
||||
.text(year)
|
||||
.end()
|
||||
.find('span').removeClass('active');
|
||||
if (currentYear === year) {
|
||||
months.eq(this.date.getMonth()).addClass('active');
|
||||
}
|
||||
|
||||
html = '';
|
||||
year = parseInt(year/10, 10) * 10;
|
||||
var yearCont = this.picker.find('.datepicker-years')
|
||||
.find('th:eq(1)')
|
||||
.text(year + '-' + (year + 9))
|
||||
.end()
|
||||
.find('td');
|
||||
year -= 1;
|
||||
for (var i = -1; i < 11; i++) {
|
||||
html += '<span class="year'+(i === -1 || i === 10 ? ' old' : '')+(currentYear === year ? ' active' : '')+'">'+year+'</span>';
|
||||
year += 1;
|
||||
}
|
||||
yearCont.html(html);
|
||||
},
|
||||
|
||||
click: function(e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
var target = $(e.target).closest('span, td, th');
|
||||
if (target.length === 1) {
|
||||
switch(target[0].nodeName.toLowerCase()) {
|
||||
case 'th':
|
||||
switch(target[0].className) {
|
||||
case 'switch':
|
||||
this.showMode(1);
|
||||
break;
|
||||
case 'prev':
|
||||
case 'next':
|
||||
this.viewDate['set'+DPGlobal.modes[this.viewMode].navFnc].call(
|
||||
this.viewDate,
|
||||
this.viewDate['get'+DPGlobal.modes[this.viewMode].navFnc].call(this.viewDate) +
|
||||
DPGlobal.modes[this.viewMode].navStep * (target[0].className === 'prev' ? -1 : 1)
|
||||
);
|
||||
this.fill();
|
||||
this.set();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'span':
|
||||
if (target.is('.month')) {
|
||||
var month = target.parent().find('span').index(target);
|
||||
this.viewDate.setMonth(month);
|
||||
} else {
|
||||
var year = parseInt(target.text(), 10)||0;
|
||||
this.viewDate.setFullYear(year);
|
||||
}
|
||||
if (this.viewMode !== 0) {
|
||||
this.date = new Date(this.viewDate);
|
||||
this.element.trigger({
|
||||
type: 'changeDate',
|
||||
date: this.date,
|
||||
viewMode: DPGlobal.modes[this.viewMode].clsName
|
||||
});
|
||||
}
|
||||
this.showMode(-1);
|
||||
this.fill();
|
||||
this.set();
|
||||
break;
|
||||
case 'td':
|
||||
if (target.is('.day') && !target.is('.disabled')){
|
||||
var day = parseInt(target.text(), 10)||1;
|
||||
var month = this.viewDate.getMonth();
|
||||
if (target.is('.old')) {
|
||||
month -= 1;
|
||||
} else if (target.is('.new')) {
|
||||
month += 1;
|
||||
}
|
||||
var year = this.viewDate.getFullYear();
|
||||
this.date = new Date(year, month, day,0,0,0,0);
|
||||
this.viewDate = new Date(year, month, Math.min(28, day),0,0,0,0);
|
||||
this.fill();
|
||||
this.set();
|
||||
this.element.trigger({
|
||||
type: 'changeDate',
|
||||
date: this.date,
|
||||
viewMode: DPGlobal.modes[this.viewMode].clsName
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
mousedown: function(e){
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
},
|
||||
|
||||
showMode: function(dir) {
|
||||
if (dir) {
|
||||
this.viewMode = Math.max(this.minViewMode, Math.min(2, this.viewMode + dir));
|
||||
}
|
||||
this.picker.find('>div').hide().filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName).show();
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.datepicker = function ( option, val ) {
|
||||
return this.each(function () {
|
||||
var $this = $(this),
|
||||
data = $this.data('datepicker'),
|
||||
options = typeof option === 'object' && option;
|
||||
if (!data) {
|
||||
$this.data('datepicker', (data = new Datepicker(this, $.extend({}, $.fn.datepicker.defaults,options))));
|
||||
}
|
||||
if (typeof option === 'string') data[option](val);
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.datepicker.defaults = {
|
||||
onRender: function(date) {
|
||||
return '';
|
||||
}
|
||||
};
|
||||
$.fn.datepicker.Constructor = Datepicker;
|
||||
|
||||
var DPGlobal = {
|
||||
modes: [
|
||||
{
|
||||
clsName: 'days',
|
||||
navFnc: 'Month',
|
||||
navStep: 1
|
||||
},
|
||||
{
|
||||
clsName: 'months',
|
||||
navFnc: 'FullYear',
|
||||
navStep: 1
|
||||
},
|
||||
{
|
||||
clsName: 'years',
|
||||
navFnc: 'FullYear',
|
||||
navStep: 10
|
||||
}],
|
||||
dates:{
|
||||
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
|
||||
daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
|
||||
daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
|
||||
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
|
||||
monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
|
||||
},
|
||||
isLeapYear: function (year) {
|
||||
return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0))
|
||||
},
|
||||
getDaysInMonth: function (year, month) {
|
||||
return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]
|
||||
},
|
||||
parseFormat: function(format){
|
||||
var separator = format.match(/[.\/\-\s].*?/),
|
||||
parts = format.split(/\W+/);
|
||||
if (!separator || !parts || parts.length === 0){
|
||||
throw new Error("Invalid date format.");
|
||||
}
|
||||
return {separator: separator, parts: parts};
|
||||
},
|
||||
parseDate: function(date, format) {
|
||||
var parts = date.split(format.separator),
|
||||
date = new Date(),
|
||||
val;
|
||||
date.setHours(0);
|
||||
date.setMinutes(0);
|
||||
date.setSeconds(0);
|
||||
date.setMilliseconds(0);
|
||||
if (parts.length === format.parts.length) {
|
||||
var year = date.getFullYear(), day = date.getDate(), month = date.getMonth();
|
||||
for (var i=0, cnt = format.parts.length; i < cnt; i++) {
|
||||
val = parseInt(parts[i], 10)||1;
|
||||
switch(format.parts[i]) {
|
||||
case 'dd':
|
||||
case 'd':
|
||||
day = val;
|
||||
date.setDate(val);
|
||||
break;
|
||||
case 'mm':
|
||||
case 'm':
|
||||
month = val - 1;
|
||||
date.setMonth(val - 1);
|
||||
break;
|
||||
case 'yy':
|
||||
year = 2000 + val;
|
||||
date.setFullYear(2000 + val);
|
||||
break;
|
||||
case 'yyyy':
|
||||
year = val;
|
||||
date.setFullYear(val);
|
||||
break;
|
||||
}
|
||||
}
|
||||
date = new Date(year, month, day, 0 ,0 ,0);
|
||||
}
|
||||
return date;
|
||||
},
|
||||
formatDate: function(date, format){
|
||||
var val = {
|
||||
d: date.getDate(),
|
||||
m: date.getMonth() + 1,
|
||||
yy: date.getFullYear().toString().substring(2),
|
||||
yyyy: date.getFullYear()
|
||||
};
|
||||
val.dd = (val.d < 10 ? '0' : '') + val.d;
|
||||
val.mm = (val.m < 10 ? '0' : '') + val.m;
|
||||
var date = [];
|
||||
for (var i=0, cnt = format.parts.length; i < cnt; i++) {
|
||||
date.push(val[format.parts[i]]);
|
||||
}
|
||||
return date.join(format.separator);
|
||||
},
|
||||
headTemplate: '<thead>'+
|
||||
'<tr>'+
|
||||
'<th class="prev">‹</th>'+
|
||||
'<th colspan="5" class="switch"></th>'+
|
||||
'<th class="next">›</th>'+
|
||||
'</tr>'+
|
||||
'</thead>',
|
||||
contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>'
|
||||
};
|
||||
DPGlobal.template = '<div class="datepicker dropdown-menu">'+
|
||||
'<div class="datepicker-days">'+
|
||||
'<table class=" table-condensed">'+
|
||||
DPGlobal.headTemplate+
|
||||
'<tbody></tbody>'+
|
||||
'</table>'+
|
||||
'</div>'+
|
||||
'<div class="datepicker-months">'+
|
||||
'<table class="table-condensed">'+
|
||||
DPGlobal.headTemplate+
|
||||
DPGlobal.contTemplate+
|
||||
'</table>'+
|
||||
'</div>'+
|
||||
'<div class="datepicker-years">'+
|
||||
'<table class="table-condensed">'+
|
||||
DPGlobal.headTemplate+
|
||||
DPGlobal.contTemplate+
|
||||
'</table>'+
|
||||
'</div>'+
|
||||
'</div>';
|
||||
|
||||
}( window.jQuery );
|
||||
BIN
templates/admin/default/assets/img/ajax-loader.gif
Normal file
BIN
templates/admin/default/assets/img/ajax-loader.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
157
templates/admin/default/assets/js/main.js
Normal file
157
templates/admin/default/assets/js/main.js
Normal file
@@ -0,0 +1,157 @@
|
||||
(function($, window, document){
|
||||
|
||||
$(function(){
|
||||
|
||||
// -- Init datepicker --
|
||||
if($('.date').length){
|
||||
//$('.date').datepicker();
|
||||
}
|
||||
|
||||
// -- Init tablesorter --
|
||||
/*if($('.tablesorter').length){
|
||||
$('.tablesorter').tablesorter({
|
||||
widgets: ["filter", "stickyHeaders"],
|
||||
widthFixed : false,
|
||||
widgetOptions : {
|
||||
filter_cssFilter : 'input-medium form-control',
|
||||
filter_formatter : {
|
||||
|
||||
2 : function($cell, indx){
|
||||
return $.tablesorter.filterFormatter.uiDateCompare( $cell, indx, {
|
||||
dateFormat: "dd/mm/yy",
|
||||
changeMonth : true,
|
||||
changeYear : true,
|
||||
compare : '='
|
||||
});
|
||||
},
|
||||
|
||||
3 : function($cell, indx){
|
||||
return $.tablesorter.filterFormatter.uiRange( $cell, indx, {
|
||||
value: 1,
|
||||
min: 1,
|
||||
max: 50,
|
||||
delayed: true,
|
||||
valueToHeader: false,
|
||||
exactMatch: false
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}*/
|
||||
|
||||
// -- Effect description
|
||||
if($('[name=effect]').length){
|
||||
var $effectSelect = $('[name=effect]'),
|
||||
$helpBlock = $effectSelect.next('.help-block');
|
||||
|
||||
$effectSelect.change(function(){
|
||||
var description = $(this).find(":selected").data('description');
|
||||
$helpBlock.text(description);
|
||||
});
|
||||
}
|
||||
|
||||
// -- Max usage --
|
||||
if($('#is-unlimited').length){
|
||||
|
||||
if($('#is-unlimited').is(':checked')){
|
||||
$('#max-usage').hide().attr('value', '-1');
|
||||
}
|
||||
|
||||
$('#is-unlimited').change(function(){
|
||||
if($('#is-unlimited').is(':checked')){
|
||||
$('#max-usage').hide().attr('value', '-1');
|
||||
}
|
||||
else{
|
||||
$('#max-usage').show().val('').attr('value', '');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// -- Confirm Box --
|
||||
if($('[data-toggle="confirm"]').length){
|
||||
$('[data-toggle="confirm"]').click(function(e){
|
||||
|
||||
var $link = $(this);
|
||||
var modal = $(this).data('target');
|
||||
|
||||
$(modal).modal('show');
|
||||
|
||||
$(modal).on('shown', function () {
|
||||
$('[data-confirm]').attr('href', $link.attr('href'));
|
||||
});
|
||||
|
||||
if($(modal).is(':hidden')){
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
// -- Mini browser --
|
||||
miniBrowser = function (root, url){
|
||||
|
||||
$.getJSON(url, {
|
||||
root: root
|
||||
})
|
||||
.done(function(data) {
|
||||
var resultat = data;
|
||||
|
||||
var breadcrumb = $('<div />');
|
||||
$(resultat.breadcrumb).each(function(k, v){
|
||||
breadcrumb.append(
|
||||
$('<span />').html(' > '),
|
||||
$('<a />').attr('href', '#').html(v.display).click(function(e){
|
||||
e.preventDefault();
|
||||
miniBrowser(v.url);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
var categories = $('<div />');
|
||||
$(resultat.categories).each(function(k, v){
|
||||
categories.append(
|
||||
$('<p />').append(
|
||||
$('<a />').attr('href', '#').html(v.titre).click(function(e){
|
||||
e.preventDefault();
|
||||
miniBrowser(v.id);
|
||||
})
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
var products = $('<div />');
|
||||
$(resultat.products).each(function(k, v){
|
||||
products.append(
|
||||
$('<p />').append(
|
||||
$('<a />').attr('href', '#').html(v.titre).click(function(e){
|
||||
e.preventDefault();
|
||||
|
||||
$('#productToAdd_ref').val(v.ref);
|
||||
$('#productToAdd_titre').val(v.titre);
|
||||
$('#productToAdd_quantite').val(1);
|
||||
|
||||
manageStock(v.variants, v.promo?v.prix2:v.prix);
|
||||
|
||||
$('#productToAdd_tva').val(v.tva);
|
||||
|
||||
$('.productToAddInformation').show();
|
||||
$('#btn_ajout_produit').show();
|
||||
})
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
$('#minibrowser-breadcrumb').unbind().empty().append(breadcrumb);
|
||||
$('#minibrowser-categories').unbind().empty().append(categories);
|
||||
})
|
||||
.fail(function() {
|
||||
console.log('An error occurred while reading from JSON file');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}(window.jQuery, window, document));
|
||||
116
templates/admin/default/assets/js/tablesorter/jquery.metadata.js
Normal file
116
templates/admin/default/assets/js/tablesorter/jquery.metadata.js
Normal file
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
* Metadata - jQuery plugin for parsing metadata from elements
|
||||
*
|
||||
* Copyright (c) 2006 John Resig, Yehuda Katz, Jörn Zaefferer, Paul McLanahan
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Sets the type of metadata to use. Metadata is encoded in JSON, and each property
|
||||
* in the JSON will become a property of the element itself.
|
||||
*
|
||||
* There are three supported types of metadata storage:
|
||||
*
|
||||
* attr: Inside an attribute. The name parameter indicates *which* attribute.
|
||||
*
|
||||
* class: Inside the class attribute, wrapped in curly braces: { }
|
||||
*
|
||||
* elem: Inside a child element (e.g. a script tag). The
|
||||
* name parameter indicates *which* element.
|
||||
*
|
||||
* The metadata for an element is loaded the first time the element is accessed via jQuery.
|
||||
*
|
||||
* As a result, you can define the metadata type, use $(expr) to load the metadata into the elements
|
||||
* matched by expr, then redefine the metadata type and run another $(expr) for other elements.
|
||||
*
|
||||
* @name $.metadata.setType
|
||||
*
|
||||
* @example <p id="one" class="some_class {item_id: 1, item_label: 'Label'}">This is a p</p>
|
||||
* @before $.metadata.setType("class")
|
||||
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
|
||||
* @desc Reads metadata from the class attribute
|
||||
*
|
||||
* @example <p id="one" class="some_class" data="{item_id: 1, item_label: 'Label'}">This is a p</p>
|
||||
* @before $.metadata.setType("attr", "data")
|
||||
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
|
||||
* @desc Reads metadata from a "data" attribute
|
||||
*
|
||||
* @example <p id="one" class="some_class"><script>{item_id: 1, item_label: 'Label'}</script>This is a p</p>
|
||||
* @before $.metadata.setType("elem", "script")
|
||||
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
|
||||
* @desc Reads metadata from a nested script element
|
||||
*
|
||||
* @param String type The encoding type
|
||||
* @param String name The name of the attribute to be used to get metadata (optional)
|
||||
* @cat Plugins/Metadata
|
||||
* @descr Sets the type of encoding to be used when loading metadata for the first time
|
||||
* @type undefined
|
||||
* @see metadata()
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
$.extend({
|
||||
metadata : {
|
||||
defaults : {
|
||||
type: 'class',
|
||||
name: 'metadata',
|
||||
cre: /(\{.*\})/,
|
||||
single: 'metadata'
|
||||
},
|
||||
setType: function( type, name ){
|
||||
this.defaults.type = type;
|
||||
this.defaults.name = name;
|
||||
},
|
||||
get: function( elem, opts ){
|
||||
var data, m, e, attr,
|
||||
settings = $.extend({},this.defaults,opts);
|
||||
// check for empty string in single property
|
||||
if ( !settings.single.length ) { settings.single = 'metadata'; }
|
||||
|
||||
data = $.data(elem, settings.single);
|
||||
// returned cached data if it already exists
|
||||
if ( data ) { return data; }
|
||||
|
||||
data = "{}";
|
||||
|
||||
if ( settings.type === "class" ) {
|
||||
m = settings.cre.exec( elem.className );
|
||||
if ( m ) { data = m[1]; }
|
||||
} else if ( settings.type === "elem" ) {
|
||||
if( !elem.getElementsByTagName ) { return undefined; }
|
||||
e = elem.getElementsByTagName(settings.name);
|
||||
if ( e.length ) { data = $.trim(e[0].innerHTML); }
|
||||
} else if ( elem.getAttribute !== undefined ) {
|
||||
attr = elem.getAttribute( settings.name );
|
||||
if ( attr ) { data = attr; }
|
||||
}
|
||||
|
||||
if ( data.indexOf( '{' ) <0 ) { data = "{" + data + "}"; }
|
||||
|
||||
data = eval("(" + data + ")");
|
||||
|
||||
$.data( elem, settings.single, data );
|
||||
return data;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns the metadata object for the first member of the jQuery object.
|
||||
*
|
||||
* @name metadata
|
||||
* @descr Returns element's metadata object
|
||||
* @param Object opts An object contianing settings to override the defaults
|
||||
* @type jQuery
|
||||
* @cat Plugins/Metadata
|
||||
*/
|
||||
$.fn.metadata = function( opts ){
|
||||
return $.metadata.get( this[0], opts );
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
1477
templates/admin/default/assets/js/tablesorter/jquery.tablesorter.min.js
vendored
Normal file
1477
templates/admin/default/assets/js/tablesorter/jquery.tablesorter.min.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,826 @@
|
||||
/*! Filter widget formatter functions - updated 6/4/2013
|
||||
* requires: tableSorter 2.7.7+ and jQuery 1.4.3+
|
||||
*
|
||||
* uiSpinner (jQuery UI spinner)
|
||||
* uiSlider (jQuery UI slider)
|
||||
* uiRange (jQuery UI range slider)
|
||||
* uiDateCompare (jQuery UI datepicker; 1 input)
|
||||
* uiDatepicker (jQuery UI datepicker; 2 inputs, filter range)
|
||||
* html5Number (spinner)
|
||||
* html5Range (slider)
|
||||
* html5Color (color)
|
||||
*/
|
||||
/*jshint browser:true, jquery:true, unused:false */
|
||||
/*global jQuery: false */
|
||||
;(function($){
|
||||
"use strict";
|
||||
$.tablesorter = $.tablesorter || {};
|
||||
|
||||
$.tablesorter.filterFormatter = {
|
||||
|
||||
/**********************\
|
||||
jQuery UI Spinner
|
||||
\**********************/
|
||||
uiSpinner: function($cell, indx, spinnerDef) {
|
||||
var o = $.extend({
|
||||
min : 0,
|
||||
max : 100,
|
||||
step : 1,
|
||||
value : 1,
|
||||
delayed : true,
|
||||
addToggle : true,
|
||||
disabled : false,
|
||||
exactMatch : true,
|
||||
compare : ''
|
||||
}, spinnerDef ),
|
||||
// Add a hidden input to hold the range values
|
||||
$input = $('<input class="filter" type="hidden">')
|
||||
.appendTo($cell)
|
||||
// hidden filter update (.tsfilter) namespace trigger by filter widget
|
||||
.bind('change.tsfilter', function(){
|
||||
updateSpinner({ value: this.value, delayed: false });
|
||||
}),
|
||||
$shcell = [],
|
||||
c = $cell.closest('table')[0].config,
|
||||
|
||||
// this function updates the hidden input and adds the current values to the header cell text
|
||||
updateSpinner = function(ui) {
|
||||
var chkd = true, state,
|
||||
// ui is not undefined on create
|
||||
v = ui && ui.value && $.tablesorter.formatFloat((ui.value + '').replace(/[><=]/g,'')) || $cell.find('.spinner').val() || o.value;
|
||||
if (o.addToggle) {
|
||||
chkd = $cell.find('.toggle').is(':checked');
|
||||
}
|
||||
state = o.disabled || !chkd ? 'disable' : 'enable';
|
||||
$cell.find('.filter')
|
||||
// add equal to the beginning, so we filter exact numbers
|
||||
.val( chkd ? (o.compare ? o.compare : o.exactMatch ? '=' : '') + v : '' )
|
||||
.trigger('search', ui && typeof ui.delayed === 'boolean' ? ui.delayed : o.delayed).end()
|
||||
.find('.spinner').spinner(state).val(v);
|
||||
// update sticky header cell
|
||||
if ($shcell.length) {
|
||||
$shcell.find('.spinner').spinner(state).val(v);
|
||||
if (o.addToggle) {
|
||||
$shcell.find('.toggle')[0].checked = chkd;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// add callbacks; preserve added callbacks
|
||||
o.oldcreate = o.create;
|
||||
o.oldspin = o.spin;
|
||||
o.create = function(event, ui) {
|
||||
updateSpinner(); // ui is an empty object on create
|
||||
if (typeof o.oldcreate === 'function') { o.oldcreate(event, ui); }
|
||||
};
|
||||
o.spin = function(event, ui) {
|
||||
updateSpinner(ui);
|
||||
if (typeof o.oldspin === 'function') { o.oldspin(event, ui); }
|
||||
};
|
||||
if (o.addToggle) {
|
||||
$('<div class="button"><input id="uispinnerbutton' + indx + '" type="checkbox" class="toggle" /><label for="uispinnerbutton' + indx + '"></label></div>')
|
||||
.appendTo($cell)
|
||||
.find('.toggle')
|
||||
.bind('change', function(){
|
||||
updateSpinner();
|
||||
});
|
||||
}
|
||||
// make sure we use parsed data
|
||||
$cell.closest('thead').find('th[data-column=' + indx + ']').addClass('filter-parsed');
|
||||
// add a jQuery UI spinner!
|
||||
$('<input class="spinner spinner' + indx + '" />')
|
||||
.val(o.value)
|
||||
.appendTo($cell)
|
||||
.spinner(o)
|
||||
.bind('change keyup', function(e){
|
||||
updateSpinner();
|
||||
});
|
||||
|
||||
// has sticky headers?
|
||||
c.$table.bind('stickyHeadersInit', function(){
|
||||
$shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
|
||||
if (o.addToggle) {
|
||||
$('<div class="button"><input id="stickyuispinnerbutton' + indx + '" type="checkbox" class="toggle" /><label for="stickyuispinnerbutton' + indx + '"></label></div>')
|
||||
.appendTo($shcell)
|
||||
.find('.toggle')
|
||||
.bind('change', function(){
|
||||
$cell.find('.toggle')[0].checked = this.checked;
|
||||
updateSpinner();
|
||||
});
|
||||
}
|
||||
// add a jQuery UI spinner!
|
||||
$('<input class="spinner spinner' + indx + '" />')
|
||||
.val(o.value)
|
||||
.appendTo($shcell)
|
||||
.spinner(o)
|
||||
.bind('change keyup', function(e){
|
||||
$cell.find('.spinner').val( this.value );
|
||||
updateSpinner();
|
||||
});
|
||||
});
|
||||
|
||||
// on reset
|
||||
c.$table.bind('filterReset', function(){
|
||||
// turn off the toggle checkbox
|
||||
if (o.addToggle) {
|
||||
$cell.find('.toggle')[0].checked = false;
|
||||
}
|
||||
updateSpinner();
|
||||
});
|
||||
|
||||
updateSpinner();
|
||||
return $input;
|
||||
},
|
||||
|
||||
/**********************\
|
||||
jQuery UI Slider
|
||||
\**********************/
|
||||
uiSlider: function($cell, indx, sliderDef) {
|
||||
var o = $.extend({
|
||||
value : 0,
|
||||
min : 0,
|
||||
max : 100,
|
||||
step : 1,
|
||||
range : "min",
|
||||
delayed : true,
|
||||
valueToHeader : false,
|
||||
exactMatch : true,
|
||||
compare : '',
|
||||
allText : 'all'
|
||||
}, sliderDef ),
|
||||
// Add a hidden input to hold the range values
|
||||
$input = $('<input class="filter" type="hidden">')
|
||||
.appendTo($cell)
|
||||
// hidden filter update (.tsfilter) namespace trigger by filter widget
|
||||
.bind('change.tsfilter', function(){
|
||||
updateSlider({ value: this.value });
|
||||
}),
|
||||
$shcell = [],
|
||||
c = $cell.closest('table')[0].config,
|
||||
|
||||
// this function updates the hidden input and adds the current values to the header cell text
|
||||
updateSlider = function(ui) {
|
||||
// ui is not undefined on create
|
||||
var v = typeof ui !== "undefined" ? $.tablesorter.formatFloat((ui.value + '').replace(/[><=]/g,'')) || o.min : o.value,
|
||||
val = o.compare ? v : v === o.min ? o.allText : v,
|
||||
result = o.compare + val;
|
||||
if (o.valueToHeader) {
|
||||
// add range indication to the header cell above!
|
||||
$cell.closest('thead').find('th[data-column=' + indx + ']').find('.curvalue').html(' (' + result + ')');
|
||||
} else {
|
||||
// add values to the handle data-value attribute so the css tooltip will work properly
|
||||
$cell.find('.ui-slider-handle').addClass('value-popup').attr('data-value', result);
|
||||
}
|
||||
// update the hidden input;
|
||||
// ****** ADD AN EQUAL SIGN TO THE BEGINNING! <- this makes the slide exactly match the number ******
|
||||
// when the value is at the minimum, clear the hidden input so all rows will be seen
|
||||
$cell.find('.filter')
|
||||
.val( ( o.compare ? o.compare + v : v === o.min ? '' : (o.exactMatch ? '=' : '') + v ) )
|
||||
.trigger('search', ui && typeof ui.delayed === 'boolean' ? ui.delayed : o.delayed).end()
|
||||
.find('.slider').slider('value', v);
|
||||
|
||||
// update sticky header cell
|
||||
if ($shcell.length) {
|
||||
$shcell.find('.slider').slider('value', v);
|
||||
if (o.valueToHeader) {
|
||||
$shcell.closest('thead').find('th[data-column=' + indx + ']').find('.curvalue').html(' (' + result + ')');
|
||||
} else {
|
||||
$shcell.find('.ui-slider-handle').addClass('value-popup').attr('data-value', result);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
$cell.closest('thead').find('th[data-column=' + indx + ']').addClass('filter-parsed');
|
||||
|
||||
// add span to header for value - only works if the line in the updateSlider() function is also un-commented out
|
||||
if (o.valueToHeader) {
|
||||
$cell.closest('thead').find('th[data-column=' + indx + ']').find('.tablesorter-header-inner').append('<span class="curvalue" />');
|
||||
}
|
||||
|
||||
// add callbacks; preserve added callbacks
|
||||
o.oldcreate = o.create;
|
||||
o.oldslide = o.slide;
|
||||
o.create = function(event, ui) {
|
||||
updateSlider(); // ui is an empty object on create
|
||||
if (typeof o.oldcreate === 'function') { o.oldcreate(event, ui); }
|
||||
};
|
||||
o.slide = function(event, ui) {
|
||||
updateSlider(ui);
|
||||
if (typeof o.oldslide === 'function') { o.oldslide(event, ui); }
|
||||
};
|
||||
// add a jQuery UI slider!
|
||||
$('<div class="slider slider' + indx + '"/>')
|
||||
.appendTo($cell)
|
||||
.slider(o);
|
||||
|
||||
// on reset
|
||||
c.$table.bind('filterReset', function(){
|
||||
$cell.find('.slider').slider('value', o.value);
|
||||
updateSlider();
|
||||
});
|
||||
|
||||
// has sticky headers?
|
||||
c.$table.bind('stickyHeadersInit', function(){
|
||||
$shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
|
||||
|
||||
// add a jQuery UI slider!
|
||||
$('<div class="slider slider' + indx + '"/>')
|
||||
.val(o.value)
|
||||
.appendTo($shcell)
|
||||
.slider(o)
|
||||
.bind('change keyup', function(e){
|
||||
$cell.find('.slider').val( this.value );
|
||||
updateSlider();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
return $input;
|
||||
},
|
||||
|
||||
/*************************\
|
||||
jQuery UI Range Slider (2 handles)
|
||||
\*************************/
|
||||
uiRange: function($cell, indx, rangeDef) {
|
||||
var o = $.extend({
|
||||
values : [0, 100],
|
||||
min : 0,
|
||||
max : 100,
|
||||
range : true,
|
||||
delayed : true,
|
||||
valueToHeader : false
|
||||
}, rangeDef ),
|
||||
// Add a hidden input to hold the range values
|
||||
$input = $('<input class="filter" type="hidden">')
|
||||
.appendTo($cell)
|
||||
// hidden filter update (.tsfilter) namespace trigger by filter widget
|
||||
.bind('change.tsfilter', function(){
|
||||
var v = this.value.split(' - ');
|
||||
if (this.value === '') { v = [ o.min, o.max ]; }
|
||||
if (v && v[1]) {
|
||||
updateUiRange({ values: v, delay: false });
|
||||
}
|
||||
}),
|
||||
$shcell = [],
|
||||
c = $cell.closest('table')[0].config,
|
||||
|
||||
// this function updates the hidden input and adds the current values to the header cell text
|
||||
updateUiRange = function(ui) {
|
||||
// ui.values are undefined for some reason on create
|
||||
var val = ui && ui.values || o.values,
|
||||
result = val[0] + ' - ' + val[1],
|
||||
// make range an empty string if entire range is covered so the filter row will hide (if set)
|
||||
range = val[0] === o.min && val[1] === o.max ? '' : result;
|
||||
if (o.valueToHeader) {
|
||||
// add range indication to the header cell above (if not using the css method)!
|
||||
$cell.closest('thead').find('th[data-column=' + indx + ']').find('.currange').html(' (' + result + ')');
|
||||
} else {
|
||||
// add values to the handle data-value attribute so the css tooltip will work properly
|
||||
$cell.find('.ui-slider-handle')
|
||||
.addClass('value-popup')
|
||||
.eq(0).attr('data-value', val[0]).end() // adding value to data attribute
|
||||
.eq(1).attr('data-value', val[1]); // value popup shown via css
|
||||
}
|
||||
// update the hidden input
|
||||
$cell.find('.filter').val(range)
|
||||
.trigger('search', ui && typeof ui.delayed === 'boolean' ? ui.delayed : o.delayed).end()
|
||||
.find('.range').slider('values', val);
|
||||
// update sticky header cell
|
||||
if ($shcell.length) {
|
||||
$shcell.find('.range').slider('values', val);
|
||||
if (o.valueToHeader) {
|
||||
$shcell.closest('thead').find('th[data-column=' + indx + ']').find('.currange').html(' (' + result + ')');
|
||||
} else {
|
||||
$shcell.find('.ui-slider-handle')
|
||||
.addClass('value-popup')
|
||||
.eq(0).attr('data-value', val[0]).end() // adding value to data attribute
|
||||
.eq(1).attr('data-value', val[1]); // value popup shown via css
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
$cell.closest('thead').find('th[data-column=' + indx + ']').addClass('filter-parsed');
|
||||
|
||||
// add span to header for value - only works if the line in the updateUiRange() function is also un-commented out
|
||||
if (o.valueToHeader) {
|
||||
$cell.closest('thead').find('th[data-column=' + indx + ']').find('.tablesorter-header-inner').append('<span class="currange"/>');
|
||||
}
|
||||
|
||||
// add callbacks; preserve added callbacks
|
||||
o.oldcreate = o.create;
|
||||
o.oldslide = o.slide;
|
||||
// add a jQuery UI range slider!
|
||||
o.create = function(event, ui) {
|
||||
updateUiRange(); // ui is an empty object on create
|
||||
if (typeof o.oldcreate === 'function') { o.oldcreate(event, ui); }
|
||||
};
|
||||
o.slide = function(event, ui) {
|
||||
updateUiRange(ui);
|
||||
if (typeof o.oldslide === 'function') { o.oldslide(event, ui); }
|
||||
};
|
||||
$('<div class="range range' + indx +'"/>')
|
||||
.appendTo($cell)
|
||||
.slider(o);
|
||||
|
||||
// on reset
|
||||
c.$table.bind('filterReset', function(){
|
||||
$cell.find('.range').slider('values', o.values);
|
||||
updateUiRange();
|
||||
});
|
||||
|
||||
// has sticky headers?
|
||||
c.$table.bind('stickyHeadersInit', function(){
|
||||
$shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
|
||||
|
||||
// add a jQuery UI slider!
|
||||
$('<div class="range range' + indx + '"/>')
|
||||
.val(o.value)
|
||||
.appendTo($shcell)
|
||||
.slider(o)
|
||||
.bind('change keyup', function(e){
|
||||
$cell.find('.range').val( this.value );
|
||||
updateUiRange();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// return the hidden input so the filter widget has a reference to it
|
||||
return $input;
|
||||
},
|
||||
|
||||
/*************************\
|
||||
jQuery UI Datepicker compare (1 input)
|
||||
\*************************/
|
||||
uiDateCompare: function($cell, indx, defDate) {
|
||||
var o = $.extend({
|
||||
defaultDate : '',
|
||||
cellText : '',
|
||||
changeMonth : true,
|
||||
changeYear : true,
|
||||
numberOfMonths : 1,
|
||||
compare : ''
|
||||
}, defDate),
|
||||
$hdr = $cell.closest('thead').find('th[data-column=' + indx + ']'),
|
||||
// Add a hidden input to hold the range values
|
||||
$input = $('<input class="dateCompare" type="hidden">')
|
||||
.appendTo($cell)
|
||||
// hidden filter update (.tsfilter) namespace trigger by filter widget
|
||||
.bind('change.tsfilter', function(){
|
||||
var v = this.value;
|
||||
if (v) {
|
||||
o.onClose(v);
|
||||
}
|
||||
}),
|
||||
t, $shcell = [],
|
||||
c = $cell.closest('table')[0].config;
|
||||
|
||||
// make sure we're using parsed dates in the search
|
||||
$hdr.addClass('filter-parsed');
|
||||
// Add date range picker
|
||||
t = '<label>' + o.cellText + '</label><input type="text" class="date date' + indx +
|
||||
'" placeholder="' + ($hdr.data('placeholder') || $hdr.attr('data-placeholder') || '') + '" />';
|
||||
$(t).appendTo($cell);
|
||||
|
||||
// add callbacks; preserve added callbacks
|
||||
o.oldonClose = o.onClose;
|
||||
|
||||
o.onClose = function( selectedDate, ui ) {
|
||||
var date = new Date(selectedDate + ( o.compare.match('<') ? ' 23:59:59' : '' )).getTime() || '';
|
||||
$cell
|
||||
// update hidden input
|
||||
.find('.dateCompare').val( o.compare + date )
|
||||
.trigger('search').end()
|
||||
.find('.date')
|
||||
.datepicker('setDate', selectedDate);
|
||||
|
||||
// update sticky header cell
|
||||
if ($shcell.length) {
|
||||
$shcell.find('.date').datepicker('setDate', selectedDate);
|
||||
}
|
||||
|
||||
if (typeof o.oldonClose === 'function') { o.oldonClose(selectedDate, ui); }
|
||||
};
|
||||
$cell.find('.date').datepicker(o);
|
||||
|
||||
if (o.filterDate) {
|
||||
$cell.find('.date').datepicker('setDate', o.filterDate);
|
||||
}
|
||||
|
||||
// on reset
|
||||
c.$table.bind('filterReset', function(){
|
||||
$cell.find('.date').val('').datepicker('option', 'currentText', '' );
|
||||
if ($shcell.length) {
|
||||
$shcell.find('.date').val('').datepicker('option', 'currentText', '' );
|
||||
}
|
||||
});
|
||||
|
||||
// has sticky headers?
|
||||
c.$table.bind('stickyHeadersInit', function(){
|
||||
$shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
|
||||
// add a jQuery datepicker!
|
||||
$shcell
|
||||
.append(t)
|
||||
.find('.date')
|
||||
.datepicker(o);
|
||||
});
|
||||
|
||||
// return the hidden input so the filter widget has a reference to it
|
||||
return $input.val( o.defaultDate ? o.defaultDate : '' );
|
||||
},
|
||||
|
||||
/*************************\
|
||||
jQuery UI Datepicker (2 inputs)
|
||||
\*************************/
|
||||
uiDatepicker: function($cell, indx, defDate) {
|
||||
var o = $.extend({
|
||||
from : '',
|
||||
to : '',
|
||||
textFrom : 'from',
|
||||
textTo : 'to',
|
||||
changeMonth : true,
|
||||
changeYear : true,
|
||||
numberOfMonths : 1
|
||||
}, defDate),
|
||||
t, closeFrom, $shcell = [],
|
||||
// Add a hidden input to hold the range values
|
||||
$input = $('<input class="dateRange" type="hidden">')
|
||||
.appendTo($cell)
|
||||
// hidden filter update (.tsfilter) namespace trigger by filter widget
|
||||
.bind('change.tsfilter', function(){
|
||||
var v = this.value;
|
||||
if (v.match(' - ')) {
|
||||
v = v.split(' - ');
|
||||
$cell.find('.dateTo').val(v[1]);
|
||||
closeFrom(v[0]);
|
||||
} else if (v.match('>=')) {
|
||||
closeFrom( v.replace('>=', '') );
|
||||
} else if (v.match('<=')) {
|
||||
o.onClose( v.replace('<=', '') );
|
||||
}
|
||||
}),
|
||||
c = $cell.closest('table')[0].config;
|
||||
|
||||
// make sure we're using parsed dates in the search
|
||||
$cell.closest('thead').find('th[data-column=' + indx + ']').addClass('filter-parsed');
|
||||
// Add date range picker
|
||||
t = '<label>' + o.textFrom + '</label><input type="text" class="dateFrom" /><label>' + o.textTo + '</label><input type="text" class="dateTo" />';
|
||||
$(t).appendTo($cell);
|
||||
|
||||
// add callbacks; preserve added callbacks
|
||||
o.oldonClose = o.onClose;
|
||||
|
||||
o.defaultDate = o.from || o.defaultDate;
|
||||
|
||||
closeFrom = o.onClose = function( selectedDate, ui ) {
|
||||
var from = ( (new Date(selectedDate)).getTime() || ''),
|
||||
to = (new Date($cell.find('.dateTo').val() + ' 23:59:59').getTime() || ''),
|
||||
range = from ? ( to ? from + ' - ' + to : '>=' + from ) : (to ? '<=' + to : '');
|
||||
$cell
|
||||
.find('.dateTo').datepicker('option', 'minDate', selectedDate ).end()
|
||||
.find('.dateFrom').val(selectedDate).end()
|
||||
// update hidden input
|
||||
.find('.dateRange').val(range)
|
||||
.trigger('search');
|
||||
// update sticky header cell
|
||||
if ($shcell.length) {
|
||||
$shcell
|
||||
.find('.dateTo').datepicker('option', 'minDate', selectedDate ).end()
|
||||
.find('.dateFrom').val(selectedDate);
|
||||
}
|
||||
if (typeof o.oldonClose === 'function') { o.oldonClose(selectedDate, ui); }
|
||||
};
|
||||
|
||||
$cell.find('.dateFrom').datepicker(o);
|
||||
o.defaultDate = o.to || '+7d'; // set to date +7 days from today (if not defined)
|
||||
o.onClose = function( selectedDate, ui ) {
|
||||
var from = new Date( $cell.find('.dateFrom').val() ).getTime() || '',
|
||||
to = new Date( selectedDate + ' 23:59:59' ).getTime() || '',
|
||||
range = from ? ( to ? from + ' - ' + to : '>=' + from ) : (to ? '<=' + to : '');
|
||||
$cell
|
||||
.find('.dateFrom').datepicker('option', 'maxDate', selectedDate ).end()
|
||||
.find('.dateTo').val(selectedDate).end()
|
||||
.find('.dateRange').val(range)
|
||||
.trigger('search');
|
||||
// update sticky header cell
|
||||
if ($shcell.length) {
|
||||
$shcell
|
||||
.find('.dateFrom').datepicker('option', 'maxDate', selectedDate ).end()
|
||||
.find('.dateTo').val(selectedDate);
|
||||
}
|
||||
if (typeof o.oldonClose === 'function') { o.oldonClose(selectedDate, ui); }
|
||||
};
|
||||
$cell.find('.dateTo').datepicker(o);
|
||||
|
||||
// has sticky headers?
|
||||
c.$table.bind('stickyHeadersInit', function(){
|
||||
$shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
|
||||
// add a jQuery datepicker!
|
||||
$shcell.append(t).find('.dateTo').datepicker(o);
|
||||
o.defaultDate = o.from || o.defaultDate || new Date();
|
||||
o.onClose = closeFrom;
|
||||
$shcell.find('.dateFrom').datepicker(o);
|
||||
});
|
||||
|
||||
// on reset
|
||||
$cell.closest('table').bind('filterReset', function(){
|
||||
$cell.find('.dateFrom, .dateTo').val('');
|
||||
if ($shcell.length) {
|
||||
$shcell.find('.dateFrom, .dateTo').val('');
|
||||
}
|
||||
});
|
||||
|
||||
// return the hidden input so the filter widget has a reference to it
|
||||
t = o.from ? ( o.to ? o.from + ' - ' + o.to : '>=' + o.from ) : (o.to ? '<=' + o.to : '');
|
||||
return $input.val( t );
|
||||
},
|
||||
|
||||
/**********************\
|
||||
HTML5 Number (spinner)
|
||||
\**********************/
|
||||
html5Number : function($cell, indx, def5Num) {
|
||||
var t, o = $.extend({
|
||||
value : 0,
|
||||
min : 0,
|
||||
max : 100,
|
||||
step : 1,
|
||||
delayed : true,
|
||||
disabled : false,
|
||||
addToggle : true,
|
||||
exactMatch : true,
|
||||
compare : '',
|
||||
skipTest: false
|
||||
}, def5Num),
|
||||
|
||||
// test browser for HTML5 range support
|
||||
$number = $('<input type="number" style="visibility:hidden;" value="test">').appendTo($cell),
|
||||
// test if HTML5 number is supported - from Modernizr
|
||||
numberSupported = o.skipTest || $number.attr('type') === 'number' && $number.val() !== 'test',
|
||||
$shcell = [],
|
||||
c = $cell.closest('table')[0].config,
|
||||
|
||||
updateNumber = function(v, delayed){
|
||||
var chkd = o.addToggle ? $cell.find('.toggle').is(':checked') : true;
|
||||
$cell.find('input[type=hidden]')
|
||||
// add equal to the beginning, so we filter exact numbers
|
||||
.val( !o.addToggle || chkd ? (o.compare ? o.compare : o.exactMatch ? '=' : '') + v : '' )
|
||||
.trigger('search', delayed ? delayed : o.delayed).end()
|
||||
.find('.number').val(v);
|
||||
if ($cell.find('.number').length) {
|
||||
$cell.find('.number')[0].disabled = (o.disabled || !chkd);
|
||||
}
|
||||
// update sticky header cell
|
||||
if ($shcell.length) {
|
||||
$shcell.find('.number').val(v)[0].disabled = (o.disabled || !chkd);
|
||||
if (o.addToggle) {
|
||||
$shcell.find('.toggle')[0].checked = chkd;
|
||||
}
|
||||
}
|
||||
};
|
||||
$number.remove();
|
||||
|
||||
if (numberSupported) {
|
||||
t = o.addToggle ? '<div class="button"><input id="html5button' + indx + '" type="checkbox" class="toggle" /><label for="html5button' + indx + '"></label></div>' : '';
|
||||
t += '<input class="number" type="number" min="' + o.min + '" max="' + o.max + '" value="' +
|
||||
o.value + '" step="' + o.step + '" />';
|
||||
// add HTML5 number (spinner)
|
||||
$cell
|
||||
.html(t + '<input type="hidden" />')
|
||||
.find('.toggle, .number').bind('change', function(){
|
||||
updateNumber( $cell.find('.number').val() );
|
||||
})
|
||||
.closest('thead').find('th[data-column=' + indx + ']')
|
||||
.addClass('filter-parsed') // get exact numbers from column
|
||||
// on reset
|
||||
.closest('table').bind('filterReset', function(){
|
||||
// turn off the toggle checkbox
|
||||
if (o.addToggle) {
|
||||
$cell.find('.toggle')[0].checked = false;
|
||||
if ($shcell.length) {
|
||||
$shcell.find('.toggle')[0].checked = false;
|
||||
}
|
||||
}
|
||||
updateNumber( $cell.find('.number').val() );
|
||||
});
|
||||
|
||||
// hidden filter update (.tsfilter) namespace trigger by filter widget
|
||||
$cell.find('input[type=hidden]').bind('change.tsfilter', function(){
|
||||
updateNumber( this.value );
|
||||
});
|
||||
|
||||
// has sticky headers?
|
||||
c.$table.bind('stickyHeadersInit', function(){
|
||||
$shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
|
||||
$shcell
|
||||
.html(t)
|
||||
.find('.toggle, .number').bind('change', function(){
|
||||
updateNumber( $shcell.find('.number').val() );
|
||||
});
|
||||
updateNumber( $cell.find('.number').val() );
|
||||
});
|
||||
|
||||
updateNumber( $cell.find('.number').val() );
|
||||
|
||||
}
|
||||
|
||||
return numberSupported ? $cell.find('input[type="hidden"]') : $('<input type="search">');
|
||||
},
|
||||
|
||||
/**********************\
|
||||
HTML5 range slider
|
||||
\**********************/
|
||||
html5Range : function($cell, indx, def5Range) {
|
||||
var t, o = $.extend({
|
||||
value : 0,
|
||||
min : 0,
|
||||
max : 100,
|
||||
step : 1,
|
||||
delayed : true,
|
||||
valueToHeader : true,
|
||||
exactMatch : true,
|
||||
compare : '',
|
||||
allText : 'all',
|
||||
skipTest : false
|
||||
}, def5Range),
|
||||
|
||||
// test browser for HTML5 range support
|
||||
$range = $('<input type="range" style="visibility:hidden;" value="test">').appendTo($cell),
|
||||
// test if HTML5 range is supported - from Modernizr (but I left out the method to detect in Safari 2-4)
|
||||
// see https://github.com/Modernizr/Modernizr/blob/master/feature-detects/inputtypes.js
|
||||
rangeSupported = o.skipTest || $range.attr('type') === 'range' && $range.val() !== 'test',
|
||||
$shcell = [],
|
||||
c = $cell.closest('table')[0].config,
|
||||
|
||||
updateRange = function(v, delayed){
|
||||
/*jshint eqeqeq:false */
|
||||
v = (v + '').replace(/[<>=]/g,'') || o.min; // hidden input changes may include compare symbols
|
||||
var t = ' (' + (o.compare ? o.compare + v : v == o.min ? o.allText : v) + ')';
|
||||
$cell.find('input[type=hidden]')
|
||||
// add equal to the beginning, so we filter exact numbers
|
||||
.val( ( o.compare ? o.compare + v : ( v == o.min ? '' : ( o.exactMatch ? '=' : '' ) + v ) ) )
|
||||
//( val == o.min ? '' : val + (o.exactMatch ? '=' : ''))
|
||||
.trigger('search', delayed ? delayed : o.delayed).end()
|
||||
.find('.range').val(v);
|
||||
// or add current value to the header cell, if desired
|
||||
$cell.closest('thead').find('th[data-column=' + indx + ']').find('.curvalue').html(t);
|
||||
// update sticky header cell
|
||||
if ($shcell.length) {
|
||||
$shcell.find('.range').val(v);
|
||||
$shcell.closest('thead').find('th[data-column=' + indx + ']').find('.curvalue').html(t);
|
||||
}
|
||||
};
|
||||
$range.remove();
|
||||
|
||||
if (rangeSupported) {
|
||||
// add HTML5 range
|
||||
$cell
|
||||
.html('<input type="hidden"><input class="range" type="range" min="' + o.min + '" max="' + o.max + '" value="' + o.value + '" />')
|
||||
.closest('thead').find('th[data-column=' + indx + ']')
|
||||
.addClass('filter-parsed') // get exact numbers from column
|
||||
// add span to header for the current slider value
|
||||
.find('.tablesorter-header-inner').append('<span class="curvalue" />');
|
||||
|
||||
$cell.find('.range').bind('change', function(){
|
||||
updateRange( this.value );
|
||||
});
|
||||
|
||||
// hidden filter update (.tsfilter) namespace trigger by filter widget
|
||||
$cell.find('input[type=hidden]').bind('change.tsfilter', function(){
|
||||
/*jshint eqeqeq:false */
|
||||
var v = this.value;
|
||||
if (v !== this.lastValue) {
|
||||
this.lastValue = ( o.compare ? o.compare + v : ( v == o.min ? '' : ( o.exactMatch ? '=' : '' ) + v ) );
|
||||
this.value = this.lastValue;
|
||||
updateRange( v );
|
||||
}
|
||||
});
|
||||
|
||||
// has sticky headers?
|
||||
c.$table.bind('stickyHeadersInit', function(){
|
||||
$shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
|
||||
$shcell
|
||||
.html('<input class="range" type="range" min="' + o.min + '" max="' + o.max + '" value="' + o.value + '" />')
|
||||
.find('.range').bind('change', function(){
|
||||
updateRange( $shcell.find('.range').val() );
|
||||
});
|
||||
updateRange( $cell.find('.range').val() );
|
||||
});
|
||||
|
||||
// on reset
|
||||
$cell.closest('table').bind('filterReset', function(){
|
||||
// just turn off the colorpicker
|
||||
updateRange(o.value);
|
||||
});
|
||||
|
||||
updateRange( $cell.find('.range').val() );
|
||||
|
||||
}
|
||||
|
||||
return rangeSupported ? $cell.find('input[type="hidden"]') : $('<input type="search">');
|
||||
},
|
||||
|
||||
/**********************\
|
||||
HTML5 Color picker
|
||||
\**********************/
|
||||
html5Color: function($cell, indx, defColor) {
|
||||
var t, o = $.extend({
|
||||
value : '#000000',
|
||||
disabled : false,
|
||||
addToggle : true,
|
||||
exactMatch : true,
|
||||
valueToHeader : false,
|
||||
skipTest : false
|
||||
}, defColor),
|
||||
// Add a hidden input to hold the range values
|
||||
$color = $('<input type="color" style="visibility:hidden;" value="test">').appendTo($cell),
|
||||
// test if HTML5 color is supported - from Modernizr
|
||||
colorSupported = o.skipTest || $color.attr('type') === 'color' && $color.val() !== 'test',
|
||||
$shcell = [],
|
||||
c = $cell.closest('table')[0].config,
|
||||
|
||||
updateColor = function(v){
|
||||
v = v || o.value;
|
||||
var chkd = true,
|
||||
t = ' (' + v + ')';
|
||||
if (o.addToggle) {
|
||||
chkd = $cell.find('.toggle').is(':checked');
|
||||
}
|
||||
if ($cell.find('.colorpicker').length) {
|
||||
$cell.find('.colorpicker').val(v)[0].disabled = (o.disabled || !chkd);
|
||||
}
|
||||
|
||||
$cell.find('input[type=hidden]')
|
||||
.val( chkd ? v + (o.exactMatch ? '=' : '') : '' )
|
||||
.trigger('search');
|
||||
if (o.valueToHeader) {
|
||||
// add current color to the header cell
|
||||
$cell.closest('thead').find('th[data-column=' + indx + ']').find('.curcolor').html(t);
|
||||
} else {
|
||||
// current color to span in cell
|
||||
$cell.find('.currentColor').html(t);
|
||||
}
|
||||
|
||||
// update sticky header cell
|
||||
if ($shcell.length) {
|
||||
$shcell.find('.colorpicker').val(v)[0].disabled = (o.disabled || !chkd);
|
||||
if (o.addToggle) {
|
||||
$shcell.find('.toggle')[0].checked = chkd;
|
||||
}
|
||||
if (o.valueToHeader) {
|
||||
// add current color to the header cell
|
||||
$shcell.closest('thead').find('th[data-column=' + indx + ']').find('.curcolor').html(t);
|
||||
} else {
|
||||
// current color to span in cell
|
||||
$shcell.find('.currentColor').html(t);
|
||||
}
|
||||
}
|
||||
};
|
||||
$color.remove();
|
||||
|
||||
if (colorSupported) {
|
||||
// add HTML5 color picker
|
||||
t = '<div class="color-controls-wrapper">';
|
||||
t += o.addToggle ? '<div class="button"><input id="colorbutton' + indx + '" type="checkbox" class="toggle" /><label for="colorbutton' + indx + '"></label></div>' : '';
|
||||
t += '<input type="hidden"><input class="colorpicker" type="color" />';
|
||||
t += (o.valueToHeader ? '' : '<span class="currentColor">(#000000)</span>') + '</div>';
|
||||
$cell.html(t);
|
||||
|
||||
// add span to header for the current color value - only works if the line in the updateColor() function is also un-commented out
|
||||
if (o.valueToHeader) {
|
||||
$cell.closest('thead').find('th[data-column=' + indx + ']').find('.tablesorter-header-inner').append('<span class="curcolor" />');
|
||||
}
|
||||
|
||||
$cell.find('.toggle, .colorpicker').bind('change', function(){
|
||||
updateColor( $cell.find('.colorpicker').val() );
|
||||
});
|
||||
|
||||
// hidden filter update (.tsfilter) namespace trigger by filter widget
|
||||
$cell.find('input[type=hidden]').bind('change.tsfilter', function(){
|
||||
updateColor( this.value );
|
||||
});
|
||||
|
||||
// on reset
|
||||
$cell.closest('table').bind('filterReset', function(){
|
||||
// just turn off the colorpicker
|
||||
$cell.find('.toggle')[0].checked = false;
|
||||
updateColor( $cell.find('.colorpicker').val() );
|
||||
});
|
||||
|
||||
// has sticky headers?
|
||||
c.$table.bind('stickyHeadersInit', function(){
|
||||
$shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx);
|
||||
$shcell
|
||||
.html(t)
|
||||
.find('.toggle, .colorpicker').bind('change', function(){
|
||||
updateColor( $shcell.find('.colorpicker').val() );
|
||||
});
|
||||
updateColor( $shcell.find('.colorpicker').val() );
|
||||
});
|
||||
|
||||
updateColor( o.value );
|
||||
}
|
||||
return colorSupported ? $cell.find('input[type="hidden"]') : $('<input type="search">');
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,5 +2,4 @@
|
||||
@import "bootstrap/bootstrap.less";
|
||||
|
||||
/* Thelia Admin */
|
||||
@import "thelia/thelia.less";
|
||||
// @import "thelia/responsive.less";
|
||||
@import "thelia/thelia.less";
|
||||
@@ -247,4 +247,10 @@
|
||||
|
||||
.ui-slider{
|
||||
margin-top: 23px;
|
||||
}
|
||||
|
||||
.loading{
|
||||
background: url("@{imgDir}/ajax-loader.gif") no-repeat;
|
||||
height: 24px;
|
||||
width: 24px;
|
||||
}
|
||||
@@ -8,9 +8,7 @@
|
||||
<div class="catalog">
|
||||
<div id="wrapper" class="container">
|
||||
|
||||
<ul class="breadcrumb">
|
||||
{include file="includes/category_breadcrumb.html"}
|
||||
</ul>
|
||||
{include file="includes/catalog-breadcrumb.html"}
|
||||
|
||||
{module_include location='catalog_top'}
|
||||
|
||||
@@ -20,7 +18,7 @@
|
||||
<table class="table table-striped table-condensed" id="category_list">
|
||||
<caption>
|
||||
{* display parent category name, and get current cat ID *}
|
||||
{loop name="category_title" type="category" visible="*" id="{$current_category_id}"}
|
||||
{loop name="category_title" type="category" visible="*" id=$current_category_id}
|
||||
{intl l="Categories in %cat" cat=$TITLE}
|
||||
{$cat_id = $ID}
|
||||
{/loop}
|
||||
@@ -30,7 +28,7 @@
|
||||
|
||||
{module_include location='category_list_caption'}
|
||||
|
||||
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.category.create"}
|
||||
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.categories.create"}
|
||||
<a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new category'}" href="#add_category_dialog" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-plus-sign"></span>
|
||||
</a>
|
||||
@@ -40,6 +38,16 @@
|
||||
{ifloop rel="category_list"}
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="object-title">
|
||||
{admin_sortable_header
|
||||
current_order=$category_order
|
||||
order='id'
|
||||
reverse_order='id_reverse'
|
||||
path={url path='/admin/catalog' id_category=$current_category_id}
|
||||
label="{intl l='ID'}"
|
||||
}
|
||||
</th>
|
||||
|
||||
<th class="object-image"> </th>
|
||||
|
||||
<th class="object-title">
|
||||
@@ -47,8 +55,8 @@
|
||||
current_order=$category_order
|
||||
order='alpha'
|
||||
reverse_order='alpha_reverse'
|
||||
path={url path='/admin/catalog/category' id="{$current_category_id}"}
|
||||
label={intl l='Category title'}
|
||||
path={url path='/admin/catalog' id_category=$current_category_id}
|
||||
label="{intl l='Category title'}"
|
||||
}
|
||||
</th>
|
||||
|
||||
@@ -59,8 +67,8 @@
|
||||
current_order=$category_order
|
||||
order='visible'
|
||||
reverse_order='visible_reverse'
|
||||
path={url path='/admin/catalog/category' id="{$current_category_id}"}
|
||||
label={intl l='Online'}
|
||||
path={url path='/admin/catalog' id_category=$current_category_id}
|
||||
label="{intl l='Online'}"
|
||||
}
|
||||
</th>
|
||||
|
||||
@@ -69,8 +77,8 @@
|
||||
current_order=$category_order
|
||||
order='manual'
|
||||
reverse_order='manual_reverse'
|
||||
path={url path='/admin/catalog/category' id="{$current_category_id}"}
|
||||
label={intl l='Position'}
|
||||
path={url path='/admin/catalog' id_category=$current_category_id}
|
||||
label="{intl l='Position'}"
|
||||
}
|
||||
</th>
|
||||
|
||||
@@ -81,22 +89,24 @@
|
||||
<tbody>
|
||||
{loop name="category_list" type="category" visible="*" parent=$current_category_id order=$category_order backend_context="1" lang=$lang_id}
|
||||
<tr>
|
||||
<td>{$ID}</td>
|
||||
|
||||
<td>
|
||||
i={$ID} {loop type="image" name="cat_image" source="category" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"}
|
||||
<a href="{url path='admin/catalog/category' id="$ID" action='browse'}" title="{intl l='Browse this category'}"><img class="img-thumbnail" src="#IMAGE_URL" alt="#TITLE" /></a>
|
||||
{loop type="image" name="cat_image" source="category" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"}
|
||||
<a href="{url path='admin/catalog' category_id=$ID}" title="{intl l='Browse this category'}"><img class="img-thumbnail" src="#IMAGE_URL" alt="#TITLE" /></a>
|
||||
{/loop}
|
||||
</td>
|
||||
|
||||
<td class="object-title">
|
||||
<a href="{url path='admin/catalog/category' id="$ID" action='browse'}" title="{intl l='Browse this category'}">
|
||||
{$ID} p={$POSITION} {$TITLE}
|
||||
<a href="{url path='admin/catalog' category_id=$ID}" title="{intl l='Browse this category'}">
|
||||
{$TITLE}
|
||||
</a>
|
||||
</td>
|
||||
|
||||
{module_include location='category_list_row'}
|
||||
|
||||
<td>
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.category.edit"}
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.categories.edit"}
|
||||
<div class="make-switch switch-small" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>">
|
||||
<input type="checkbox" data-id="{$ID}" class="categoryVisibleToggle" {if $VISIBLE == 1}checked="checked"{/if}>
|
||||
</div>
|
||||
@@ -111,24 +121,24 @@
|
||||
|
||||
<td>
|
||||
{admin_position_block
|
||||
permission="admin.category.edit"
|
||||
path={url path='admin/catalog/category' category_id="{$ID}"}
|
||||
permission="admin.categories.edit"
|
||||
path={url path='admin/category/update-position' category_id=$ID}
|
||||
url_parameter="category_id"
|
||||
in_place_edit_class="categoryPositionChange"
|
||||
position="$POSITION"
|
||||
id="$ID"
|
||||
position=$POSITION
|
||||
id=$ID
|
||||
}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-default btn-xs" title="{intl l='Browse this category'}" href="{url path='admin/catalog/category' id="$ID" action='browse'}"><i class="glyphicon glyphicon-folder-open"></i></a>
|
||||
<a class="btn btn-default btn-xs" title="{intl l='Browse this category'}" href="{url path='admin/category' category_id=$ID}"><i class="glyphicon glyphicon-folder-open"></i></a>
|
||||
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.category.edit"}
|
||||
<a class="btn btn-default btn-xs" title="{intl l='Edit this category'}" href="{url path='admin/catalog/category' id="$ID" action='edit'}"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.categories.edit"}
|
||||
<a class="btn btn-default btn-xs" title="{intl l='Edit this category'}" href="{url path='/admin/categories/update' category_id=$ID}"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
{/loop}
|
||||
|
||||
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.category.delete"}
|
||||
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.categories.delete"}
|
||||
<a class="btn btn-default btn-xs category-delete" title="{intl l='Delete this category and all its contents'}" href="#delete_category_dialog" data-id="{$ID}" data-toggle="modal"><i class="glyphicon glyphicon-trash"></i></a>
|
||||
{/loop}
|
||||
</div>
|
||||
@@ -143,7 +153,7 @@
|
||||
<tr>
|
||||
<td class="message">
|
||||
<div class="alert alert-info">
|
||||
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.category.create"}
|
||||
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.categories.create"}
|
||||
{intl l="This category has no sub-categories. To create a new one, click the + button above."}
|
||||
{/loop}
|
||||
|
||||
@@ -166,9 +176,10 @@
|
||||
<table class="table table-striped table-condensed">
|
||||
<caption>
|
||||
{* display parent category name *}
|
||||
{loop name="category_title" type="category" visible="*" id="{$current_category_id}"}
|
||||
{loop name="category_title" type="category" visible="*" id=$current_category_id}
|
||||
{intl l="Products in %cat" cat=$TITLE}
|
||||
{/loop}
|
||||
|
||||
{elseloop rel="category_title"}
|
||||
{intl l="Top level Products"}
|
||||
{/elseloop}
|
||||
@@ -183,15 +194,34 @@
|
||||
{ifloop rel="product_list"}
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="object-title">
|
||||
{admin_sortable_header
|
||||
current_order=$product_order
|
||||
order='id'
|
||||
reverse_order='id_reverse'
|
||||
path={url path='/admin/product' category_id=$current_category_id}
|
||||
label="{intl l='ID'}"
|
||||
}
|
||||
|
||||
<th> </th>
|
||||
|
||||
<th class="object-title">
|
||||
{admin_sortable_header
|
||||
current_order=$product_order
|
||||
order='ref'
|
||||
reverse_order='ref_reverse'
|
||||
path={url path='/admin/product' category_id=$current_category_id}
|
||||
label="{intl l='Reference'}"
|
||||
}
|
||||
</th>
|
||||
|
||||
<th class="object-title">
|
||||
{admin_sortable_header
|
||||
current_order=$product_order
|
||||
order='alpha'
|
||||
reverse_order='alpha_reverse'
|
||||
path={url path='/admin/catalog/product' id="{$current_category_id}"}
|
||||
label={intl l='Product title'}
|
||||
path={url path='/admin/product' category_id=$current_category_id}
|
||||
label="{intl l='Product title'}"
|
||||
}
|
||||
|
||||
{module_include location='product_list_header'}
|
||||
@@ -201,8 +231,8 @@
|
||||
current_order=$product_order
|
||||
order='visible'
|
||||
reverse_order='visible_reverse'
|
||||
path={url path='/admin/catalog/product' id="{$current_category_id}"}
|
||||
label={intl l='Online'}
|
||||
path={url path='/admin/product' category_id=$current_category_id}
|
||||
label="{intl l='Online'}"
|
||||
}
|
||||
</th>
|
||||
|
||||
@@ -211,8 +241,8 @@
|
||||
current_order=$product_order
|
||||
order='manual'
|
||||
reverse_order='manual_reverse'
|
||||
path={url path='/admin/catalog/product' id="{$current_category_id}"}
|
||||
label={intl l='Position'}
|
||||
path={url path='/admin/product' category_id=$current_category_id}
|
||||
label="{intl l='Position'}"
|
||||
}
|
||||
</th>
|
||||
|
||||
@@ -221,39 +251,58 @@
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{loop name="product_list" type="product" category="{$current_category_id}" order="manual"}
|
||||
{loop name="product_list" type="product" category=$current_category_id order="manual"}
|
||||
<tr>
|
||||
<td>{$ID}</td>
|
||||
|
||||
<td>
|
||||
{loop type="image" name="cat_image" source="product" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"}
|
||||
<a href="{url path='admin/catalog/product' id="$ID" action='edit'}" title="{intl l='Edit this product'}">
|
||||
<a href="{url path='admin/product/edit' id=$ID}" title="{intl l='Edit this product'}">
|
||||
<img src="#IMAGE_URL" alt="#TITLE" />
|
||||
</a>
|
||||
{/loop}
|
||||
|
||||
<td class="object-title"><a href="{url path='admin/catalog/product' id="$ID" action='edit'}" title="{intl l='Edit this product'}">{$TITLE}</a></td>
|
||||
<td class="object-title"><a href="{url path='admin/product/edit' id=$ID}" title="{intl l='Edit this product'}">{$REF}</a></td>
|
||||
|
||||
<td class="object-title"><a href="{url path='admin/product/edit' id=$ID}" title="{intl l='Edit this product'}">{$TITLE}</a></td>
|
||||
|
||||
{module_include location='product_list_row'}
|
||||
|
||||
<td>
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.products.edit"}
|
||||
<div class="make-switch switch-small" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>">
|
||||
<input type="checkbox" data-id="{$ID}" class="productVisibleToggle" {if $VISIBLE == 1}checked="checked"{/if}>
|
||||
</div>
|
||||
{/loop}
|
||||
|
||||
{elseloop rel="can_change"}
|
||||
<div class="make-switch switch-small" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>">
|
||||
<input type="checkbox" data-id="{$ID}" class="displayToggle" {if $VISIBLE == 1}checked="checked"{/if}>
|
||||
</div>
|
||||
{/elseloop}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{admin_position_block
|
||||
permission="admin.product.edit"
|
||||
path={url path='admin/catalog/product' category_id="{$ID}"}
|
||||
path={url path='admin/product' category_id=$ID}
|
||||
url_parameter="product_id"
|
||||
in_place_edit_class="productPositionChange"
|
||||
position="$POSITION"
|
||||
id="$ID"
|
||||
position=$POSITION
|
||||
id=$ID
|
||||
}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<a class="btn btn-default btn-xs" title="{intl l='Edit this product'}" href="{url path='admin/catalog/product' id="$ID" action='edit'}"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
<a class="btn btn-default btn-xs product-delete" title="{intl l='Delete this product'}" href="{url path='admin/catalog/product' id="$ID" action='delete'}"><i class="glyphicon glyphicon-trash"></i></a>
|
||||
<div class="btn-group">
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.product.edit"}
|
||||
<a class="btn btn-default btn-xs" title="{intl l='Edit this product'}" href="{url path='admin/product/edit' product_id=$ID}"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
{/loop}
|
||||
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.product.delete"}
|
||||
<a class="btn btn-default btn-xs product-delete" title="{intl l='Delete this product'}" href="{url path='admin/product/delete' id=$ID}"><i class="glyphicon glyphicon-trash"></i></a>
|
||||
{/loop}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/loop}
|
||||
@@ -276,8 +325,82 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{include file="includes/add-category-dialog.html"}
|
||||
{include file="includes/delete-category-dialog.html"}
|
||||
{* Adding a new Category *}
|
||||
|
||||
|
||||
{form name="thelia.admin.category.creation"}
|
||||
|
||||
{* Capture the dialog body, to pass it to the generic dialog *}
|
||||
{capture "category_creation_dialog"}
|
||||
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
{form_field form=$form field='success_url'}
|
||||
{* on success, redirect to the edition page, _ID_ is replaced with the created object ID, see controller *}
|
||||
<input type="hidden" name="{$name}" value="{url path='/admin/categories/update' category_id='_ID_'}" />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='parent'}
|
||||
<input type="hidden" name="{$name}" value="{$current_category_id}" />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='title'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
|
||||
|
||||
{loop type="lang" name="default-lang" default_only="1"}
|
||||
|
||||
<div class="input-group">
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='Currency name'}" placeholder="{intl l='Name'}">
|
||||
<span class="input-group-addon"><img src="{image file="assets/img/flags/{$CODE}.gif"}" alt="$TITLE" /></span>
|
||||
</div>
|
||||
|
||||
<div class="help-block">{intl l='Enter here the category name in the default language (%title)' title="$TITLE"}</div>
|
||||
|
||||
{* Switch edition to the current locale *}
|
||||
<input type="hidden" name="edit_language_id" value="{$ID}" />
|
||||
|
||||
{form_field form=$form field='locale'}
|
||||
<input type="hidden" name="{$name}" value="{$LOCALE}" />
|
||||
{/form_field}
|
||||
{/loop}
|
||||
</div>
|
||||
{/form_field}
|
||||
{/capture}
|
||||
|
||||
{include
|
||||
file = "includes/generic-create-dialog.html"
|
||||
|
||||
dialog_id = "add_category_dialog"
|
||||
dialog_title = {intl l="Create a new category"}
|
||||
dialog_body = {$smarty.capture.category_creation_dialog nofilter}
|
||||
|
||||
dialog_ok_label = {intl l="Create this category"}
|
||||
dialog_cancel_label = {intl l="Cancel"}
|
||||
|
||||
form_action = {url path='/admin/categories/create'}
|
||||
form_enctype = {form_enctype form=$form}
|
||||
form_error_message = $form_error_message
|
||||
}
|
||||
{/form}
|
||||
|
||||
{* Delete category confirmation dialog *}
|
||||
|
||||
{capture "category_delete_dialog"}
|
||||
<input type="hidden" name="current_category_id" value="{$current_category_id}" />
|
||||
<input type="hidden" name="category_id" id="delete_category_id" value"" />
|
||||
{/capture}
|
||||
|
||||
{include
|
||||
file = "includes/generic-confirm-dialog.html"
|
||||
|
||||
dialog_id = "delete_category_dialog"
|
||||
dialog_title = {intl l="Delete a category"}
|
||||
dialog_message = {intl l="Do you really want to delete this category, and <strong>all</strong> its contents ?"}
|
||||
|
||||
form_action = {url path='/admin/categories/delete'}
|
||||
form_content = {$smarty.capture.category_delete_dialog nofilter}
|
||||
}
|
||||
{/block}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
@@ -290,68 +413,100 @@
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
{* display the form creation dialog if it contains errors *}
|
||||
// JS stuff for category creation form
|
||||
{include
|
||||
file = "includes/generic-js-dialog.html"
|
||||
|
||||
{form name="thelia.admin.category.creation"}
|
||||
{if #form_error}
|
||||
$('#add_category_dialog').modal();
|
||||
{/if}
|
||||
{/form}
|
||||
dialog_id = "add_category_dialog"
|
||||
form_name = "thelia.admin.category.creation"
|
||||
}
|
||||
|
||||
{* Always reset create dialog on close *}
|
||||
// JS stuff for product creation form
|
||||
{include
|
||||
file = "includes/generic-js-dialog.html"
|
||||
|
||||
$('#add_category_dialog').on('hidden',function() {
|
||||
// Hide error message
|
||||
$('#add_category_dialog_error').remove();
|
||||
dialog_id = "add_product_dialog"
|
||||
form_name = "thelia.admin.product.creation"
|
||||
}
|
||||
|
||||
// Clear error status
|
||||
$("#add_category_dialog .error").removeClass('error');
|
||||
|
||||
// Empty field values
|
||||
$("#add_category_dialog input[type=text]").val('');
|
||||
});
|
||||
{* Set the proper ID in the delete confirmation dialog *}
|
||||
|
||||
{* Set the proper category ID in the delete confirmation dialog *}
|
||||
$('a.category-delete').click(function(ev) {
|
||||
$('#delete_category_id').val($(this).data('id'));
|
||||
});
|
||||
|
||||
$(document).on("click", ".category-delete", function () {
|
||||
$('#'+'delete-category-id').val($(this).data('id'));
|
||||
});
|
||||
$('a.product-delete').click(function(ev) {
|
||||
$('#delete_product_id').val($(this).data('id'));
|
||||
});
|
||||
|
||||
// Toggle category visibility
|
||||
$(".categoryVisibleToggle").change(function() {
|
||||
$.ajax({
|
||||
url : "{url path='admin/catalog/category'}",
|
||||
data : {
|
||||
category_id : $(this).data('id'),
|
||||
action : 'visibilityToggle'
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
{* Inline editing of object position using bootstrap-editable *}
|
||||
{* Toggle object visibility *}
|
||||
|
||||
$('.categoryPositionChange').editable({
|
||||
type : 'text',
|
||||
title : '{intl l="Enter new category position"}',
|
||||
mode : 'popup',
|
||||
inputclass : 'input-mini',
|
||||
placement : 'left',
|
||||
success : function(response, newValue) {
|
||||
// The URL template
|
||||
var url = "{url path='admin/catalog/category' action='changePosition' category_id='__ID__' position='__POS__'}";
|
||||
$(".categoryVisibleToggle").click(function() {
|
||||
$.ajax({
|
||||
url : "{url path='admin/categories/toggle-online'}",
|
||||
data : {
|
||||
category_id : $(this).data('id'),
|
||||
action : 'visibilityToggle'
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Perform subtitutions
|
||||
url = url.replace('__ID__', $(this).data('id'))
|
||||
.replace('__POS__', newValue);
|
||||
$(".productVisibleToggle").click(function() {
|
||||
$.ajax({
|
||||
url : "{url path='admin/products/toggle-online'}",
|
||||
data : {
|
||||
category_id : $(this).data('id'),
|
||||
action : 'visibilityToggle'
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Reload the page
|
||||
location.href = url;
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
{* Inline editing of object position using bootstrap-editable *}
|
||||
|
||||
$('.categoryPositionChange').editable({
|
||||
type : 'text',
|
||||
title : '{intl l="Enter new category position"}',
|
||||
mode : 'popup',
|
||||
inputclass : 'input-mini',
|
||||
placement : 'left',
|
||||
success : function(response, newValue) {
|
||||
// The URL template
|
||||
var url = "{url path='/admin/categories/update-position' category_id='__ID__' position='__POS__'}";
|
||||
|
||||
// Perform subtitutions
|
||||
url = url.replace('__ID__', $(this).data('id'))
|
||||
.replace('__POS__', newValue);
|
||||
|
||||
// Reload the page
|
||||
location.href = url;
|
||||
}
|
||||
});
|
||||
|
||||
$('.productPositionChange').editable({
|
||||
type : 'text',
|
||||
title : '{intl l="Enter new product position"}',
|
||||
mode : 'popup',
|
||||
inputclass : 'input-mini',
|
||||
placement : 'left',
|
||||
success : function(response, newValue) {
|
||||
// The URL template
|
||||
var url = "{url path='/admin/products/update-position' product_id='__ID__' position='__POS__'}";
|
||||
|
||||
// Perform subtitutions
|
||||
url = url.replace('__ID__', $(this).data('id'))
|
||||
.replace('__POS__', newValue);
|
||||
|
||||
// Reload the page
|
||||
location.href = url;
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
</script>
|
||||
{/block}
|
||||
@@ -7,9 +7,8 @@
|
||||
{block name="main-content"}
|
||||
<div class="catalog edit-category">
|
||||
<div id="wrapper" class="container">
|
||||
<ul class="breadcrumb">
|
||||
{include file="includes/category_breadcrumb.html"}
|
||||
</ul>
|
||||
|
||||
{include file="includes/catalog-breadcrumb.html"}
|
||||
|
||||
<div class="row">
|
||||
{loop name="category_edit" type="category" visible="*" id="{$current_category_id}" backend_context="1" lang="$edit_language_id"}
|
||||
@@ -27,6 +26,7 @@
|
||||
</div>
|
||||
|
||||
<form method="post">
|
||||
|
||||
<div class="tabbable">
|
||||
<ul class="nav nav-tabs admin-tabs" id="tabbed_menu">
|
||||
<li class="active">
|
||||
41
templates/admin/default/coupon-create.html
Executable file
41
templates/admin/default/coupon-create.html
Executable file
@@ -0,0 +1,41 @@
|
||||
{extends file="admin-layout.tpl"}
|
||||
{block name="check-permissions"}admin.coupon.create{/block}
|
||||
{block name="page-title"}{intl l='Create coupon'}{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<section id="wrapper" class="container">
|
||||
|
||||
<nav>
|
||||
<ul class="breadcrumb">
|
||||
{include file="includes/coupon_breadcrumb.html"}
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<div class="page-header">
|
||||
<h1>Coupons : <small>Add a coupon</small></h1>
|
||||
</div>
|
||||
|
||||
{form name="thelia.admin.coupon.creation"}
|
||||
{include file='coupon/form.html' formAction={url path={$formAction}}}
|
||||
{/form}
|
||||
|
||||
</section> <!-- #wrapper -->
|
||||
|
||||
{include file='includes/confirmation-modal.html'}
|
||||
{/block}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
{javascripts file='assets/bootstrap-datepicker/js/bootstrap-datepicker.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='assets/js/main.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
<script>
|
||||
$(function($){
|
||||
miniBrowser(0, '/test_to_remove/datas_coupon_edit.json');
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
173
templates/admin/default/coupon-list.html
Executable file
173
templates/admin/default/coupon-list.html
Executable file
@@ -0,0 +1,173 @@
|
||||
{extends file="admin-layout.tpl"}
|
||||
{block name="check-permissions"}admin.coupon.view{/block}
|
||||
{block name="page-title"}{intl l='Coupons'}{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<section id="wrapper" class="container">
|
||||
|
||||
<nav>
|
||||
<ul class="breadcrumb">
|
||||
{include file="includes/coupon_breadcrumb.html"}
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<div class="page-header">
|
||||
<h1>Coupons : <small>List of coupons</small></h1>
|
||||
</div>
|
||||
|
||||
<section class="row">
|
||||
<div class="col-md-12 general-block-decorator">
|
||||
<table class="table table-striped tablesorter">
|
||||
<caption>
|
||||
List of enabled coupons
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Code</th>
|
||||
<th>Title</th>
|
||||
<th>Expiration date</th>
|
||||
<th>Usage left</th>
|
||||
<th class="sorter-false filter-false">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><a href="#">XMAS13</a></td>
|
||||
<td>Coupon for XMAS -30 €</td>
|
||||
<td>18/10/2013</td>
|
||||
<td>49</td>
|
||||
<td>
|
||||
<a href="#url" class="btn btn-default btn-primary btn-medium"><span class="glyphicon glyphicon-edit"></span> Edit</a>
|
||||
<a href="#url" class="btn btn-default btn-danger btn-medium" data-toggle="confirm" data-target="#disable"><span class="glyphicon glyphicon-off"></span> Disable</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="#">XMAS13</a></td>
|
||||
<td>Coupon for XMAS -30 €</td>
|
||||
<td>05/09/2013</td>
|
||||
<td>20</td>
|
||||
<td>
|
||||
<a href="#url" class="btn btn-default btn-primary btn-medium"><span class="glyphicon glyphicon-edit"></span> Edit</a>
|
||||
<a href="#url" class="btn btn-default btn-danger btn-medium" data-toggle="confirm" data-target="#disable"><span class="glyphicon glyphicon-off"></span> Disable</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="#">XMAS13</a></td>
|
||||
<td>Coupon for XMAS -30 €</td>
|
||||
<td>03/12/2013</td>
|
||||
<td>9</td>
|
||||
<td>
|
||||
<a href="#url" class="btn btn-default btn-primary btn-medium"><span class="glyphicon glyphicon-edit"></span> Edit</a>
|
||||
<a href="#url" class="btn btn-default btn-danger btn-medium" data-toggle="confirm" data-target="#disable"><span class="glyphicon glyphicon-off"></span> Disable</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="#">XMAS13</a></td>
|
||||
<td>Coupon for XMAS -30 €</td>
|
||||
<td>25/01/2013</td>
|
||||
<td>4</td>
|
||||
<td>
|
||||
<a href="#url" class="btn btn-default btn-primary btn-medium"><span class="glyphicon glyphicon-edit"></span> Edit</a>
|
||||
<a href="#url" class="btn btn-default btn-danger btn-medium" data-toggle="confirm" data-target="#disable"><span class="glyphicon glyphicon-off"></span> Disable</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="row">
|
||||
<div class="col-md-12 general-block-decorator">
|
||||
<table class="table table-striped tablesorter">
|
||||
<caption>
|
||||
List of disabled coupons
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Code</th>
|
||||
<th>Title</th>
|
||||
<th>Expiration date</th>
|
||||
<th>Usage left</th>
|
||||
<th class="sorter-false filter-false">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>XMAS13</td>
|
||||
<td>Coupon for XMAS -30 €</td>
|
||||
<td>18/10/2013</td>
|
||||
<td>49</td>
|
||||
<td>
|
||||
<a href="#url" class="btn btn-default btn-primary btn-medium"><span class="glyphicon glyphicon-edit"></span> Edit</a>
|
||||
<a href="#url" class="btn btn-default btn-success btn-medium" data-toggle="confirm" data-target="#enable"><span class="glyphicon glyphicon-ok"></span> Enabled</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>XMAS13</td>
|
||||
<td>Coupon for XMAS -20 €</td>
|
||||
<td>05/09/2013</td>
|
||||
<td>49</td>
|
||||
<td>
|
||||
<a href="#url" class="btn btn-default btn-primary btn-medium"><span class="glyphicon glyphicon-edit"></span> Edit</a>
|
||||
<a href="#url" class="btn btn-default btn-success btn-medium" data-toggle="confirm" data-target="#enable"><span class="glyphicon glyphicon-ok"></span> Enabled</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>XMAS13</td>
|
||||
<td>Coupon for XMAS -50 €</td>
|
||||
<td>03/12/2013</td>
|
||||
<td>49</td>
|
||||
<td>
|
||||
<a href="#url" class="btn btn-default btn-primary btn-medium"><span class="glyphicon glyphicon-edit"></span> Edit</a>
|
||||
<a href="#url" class="btn btn-default btn-success btn-medium" data-toggle="confirm" data-target="#enable"><span class="glyphicon glyphicon-ok"></span> Enabled</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>XMAS13</td>
|
||||
<td>Coupon for XMAS -5 €</td>
|
||||
<td>25/01/2013</td>
|
||||
<td>49</td>
|
||||
<td>
|
||||
<a href="#url" class="btn btn-default btn-primary btn-medium"><span class="glyphicon glyphicon-edit"></span> Edit</a>
|
||||
<a href="#url" class="btn btn-default btn-success btn-medium" data-toggle="confirm" data-target="#enable"><span class="glyphicon glyphicon-ok"></span> Enabled</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</section> <!-- #wrapper -->
|
||||
|
||||
{include file='includes/confirmation-modal.html' id="disable" message="{intl l='Do you really want to disable this element ?'}"}
|
||||
{include file='includes/confirmation-modal.html' id="enable" message="{intl l='Do you really want to enable this element ?'}"}
|
||||
|
||||
{/block}
|
||||
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
|
||||
{javascripts file='assets/bootstrap-editable/js/bootstrap-editable.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='assets/js/tablesorter/jquery.tablesorter.min.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='assets/js/tablesorter/jquery.metadata.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='assets/js/tablesorter/jquery.tablesorter.widgets.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='assets/js/tablesorter/jquery.tablesorter.widgets-filter-formatter.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='assets/js/main.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
{/block}
|
||||
127
templates/admin/default/coupon-read.html
Executable file
127
templates/admin/default/coupon-read.html
Executable file
@@ -0,0 +1,127 @@
|
||||
{extends file="admin-layout.tpl"}
|
||||
{block name="check-permissions"}admin.coupon.view{/block}
|
||||
{block name="page-title"}{intl l='Coupon'}{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<section id="wrapper" class="container">
|
||||
|
||||
<nav>
|
||||
<ul class="breadcrumb">
|
||||
{include file="includes/coupon_breadcrumb.html"}
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<div class="page-header">
|
||||
<h1>Coupons : <small>Read coupon n°1</small></h1>
|
||||
</div>
|
||||
|
||||
|
||||
<section class="row">
|
||||
<div class="col-md-12 general-block-decorator">
|
||||
{loop type="coupon" name="read_coupon" id=1 backend_context="true"}
|
||||
<div class="alert alert-info">
|
||||
<span class="glyphicon glyphicon-question-sign"></span>
|
||||
{if #IS_ENABLED}{else}This coupon is disabled, you can enable to the bottom of this form.{/if}
|
||||
</div>
|
||||
|
||||
<table class="table table-striped">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Code</td>
|
||||
<td>#CODE</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Title</td>
|
||||
<td>#TITLE</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Expiration date</td>
|
||||
<td>EXPIRATION_DATE</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Usage left</td>
|
||||
<td>
|
||||
{if #USAGE_LEFT}
|
||||
<span class="label label-success">
|
||||
#USAGE_LEFT
|
||||
</span>
|
||||
{else}
|
||||
<span class="label label-important">
|
||||
0
|
||||
</span>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">#SHORT_DESCRIPTION</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">#DESCRIPTION</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
{if #IS_CUMULATIVE}
|
||||
<span class="label label-success">
|
||||
{intl l="May be cumulative"}
|
||||
</span>
|
||||
{else}
|
||||
<span class="label label-important">
|
||||
{intl l="Can't be cumulative"}
|
||||
</span>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
{if #IS_REMOVING_POSTAGE}
|
||||
<span class="label label-important">
|
||||
{intl l="Will remove postage"}
|
||||
</span>
|
||||
{else}
|
||||
<span class="label label-success">
|
||||
{intl l="Won't remove postage"}
|
||||
</span>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Amount</td>
|
||||
<td>#AMOUNT</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Conditions of application</td>
|
||||
<td>
|
||||
<ul class="list-unstyled">
|
||||
<li>Total cart supperior to 400 €</li>
|
||||
<li><span class="label label-info">OR</span></li>
|
||||
<li>At least 4 products</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Actions</td>
|
||||
<td>
|
||||
<a href="#url" class="btn btn-default btn-primary btn-medium"><span class="icon-edit icon-white"></span> Edit</a>
|
||||
<a href="#url" class="btn btn-default btn-success btn-medium" data-toggle="confirm" data-target="#enable"><span class="glyphicon glyphicon-ok"></span> Enabled</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{/loop}
|
||||
</div>
|
||||
</section>
|
||||
</section> <!-- #wrapper -->
|
||||
|
||||
{include file='includes/confirmation-modal.html' id="enable" message="{intl l='Do you really want to enable this element ?'}"}
|
||||
|
||||
{/block}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
{javascripts file='assets/js/main.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='assets/bootstrap-editable/js/bootstrap-editable.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
{/block}
|
||||
70
templates/admin/default/coupon-update.html
Executable file
70
templates/admin/default/coupon-update.html
Executable file
@@ -0,0 +1,70 @@
|
||||
{extends file="admin-layout.tpl"}
|
||||
{block name="check-permissions"}admin.coupon.update{/block}
|
||||
{block name="page-title"}{intl l='Update coupon'}{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<section id="wrapper" class="container">
|
||||
|
||||
<nav>
|
||||
<ul class="breadcrumb">
|
||||
{include file="includes/coupon_breadcrumb.html"}
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<div class="page-header">
|
||||
<h1>Coupons : <small>Update a coupon</small></h1>
|
||||
</div>
|
||||
|
||||
{form name="thelia.admin.coupon.creation"}
|
||||
{include file='coupon/form.html' formAction={url path={$formAction}} form=$form}
|
||||
{/form}
|
||||
|
||||
</section> <!-- #wrapper -->
|
||||
{/block}
|
||||
|
||||
{include file='includes/confirmation-modal.html'}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
{javascripts file='assets/bootstrap-datepicker/js/bootstrap-datepicker.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='assets/js/main.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
<script>
|
||||
$(function($){
|
||||
miniBrowser(0, '/test_to_remove/datas_coupon_edit.json');
|
||||
|
||||
$('#effect').on('change', function (e) {
|
||||
var optionSelected = $("option:selected", this);
|
||||
$('#effectToolTip').html(optionSelected.attr("data-description"));
|
||||
});
|
||||
|
||||
$('#category-rule').on('change', function (e) {
|
||||
$('#rule-add-operators-values').html('<div class="loading" ></div>');
|
||||
var url = "{$urlAjaxGetRuleInput}";
|
||||
url = url.replace('ruleId', $(this).val())
|
||||
console.log(url);
|
||||
$.ajax({
|
||||
url: url,
|
||||
statusCode: {
|
||||
404: function() {
|
||||
$('#rule-add-operators-values').html(
|
||||
'{intl l='Please select another rule'}'
|
||||
);
|
||||
}
|
||||
}
|
||||
}).done(function(data) {
|
||||
$('#rule-add-operators-values').html(data);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
{/block}
|
||||
290
templates/admin/default/coupon/form.html
Normal file
290
templates/admin/default/coupon/form.html
Normal file
@@ -0,0 +1,290 @@
|
||||
{$thelia_page_css_file = "assets/bootstrap-editable/css/bootstrap-editable.css"}
|
||||
{include file='includes/notifications.html' message=$general_error}
|
||||
<form action="{$formAction}" {form_enctype form=$form} method="POST" >
|
||||
<section class="row">
|
||||
<div class="col-md-12 general-block-decorator">
|
||||
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
{form_field form=$form field='locale'}
|
||||
<input type="hidden" name="{$name}" value="{if $value}{$value}{else}{$edit_language_locale}{/if}" />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='success_url'}
|
||||
<input type="hidden" name="{$name}" value="{url path='/admin/coupon/read/{id}'}" />
|
||||
{/form_field}
|
||||
|
||||
<div class="span4">
|
||||
<div class="control-group">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="code">{intl l='Code :'}</label>
|
||||
{form_field form=$form field='code'}
|
||||
<input id="code" class="form-control" type="text" name="{$name}" value="{$value}" placeholder="{intl l='code'}">
|
||||
{if $error}{$message}{/if}
|
||||
{/form_field}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="title">{intl l='Title :'}</label>
|
||||
{form_field form=$form field='title'}
|
||||
<input id="title" class="form-control" type="text" name="{$name}" value="{$value}" placeholder="{intl l='title'}">
|
||||
{if $error}{$message}{/if}
|
||||
{/form_field}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="enabled" class="checkbox">
|
||||
{form_field form=$form field='isEnabled'}
|
||||
<input id="enabled" type="checkbox" name="{$name}" {if $value}value="1" checked{else}value="0"{/if} >
|
||||
{if $error}{$message}{/if}
|
||||
{/form_field}
|
||||
{intl l='Is enabled ?'}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="available-on-special-offers" class="checkbox">
|
||||
{form_field form=$form field='isAvailableOnSpecialOffers'}
|
||||
<input id="available-on-special-offers" type="checkbox" name="{$name}" {if $value}value="1" checked{else}value="0"{/if} >
|
||||
{if $error}{$message}{/if}
|
||||
{/form_field}
|
||||
{intl l='Is available on special offers ?'}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="cumulative" class="checkbox">
|
||||
{form_field form=$form field='isCumulative'}
|
||||
<input id="cumulative" type="checkbox" name="{$name}" {if $value}value="1" checked{else}value="0"{/if} >
|
||||
{if $error}{$message}{/if}
|
||||
{/form_field}
|
||||
{intl l='Is cumulative ?'}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="renoving-postage" class="checkbox">
|
||||
{form_field form=$form field='isRemovingPostage'}
|
||||
<input id="renoving-postage" type="checkbox" name="{$name}" {if $value}value="1" checked{else}value="0"{/if} >
|
||||
{if $error}{$message}{/if}
|
||||
{/form_field}
|
||||
{intl l='Is removing postage ?'}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="expiration-date">{intl l='Expiration date :'}</label>
|
||||
<div class="input-append date" data-date="12/02/2012" data-date-format="dd/mm/yyyy">
|
||||
{form_field form=$form field='expirationDate'}
|
||||
<input type="text" id="expiration-date" name="{$name}" value="{if $defaultDate}{$defaultDate}{else}{$value}{/if}">
|
||||
{if $error}{$message}{/if}
|
||||
{/form_field}
|
||||
<span class="add-on"><span class="icon-th"></span></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="max-usage">{intl l='Max usage :'}</label>
|
||||
<label for="is-unlimited" class="checkbox">
|
||||
<input id="is-unlimited" type="checkbox" name="is-unlimited" checked >
|
||||
{intl l='Is unlimited ?'}
|
||||
</label>
|
||||
{form_field form=$form field='maxUsage'}
|
||||
<input id="max-usage" type="text" class="form-control" name="{$name}" value="{$value}" placeholder="{intl l='max usage'}">
|
||||
{if $error}{$message}{/if}
|
||||
{/form_field}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
<div class="well clearfix">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="effect">{intl l='Effect :'}</label>
|
||||
{form_field form=$form field='effect'}
|
||||
<select name="{$name}" value="{$value}" id="effect" class="col-md-12 form-control">
|
||||
{foreach from=$availableCoupons item=availableCoupon}
|
||||
<option value="{$availableCoupon.serviceId}" data-description="{$availableCoupon.toolTip}">{$availableCoupon.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
{if $error}{$message}{/if}
|
||||
{/form_field}
|
||||
<span id="effectToolTip" class="help-block">{$availableCoupons.0.toolTip}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="amount">{intl l='Amount :'}</label>
|
||||
{form_field form=$form field='amount'}
|
||||
<input id="amount" type="text" class="form-control" name="{$name}" value="{$value}" placeholder="{intl l='14.50'}">
|
||||
{if $error}{$message}{/if}
|
||||
{/form_field}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="category">Category :</label>
|
||||
{*form_field form=$form field='category'*}
|
||||
<select name="{$name}" value="{$value}" id="category" class="form-control">
|
||||
<option value="1">Category 1</option>
|
||||
<option value="1">Category 2</option>
|
||||
<option value="1">Category 3</option>
|
||||
</select>
|
||||
{*if $error}{$message}{/if}*}
|
||||
{*/form_field*}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="short-description">{intl l='Short description :'}</label>
|
||||
{form_field form=$form field='shortDescription'}
|
||||
<textarea id="short-description" name="{$name}" placeholder="{intl l='short description'}" class="span12" rows="5">{$value nofilter}</textarea>
|
||||
{if $error}{$message}{/if}
|
||||
{/form_field}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="description">{intl l='Long description :'}</label>
|
||||
{form_field form=$form field='description'}
|
||||
<textarea id="description" name="{$name}" placeholder="{intl l='long description'}" class="form-control wysiwyg" rows="10">{$value nofilter}</textarea>
|
||||
{if $error}{$message}{/if}
|
||||
{/form_field}
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-default btn-primary">{intl l='Save'}</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="row">
|
||||
<div class="col-md-12 general-block-decorator">
|
||||
<table class="table table-striped">
|
||||
<caption class="clearfix">
|
||||
{intl l='Rules'}
|
||||
<a class="btn btn-default btn-primary pull-right" title="{intl l='Add a new rule'}">
|
||||
<span class="glyphicon glyphicon-plus-sign"></span>
|
||||
</a>
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{intl l='Conditions'}</th>
|
||||
<th>{intl l='Actions'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach from=$rulesObject item=rule}
|
||||
<tr>
|
||||
<td>{$rule.tooltip}</td>
|
||||
<td>
|
||||
<a href="#url" class="btn btn-default btn-primary btn-medium"><span class="glyphicon glyphicon-edit"></span> {intl l='Edit'}</a>
|
||||
<a href="#url" class="btn btn-default btn-danger btn-medium" data-toggle="confirm" data-target="#delete"><span class="glyphicon glyphicon-remove"></span> {intl l='Delete'}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="row">
|
||||
<div class="col-md-12 general-block-decorator clearfix">
|
||||
<a title="{intl l='Save this rule'}" class="btn btn-default btn-primary pull-right">
|
||||
<span class="glyphicon glyphicon-plus-sign"></span>
|
||||
</a>
|
||||
|
||||
<div id="rule-add-organizer" class="form-group col-md-2">
|
||||
<label for="type">{intl l='Condition type :'}</label>
|
||||
<label class="radio">
|
||||
<input type="radio" name="type" id="type" value="1" checked> {intl l='And'}
|
||||
</label>
|
||||
<label class="radio">
|
||||
<input type="radio" name="type" value="2"> {intl l='Or'}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div id="rule-add-type" class="form-group col-md-4">
|
||||
<label for="categoryRule">{intl l='Rule\'s category :'}</label>
|
||||
<select name="categoryRule" id="category-rule" class="form-control">
|
||||
{foreach from=$availableRules item=availableRule}
|
||||
<option value="{$availableRule.serviceId}" data-description="{$availableRule.toolTip}">{$availableRule.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="rule-add-operators-values" class="form-group col-md-6">
|
||||
<label for="operator">{intl l='Operator :'}</label>
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<select name="operator" id="operator" class="form-control">
|
||||
<option value="1">is superior to</option>
|
||||
<option value="2">equals to</option>
|
||||
<option value="3">is inferior to</option>
|
||||
<option value="4">is inferior or equals to</option>
|
||||
<option value="5">is superior or equals to</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group col-lg-6">
|
||||
<input type="text" name="value" class="form-control">
|
||||
<span class="input-group-addon">€</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<label for="operator">Operator :</label>
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<select name="operator" id="operator" class="form-control">
|
||||
<option value="1">is superior to</option>
|
||||
<option value="2">equals to</option>
|
||||
<option value="3">is inferior to</option>
|
||||
<option value="4">is inferior or equals to</option>
|
||||
<option value="5">is superior or equals to</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group col-lg-6 date" data-date="12/02/2012" data-date-format="dd/mm/yyyy">
|
||||
<input type="text" name="value" class="form-control">
|
||||
<span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label for="operator">Operator :</label>
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<select name="operator" id="operator" class="form-control">
|
||||
<option value="1">is superior to</option>
|
||||
<option value="2">equals to</option>
|
||||
<option value="3">is inferior to</option>
|
||||
<option value="4">is inferior or equals to</option>
|
||||
<option value="5">is superior or equals to</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<input type="text" name="value" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td id="minibrowser-breadcrumb"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="icon-th-list"></span> Categories list</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="minibrowser-categories"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
||||
|
||||
74
templates/admin/default/coupon/rule-input-ajax.html
Normal file
74
templates/admin/default/coupon/rule-input-ajax.html
Normal file
@@ -0,0 +1,74 @@
|
||||
{*test*}
|
||||
{*{$ruleId}*}
|
||||
{*{$inputs|var_dump}*}
|
||||
|
||||
{foreach from=$inputs key=name item=input}
|
||||
<label for="operator">{$input.title}</label>
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<select class="form-control" id="{$name}[operator]" name="{$name}[operator]">
|
||||
{foreach from=$input.availableOperators key=k item=availableOperator}
|
||||
<option value="{$availableOperator}">{$availableOperator}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group col-lg-6">
|
||||
{if $input.type == 'select'}
|
||||
<select class="{$input.class}" id="{$name}[value]" name="{$name}[value]">
|
||||
{foreach from=$input.availableValues key=code item=availableValue}
|
||||
<option value="{$code}">{$availableValue}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
{else}
|
||||
<input type="{$input.type}" class="{$input.class}" id="{$name}[value]" name="{$name}[value]">
|
||||
{*<span class="input-group-addon">€</span>*}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
{*<label for="operator">Operator :</label>*}
|
||||
{*<div class="row">*}
|
||||
{*<div class="col-lg-6">*}
|
||||
{*<select class="form-control" id="operator" name="operator">*}
|
||||
{*<option value="1">is superior to</option>*}
|
||||
{*<option value="2">equals to</option>*}
|
||||
{*<option value="3">is inferior to</option>*}
|
||||
{*<option value="4">is inferior or equals to</option>*}
|
||||
{*<option value="5">is superior or equals to</option>*}
|
||||
{*</select>*}
|
||||
{*</div>*}
|
||||
{*<div data-date-format="dd/mm/yyyy" data-date="12/02/2012" class="input-group col-lg-6 date">*}
|
||||
{*<input type="text" class="form-control" name="value">*}
|
||||
{*<span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>*}
|
||||
{*</div>*}
|
||||
{*</div>*}
|
||||
{*<label for="operator">Operator :</label>*}
|
||||
{*<div class="row">*}
|
||||
{*<div class="col-lg-6">*}
|
||||
{*<select class="form-control" id="operator" name="operator">*}
|
||||
{*<option value="1">is superior to</option>*}
|
||||
{*<option value="2">equals to</option>*}
|
||||
{*<option value="3">is inferior to</option>*}
|
||||
{*<option value="4">is inferior or equals to</option>*}
|
||||
{*<option value="5">is superior or equals to</option>*}
|
||||
{*</select>*}
|
||||
{*</div>*}
|
||||
{*<div class="col-lg-6">*}
|
||||
{*<input type="text" class="form-control" name="value">*}
|
||||
{*</div>*}
|
||||
{*</div>*}
|
||||
{*<div class="row">*}
|
||||
{*<div class="col-lg-12">*}
|
||||
{*<table class="table table-bordered">*}
|
||||
{*<tbody><tr>*}
|
||||
{*<td id="minibrowser-breadcrumb"><div><span> > </span><a href="#">Racine</a></div></td>*}
|
||||
{*</tr>*}
|
||||
{*<tr>*}
|
||||
{*<th><span class="icon-th-list"></span> Categories list</th>*}
|
||||
{*</tr>*}
|
||||
{*<tr>*}
|
||||
{*<td id="minibrowser-categories"><div><p><a href="#">Boyaux</a></p><p><a href="#">Epices / condiments</a></p><p><a href="#">Emballage</a></p><p><a href="#">Petits matériels</a></p><p><a href="#">Materiel de cuisine</a></p><p><a href="#">Bacs</a></p><p><a href="#">Hygiène & entretien</a></p><p><a href="#">Art de la table</a></p><p><a href="#">Matériels</a></p></div></td>*}
|
||||
{*</tr>*}
|
||||
{*</tbody></table>*}
|
||||
{*</div>*}
|
||||
{*</div>*}
|
||||
@@ -30,7 +30,7 @@
|
||||
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.currencies.create"}
|
||||
<span class="pull-right">
|
||||
<button class="btn btn-default btn-info" title="{intl l='Update rates'}">{intl l='Update rates'} <span class="glyphicon glyphicon-globe"></span></button>
|
||||
<a class="btn btn-default btn-primary" title="{intl l='Add a new currency'}" href="#add_currency_dialog" data-toggle="modal">
|
||||
<a class="btn btn-default btn-primary" title="{intl l='Add a new currency'}" href="#creation_dialog" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-plus-sign"></span>
|
||||
</a>
|
||||
</span>
|
||||
@@ -122,7 +122,7 @@
|
||||
|
||||
<td>
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.currencies.change"}
|
||||
<a title="{intl l='Change this currency'}" href="{url path='/admin/configuration/currencies/update' currency_id="$ID"}">{$NAME}</a>
|
||||
<a title="{intl l='Change this currency'}" href="{url path='/admin/configuration/currencies/update' currency_id=$ID}">{$NAME}</a>
|
||||
{/loop}
|
||||
{elseloop rel="can_change"}
|
||||
{$NAME}
|
||||
@@ -163,7 +163,7 @@
|
||||
{/loop}
|
||||
|
||||
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.configuration.currencies.delete"}
|
||||
<a class="btn btn-default btn-xs currency-delete" title="{intl l='Delete this currency'}" href="#delete_currency_dialog" data-id="{$ID}" data-toggle="modal">
|
||||
<a class="btn btn-default btn-xs currency-delete" title="{intl l='Delete this currency'}" href="#delete_dialog" data-id="{$ID}" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-trash"></span>
|
||||
</a>
|
||||
{/loop}
|
||||
@@ -199,116 +199,96 @@
|
||||
|
||||
{* Adding a new currency *}
|
||||
|
||||
<div class="modal fade" id="add_currency_dialog" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
{form name="thelia.admin.currency.creation"}
|
||||
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
{* Capture the dialog body, to pass it to the generic dialog *}
|
||||
{capture "creation_dialog"}
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>{intl l="Create a new currency"}</h3>
|
||||
</div>
|
||||
{form_field form=$form field='success_url'}
|
||||
{* on success, redirect to the edition page, _ID_ is replaced with the created currency ID, see controller *}
|
||||
<input type="hidden" name="{$name}" value="{url path='/admin/configuration/currencies/update' currency_id='_ID_'}" />
|
||||
{/form_field}
|
||||
|
||||
{form name="thelia.admin.currency.creation"}
|
||||
<form method="POST" action="{url path='/admin/configuration/currencies/create'}" {form_enctype form=$form}>
|
||||
{form_field form=$form field='name'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
|
||||
{form_hidden_fields form=$form}
|
||||
{loop type="lang" name="default-lang" default_only="1"}
|
||||
<div class="input-group">
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='Currency name'}" placeholder="{intl l='Name'}">
|
||||
<span class="input-group-addon"><img src="{image file="assets/img/flags/{$CODE}.gif"}" alt="{intl l=$TITLE}" /></span>
|
||||
</div>
|
||||
|
||||
{form_field form=$form field='success_url'}
|
||||
{* on success, redirect to the edition page, _ID_ is replaced with the created currency ID, see controller *}
|
||||
<input type="hidden" name="{$name}" value="{url path='/admin/configuration/currencies/update' currency_id='_ID_'}" />
|
||||
{/form_field}
|
||||
<div class="help-block">{intl l="Enter here the currency name in the default language ($TITLE)"}</div>
|
||||
|
||||
<div class="modal-body">
|
||||
{* Switch edition to the current locale *}
|
||||
<input type="hidden" name="edit_language_id" value="{$ID}" />
|
||||
|
||||
{if $form_error}<div class="alert alert-block alert-error" id="add_currency_dialog_error">{$form_error_message}</div>{/if}
|
||||
{form_field form=$form field='locale'}
|
||||
<input type="hidden" name="{$name}" value="{$LOCALE}" />
|
||||
{/form_field}
|
||||
{/loop}
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='name'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
{form_field form=$form field='code'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='ISO 4217 code'}" placeholder="{intl l='Code'}">
|
||||
<span class="help-block"><a href="http://fr.wikipedia.org/wiki/ISO_4217" target="_blank">{intl l='More information about ISO 4217'}</a></span>
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{loop type="lang" name="default-lang" default_only="1"}
|
||||
<div class="input-group">
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='Currency name'}" placeholder="{intl l='Name'}">
|
||||
<span class="input-group-addon"><img src="{image file="assets/img/flags/{$CODE}.gif"}" alt="{intl l=$TITLE}" /></span>
|
||||
</div>
|
||||
{form_field form=$form field='symbol'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='Currency symbol'}" placeholder="{intl l='Symbol'}">
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
<div class="help-block">{intl l="Enter here the currency name in the default language ($TITLE)"}</div>
|
||||
{form_field form=$form field='rate'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='Currency rate'}" placeholder="{intl l='Rate'}">
|
||||
<span class="help-block">{intl l="The rate from Euro (Price in Euro * rate = Price in this currency)"}</span>
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{* Switch edition to the current locale *}
|
||||
<input type="hidden" name="edit_language_id" value="{$ID}" />
|
||||
{/capture}
|
||||
|
||||
{form_field form=$form field='locale'}
|
||||
<input type="hidden" name="{$name}" value="{$LOCALE}" />
|
||||
{/form_field}
|
||||
{/loop}
|
||||
</div>
|
||||
{/form_field}
|
||||
{include
|
||||
file = "includes/generic-create-dialog.html"
|
||||
|
||||
{form_field form=$form field='code'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='ISO 4217 code'}" placeholder="{intl l='Code'}">
|
||||
<span class="help-block"><a href="http://fr.wikipedia.org/wiki/ISO_4217" target="_blank">{intl l='More information about ISO 4217'}</a></span>
|
||||
</div>
|
||||
{/form_field}
|
||||
dialog_id = "creation_dialog"
|
||||
dialog_title = {intl l="Create a new currency"}
|
||||
dialog_body = {$smarty.capture.creation_dialog nofilter}
|
||||
|
||||
{form_field form=$form field='symbol'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='Currency symbol'}" placeholder="{intl l='Symbol'}">
|
||||
</div>
|
||||
{/form_field}
|
||||
dialog_ok_label = {intl l="Create this currency"}
|
||||
|
||||
{form_field form=$form field='rate'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{intl l='Currency rate'}" placeholder="{intl l='Rate'}">
|
||||
<span class="help-block">{intl l="The rate from Euro (Price in Euro * rate = Price in this currency)"}</span>
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span> {intl l="Create this currency"}</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove"></span> {intl l="Cancel"}</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
{/form}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
form_action = {url path='/admin/configuration/currencies/create'}
|
||||
form_enctype = {form_enctype form=$form}
|
||||
form_error_message = $form_error_message
|
||||
}
|
||||
{/form}
|
||||
|
||||
|
||||
{* Delete confirmation dialog *}
|
||||
|
||||
<div class="modal fade" id="delete_currency_dialog" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
{capture "delete_dialog"}
|
||||
<input type="hidden" name="currency_id" id="currency_delete_id" value="" />
|
||||
{/capture}
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>{intl l="Delete a currency"}</h3>
|
||||
</div>
|
||||
{include
|
||||
file = "includes/generic-confirm-dialog.html"
|
||||
|
||||
<div class="modal-body">
|
||||
<p>{intl l="Do you really want to delete this currency ?"}</p>
|
||||
</div>
|
||||
dialog_id = "delete_dialog"
|
||||
dialog_title = {intl l="Delete currency"}
|
||||
dialog_message = {intl l="Do you really want to delete this currency ?"}
|
||||
|
||||
<form method="post" action="{url path='/admin/configuration/currencies/delete'}">
|
||||
<input type="hidden" name="currency_id" id="currency_delete_id" value="" />
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span> {intl l="Yes"}</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove"></span> {intl l="No"}</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
form_action = {url path='/admin/configuration/currencies/delete'}
|
||||
form_content = {$smarty.capture.delete_dialog nofilter}
|
||||
}
|
||||
{/block}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
@@ -329,27 +309,12 @@
|
||||
$('#currency_delete_id').val($(this).data('id'));
|
||||
});
|
||||
|
||||
{* display the form creation dialog if it contains errors *}
|
||||
|
||||
{form name="thelia.admin.currency.creation"}
|
||||
{if #form_error}
|
||||
$('#add_currency_dialog').modal();
|
||||
{/if}
|
||||
{/form}
|
||||
|
||||
{* Always reset create dialog on close *}
|
||||
|
||||
$('#add_currency_dialog').on('hidden',function() {
|
||||
|
||||
// Hide error currency
|
||||
$('#add_currency_dialog_error').remove();
|
||||
|
||||
// Clear error status
|
||||
$("#add_currency_dialog .error").removeClass('error');
|
||||
|
||||
// Empty field values
|
||||
$("#add_currency_dialog input[type=text]").val('');
|
||||
});
|
||||
// JS stuff for creation form
|
||||
{include
|
||||
file = "includes/generic-js-dialog.html"
|
||||
dialog_id = "creation_dialog"
|
||||
form_name = "thelia.admin.currency.creation"
|
||||
}
|
||||
|
||||
{* Inline editing of object position using bootstrap-editable *}
|
||||
|
||||
|
||||
139
templates/admin/default/customers.html
Normal file
139
templates/admin/default/customers.html
Normal file
@@ -0,0 +1,139 @@
|
||||
|
||||
{extends file="admin-layout.tpl"}
|
||||
|
||||
{block name="page-title"}{intl l='Customer'}{/block}
|
||||
|
||||
{block name="check-permissions"}admin.customer.view{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
{assign var=customer_page value={$smarty.get.page|default:1}}
|
||||
|
||||
|
||||
<div class="catalog">
|
||||
<div id="wrapper" class="container">
|
||||
|
||||
|
||||
{module_include location='customer_top'}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="general-block-decorator">
|
||||
<table class="table table-striped table-condensed" id="customer_list">
|
||||
<caption>
|
||||
{intl l="Customers list"}
|
||||
|
||||
{module_include location='customer_list_caption'}
|
||||
|
||||
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.customers.create"}
|
||||
<a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new Customer'}" href="#add_customer_dialog" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-plus-sign"></span>
|
||||
</a>
|
||||
{/loop}
|
||||
</caption>
|
||||
|
||||
{ifloop rel="customer_list"}
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="object-title">
|
||||
{intl l="customer ref"}
|
||||
</th>
|
||||
|
||||
<th class="object-title">
|
||||
{intl l="company"}
|
||||
</th>
|
||||
|
||||
{module_include location='category_list_header'}
|
||||
|
||||
<th>
|
||||
{intl l="firstname & lastname"}
|
||||
</th>
|
||||
|
||||
<th>
|
||||
{intl l="last order"}
|
||||
</th>
|
||||
|
||||
<th>{intl l='order amount'}</th>
|
||||
|
||||
<th>{intl l='Actions'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{loop name="customer_list" type="customer" visible="*" last_order="1" backend_context="1" page={$customer_page} limit={$display_customer}}
|
||||
<tr>
|
||||
<td>{#REF}</td>
|
||||
|
||||
<td>
|
||||
{#COMPANY}
|
||||
</td>
|
||||
|
||||
<td class="object-title">
|
||||
{#FIRSTNAME} {#LASTNAME}
|
||||
</td>
|
||||
|
||||
{module_include location='customer_list_row'}
|
||||
|
||||
<td>
|
||||
{format_date date=$LASTORDER_DATE}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{format_number number=$LASTORDER_AMOUNT}
|
||||
</td>
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.customer.edit"}
|
||||
<a class="btn btn-default btn-xs" title="{intl l='Edit this customer'}" href="{url path="/admin/customer/update/{$ID}" }"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
{/loop}
|
||||
{loop type="auth" name="can_send_mail" roles="ADMIN" permissions="admin.customer.sendMail"}
|
||||
<a class="btn btn-default btn-xs" title="{intl l="Send a mail to this customer"}" href="mailto:{#EMAIL}"><span class="glyphicon glyphicon-envelope"></span></a>
|
||||
{/loop}
|
||||
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.customer.delete"}
|
||||
<a class="btn btn-default btn-xs customer-delete" title="{intl l='Delete this customer and all his orders'}" href="#delete_customer_dialog" data-id="{$ID}" data-toggle="modal"><i class="glyphicon glyphicon-trash"></i></a>
|
||||
{/loop}
|
||||
</div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
{/loop}
|
||||
</tbody>
|
||||
{/ifloop}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{module_include location='customer_bottom'}
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center">
|
||||
|
||||
<ul class="pagination pagination-centered">
|
||||
{if #customer_page != 1}
|
||||
<li><a href="{url path="/admin/customers" page="1"}">«</a></li>
|
||||
{else}
|
||||
<li class="disabled"><a href="#">«</a></li>
|
||||
{/if}
|
||||
|
||||
{pageloop rel="customer_list"}
|
||||
{if #PAGE != #CURRENT}
|
||||
<li><a href="{url path="/admin/customers" page="#PAGE"}">#PAGE</a></li>
|
||||
{else}
|
||||
<li class="active"><a href="#">#PAGE</a></li>
|
||||
{/if}
|
||||
|
||||
{if #PAGE == #LAST && #LAST != #CURRENT}
|
||||
<li><a href="{url path="/admin/customers" page="#PAGE"}">»</a></li>
|
||||
{else}
|
||||
<li class="disabled"><a href="#">»</a></li>
|
||||
{/if}
|
||||
{/pageloop}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/block}
|
||||
@@ -1,70 +0,0 @@
|
||||
|
||||
{* Adding a new Category *}
|
||||
|
||||
<div class="modal fade" id="add_category_dialog" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>{intl l="Create a new category"}</h3>
|
||||
</div>
|
||||
|
||||
{form name="thelia.admin.category.creation"}
|
||||
<form method="POST" action="{url path='/admin/catalog/category'}" {form_enctype form=$form}>
|
||||
|
||||
{* the action processed by the controller *}
|
||||
<input type="hidden" name="action" value="create" />
|
||||
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
{form_field form=$form field='parent'}
|
||||
<input type="hidden" name="{$name}" value="{$current_category_id}" />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='success_url'}
|
||||
{* on success, redirect to category change page. _ID_ is replaced with the ID of the created category (see Thelia\Action\Category.php) *}
|
||||
<input type="hidden" name="{$name}" value="{url path='admin/catalog/category' id="_ID_" action='edit'}" />
|
||||
{/form_field}
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
{if #form_error}<div class="alert alert-error" id="add_category_dialog_error">#form_error_message</div>{/if}
|
||||
|
||||
{form_field form=$form field='title'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
|
||||
{loop type="lang" name="default-lang" default_only="1"}
|
||||
|
||||
<div class="input-group">
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" value="{$value}" title="{intl l='Category title'}" placeholder="{intl l='Category title'}" class="form-control">
|
||||
<span class="input-group-addon"><img src="{image file="../assets/img/flags/{$CODE}.gif"}" alt="{intl l=$TITLE}" /></span>
|
||||
</div>
|
||||
|
||||
<div class="help-block">{intl l="Enter here the category title in the default language ($TITLE)"}</div>
|
||||
|
||||
{form_field form=$form field='locale'}
|
||||
<input type="hidden" name="{$name}" value="{$LOCALE}" />
|
||||
{/form_field}
|
||||
|
||||
{/loop}
|
||||
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove"></span> {intl l="Cancel"}</button>
|
||||
<button type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span> {intl l="Create this category"}</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
{/form}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
26
templates/admin/default/includes/catalog-breadcrumb.html
Normal file
26
templates/admin/default/includes/catalog-breadcrumb.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{* Breadcrumb for categories browsing and editing *}
|
||||
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="{url path='admin/home'}">Home</a></li>
|
||||
<li><a href="{url path='admin/catalog'}">Catalog</a>
|
||||
|
||||
{ifloop rel="category_path"}</li>
|
||||
{loop name="category_path" type="category-path" visible="*" category=$current_category_id}
|
||||
{if $ID == $current_category_id}
|
||||
<li class="active">
|
||||
{if $action == 'edit'}
|
||||
{intl l='Editing %cat' cat="{$TITLE}"}
|
||||
{else}
|
||||
{$TITLE} <a href="{url path='admin/catalog/category/edit' category_id=$ID}" title="{intl l='Edit this category'}">{intl l="(edit)"}</a>
|
||||
{/if}
|
||||
</li>
|
||||
{else}
|
||||
<li><a href="{url path='admin/catalog/category' id=" $ID" action='browse'}">{$TITLE}</a></li>
|
||||
{/if}
|
||||
{/loop}
|
||||
{/ifloop}
|
||||
|
||||
{elseloop rel="category_path"}
|
||||
</li>
|
||||
{/elseloop}
|
||||
</ul>
|
||||
@@ -1,13 +0,0 @@
|
||||
{* Breadcrumb for categories browsing and editing *}
|
||||
|
||||
<li><a href="{url path='admin/home'}">Home</a></li>
|
||||
<li><a href="{url path='admin/catalog'}">Catalog</a> {ifloop rel="category_path"}</li>
|
||||
|
||||
{loop name="category_path" type="category-path" visible="*" category="{$current_category_id}"} {if $ID == $current_category_id}
|
||||
<li class="active">{if $action == 'edit'} {intl l='Editing %cat' cat="{$TITLE}"} {else} {$TITLE} <a href="{url path='admin/catalog/category' id=" $ID" action='edit' }" title="{intl l='Edit this category'}">{intl l="(edit)"}</a> {/if}
|
||||
</li>
|
||||
{else}
|
||||
<li><a href="{url path='admin/catalog/category' id=" $ID" action='browse'}">{$TITLE}</a></li>
|
||||
{/if} {/loop} {/ifloop} {elseloop rel="category_path"}
|
||||
</li>
|
||||
{/elseloop}
|
||||
36
templates/admin/default/includes/confirmation-modal.html
Normal file
36
templates/admin/default/includes/confirmation-modal.html
Normal file
@@ -0,0 +1,36 @@
|
||||
{*
|
||||
Params
|
||||
- id : aside element id (default delete)
|
||||
- title : modal title (default Confirmation)
|
||||
- message : modal message (default Do you really want to delete this element ?)
|
||||
*}
|
||||
{block name="confirmation-modal"}
|
||||
<aside id="{if $id}{$id}{else}delete{/if}" class="modal fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3>
|
||||
{if $title}
|
||||
{$title}
|
||||
{else}
|
||||
{intl l='Confirmation'}
|
||||
{/if}
|
||||
</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
{if $message}
|
||||
{$message}
|
||||
{else}
|
||||
{intl l='Do you really want to delete this element ?'}
|
||||
{/if}
|
||||
</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-default" data-dismiss="modal">{intl l='Cancel'}</button>
|
||||
<a href="#" class="btn btn-default btn-success" data-confirm="confirm">{intl l='Confirm'}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</aside> <!-- #delete / Delete confirmation -->
|
||||
{/block}
|
||||
5
templates/admin/default/includes/coupon_breadcrumb.html
Executable file
5
templates/admin/default/includes/coupon_breadcrumb.html
Executable file
@@ -0,0 +1,5 @@
|
||||
{* Breadcrumb for coupon browsing and editing *}
|
||||
|
||||
<li><a href="{url path='admin/home'}">Home</a></li>
|
||||
<li><a href="{url path='admin/coupon'}">Coupon</a></li>
|
||||
<li><a href="{url path="admin/coupon/browse/$ID"}">Browse</a></li>
|
||||
@@ -1,48 +0,0 @@
|
||||
|
||||
{* Adding a new Category *}
|
||||
|
||||
<div class="modal fade" id="delete_category_dialog" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>{intl l="Delete a category"}</h3>
|
||||
</div>
|
||||
|
||||
{form name="thelia.admin.category.deletion"}
|
||||
<form method="POST" action="{url path='/admin/catalog/category'}" {form_enctype form=$form}>
|
||||
|
||||
{* the action processed by the controller *}
|
||||
<input type="hidden" name="action" value="delete" />
|
||||
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
{form_field form=$form field='category_id'}
|
||||
<input type="hidden" name="{$name}" id="delete-category-id" value="" />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='success_url'}
|
||||
{* on success, redirect to catalog. _ID_ is replaced with the ID of the deleted category parent id (see Thelia\Action\Category.php) *}
|
||||
<input type="hidden" name="{$name}" value="{url path='admin/catalog/category' id="_ID_" action='browse'}" />
|
||||
{/form_field}
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
{if #form_error}<div class="alert alert-block alert-error" id="add_category_dialog_error">#form_error_message</div>{/if}
|
||||
|
||||
<p>{intl l="Delete this category and all its contents ?"}</p>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove"></span> {intl l="No"}</button>
|
||||
<button type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span> {intl l="Yes"}</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
{/form}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
43
templates/admin/default/includes/generic-confirm-dialog.html
Normal file
43
templates/admin/default/includes/generic-confirm-dialog.html
Normal file
@@ -0,0 +1,43 @@
|
||||
{*
|
||||
|
||||
A generic modal confirmation dialog template.
|
||||
|
||||
Parameters:
|
||||
|
||||
dialog_id = the dialog id attribute
|
||||
dialog_title = the dialog title
|
||||
dialog_message = the dialog confirmation message
|
||||
|
||||
dialog_ok_label = The OK button label (default: yes)
|
||||
dialog_cancel_label = The Cancel button label (default: no)
|
||||
|
||||
form_action = the form action URL, subtitted by a click on OK button
|
||||
form_method = the form method, default "POST"
|
||||
form_content = the form content
|
||||
|
||||
*}
|
||||
<div class="modal fade" id="{$dialog_id}" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>{$dialog_title}</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{$dialog_message nofilter}
|
||||
</div>
|
||||
|
||||
<form method="{$form_method|default:POST}" action="{$form_action}">
|
||||
|
||||
{$form_content nofilter}
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove"></span> {$dialog_cancel_label|default:{intl l="No"}}</button>
|
||||
<button type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span> {$dialog_ok_label|default:{intl l="Yes"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
43
templates/admin/default/includes/generic-create-dialog.html
Executable file
43
templates/admin/default/includes/generic-create-dialog.html
Executable file
@@ -0,0 +1,43 @@
|
||||
{*
|
||||
|
||||
A generic modal creation dialog template. Parameters
|
||||
|
||||
dialog_id = the dialog id attribute
|
||||
dialog_title = the dialog title
|
||||
dialog_body = the dialog body. In most cases, this is a creation form
|
||||
|
||||
dialog_ok_label = The OK button label. Default create
|
||||
dialog_cancel_label = The cancel button label. Default create
|
||||
|
||||
form_action = The form action URL. Form is submitted when OK button is clicked
|
||||
form_enctype = The form encoding
|
||||
form_error_message = The form error message (optional)
|
||||
*}
|
||||
<div class="modal fade" id="{$dialog_id}" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>{$dialog_title nofilter}</h3>
|
||||
</div>
|
||||
|
||||
<form method="POST" action="{$form_action nofilter}" {$form_enctype nofilter}>
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
{if ! empty($form_error_message)}<div class="alert alert-block alert-error" id="{$dialog_id}_error">{$form_error_message nofilter}</div>{/if}
|
||||
|
||||
{$dialog_body nofilter}
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove"></span> {$dialog_cancel_label|default:{intl l='Cancel'}}</button>
|
||||
<button type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span> {$dialog_ok_label|default:{intl l='OK'}}</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
35
templates/admin/default/includes/generic-js-dialog.html
Normal file
35
templates/admin/default/includes/generic-js-dialog.html
Normal file
@@ -0,0 +1,35 @@
|
||||
{*
|
||||
Javascript code to manage create dialog. Insert it in your template, in the javascript
|
||||
initialisation:
|
||||
|
||||
$(function() {
|
||||
<insert me here>
|
||||
}
|
||||
|
||||
Parameters:
|
||||
$dialog_id = the dialog ID
|
||||
$form_name = the form name
|
||||
|
||||
*}
|
||||
|
||||
{* re-display the form creation dialog if it contains errors *}
|
||||
|
||||
{form name="{$form_name}"}
|
||||
{if #form_error}
|
||||
$('#{$dialog_id}').modal();
|
||||
{/if}
|
||||
{/form}
|
||||
|
||||
{* Always reset create dialog on close *}
|
||||
|
||||
$('#{$dialog_id}').on('hidden', function() {
|
||||
|
||||
// Hide error message
|
||||
$('#{$dialog_id}_error').remove();
|
||||
|
||||
// Clear error status
|
||||
$("#{$dialog_id} .error").removeClass('error');
|
||||
|
||||
// Empty field values
|
||||
$("#{$dialog_id} input[type=text]").val('');
|
||||
});
|
||||
11
templates/admin/default/includes/notifications.html
Normal file
11
templates/admin/default/includes/notifications.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{*
|
||||
Params
|
||||
- type : notification type (default alert)
|
||||
- message : modal message
|
||||
*}
|
||||
{if $message}
|
||||
<div class="{if $type}$type{else}alert alert-info{/if}">
|
||||
<span class="icon-question-sign"></span>
|
||||
{$message}
|
||||
</div>
|
||||
{/if}
|
||||
@@ -25,7 +25,7 @@
|
||||
<caption>
|
||||
{intl l='Thelia mailing templates'}
|
||||
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.messages.create"}
|
||||
<a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new mailing template'}" href="#add_message_dialog" data-toggle="modal">
|
||||
<a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new mailing template'}" href="#creation_dialog" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-plus-sign"></span>
|
||||
</a>
|
||||
{/loop}
|
||||
@@ -41,7 +41,7 @@
|
||||
<th> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
||||
<tbody>
|
||||
{loop name="mailing-templates" type="message" secured="*" backend_context="1" lang="$lang_id"}
|
||||
<tr>
|
||||
@@ -71,7 +71,7 @@
|
||||
{/loop}
|
||||
|
||||
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.configuration.messages.delete"}
|
||||
<a class="btn btn-default btn-xs message-delete" title="{intl l='Delete this mailing template'}" href="#delete_message_dialog" data-id="{$ID}" data-toggle="modal"><i class="glyphicon glyphicon-trash"></i></a>
|
||||
<a class="btn btn-default btn-xs message-delete" title="{intl l='Delete this mailing template'}" href="#delete_dialog" data-id="{$ID}" data-toggle="modal"><i class="glyphicon glyphicon-trash"></i></a>
|
||||
{/loop}
|
||||
</div>
|
||||
{else}
|
||||
@@ -79,7 +79,7 @@
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/loop}
|
||||
{/loop}
|
||||
{elseloop rel="mailing-templates"}
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
@@ -102,110 +102,89 @@
|
||||
</div>
|
||||
|
||||
|
||||
{* Adding a new message *}
|
||||
|
||||
<div class="modal fade" id="add_message_dialog" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>{intl l="Create a new mailing template"}</h3>
|
||||
</div>
|
||||
|
||||
{form name="thelia.admin.message.creation"}
|
||||
<form method="POST" action="{url path='/admin/configuration/messages/create'}" {form_enctype form=$form}>
|
||||
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
{form_field form=$form field='success_url'}
|
||||
{* on success, redirect to the edition page, _ID_ is replaced with the created message ID, see controller *}
|
||||
<input type="hidden" name="{$name}" value="{url path='/admin/configuration/messages/update' message_id='_ID_'}" />
|
||||
{/form_field}
|
||||
|
||||
{* We do not allow users to create secured messages from here *}
|
||||
|
||||
{form_field form=$form field='secured'}
|
||||
<input type="hidden" name="{$name}" value="0" />
|
||||
{/form_field}
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
{if #form_error}<div class="alert alert-danger" id="add_message_dialog_error">#form_error_message</div>{/if}
|
||||
|
||||
{form_field form=$form field='name'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" value="{$value}" title="{intl l='Mailing template name'}" placeholder="{intl l='Mailing template name'}" class="form-control">
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='title'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
|
||||
{loop type="lang" name="default-lang" default_only="1"}
|
||||
|
||||
{* Switch edition to the current locale *}
|
||||
<input type="hidden" name="edit_language_id" value="{$ID}" />
|
||||
|
||||
<div class="input-group">
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" value="{$value}" title="{intl l='Mailing template purpose'}" placeholder="{intl l='Mailing template purpose'}" class="form-control">
|
||||
<span class="input-group-addon"><img src="{image file="assets/img/flags/{$CODE}.gif"}" alt="{intl l=$TITLE}" /></span>
|
||||
</div>
|
||||
|
||||
<div class="help-block">{intl l="Enter here the mailing template purpose in the default language ($TITLE)"}</div>
|
||||
|
||||
{form_field form=$form field='locale'}
|
||||
<input type="hidden" name="{$name}" value="{$LOCALE}" />
|
||||
{/form_field}
|
||||
{/loop}
|
||||
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove"></span> {intl l="Cancel"}</button>
|
||||
<button type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span> {intl l="Create this mailing template"}</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
{/form}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{* Adding a new message *}
|
||||
|
||||
|
||||
{* Delete confirmation dialog *}
|
||||
{form name="thelia.admin.message.creation"}
|
||||
|
||||
<div class="modal fade" id="delete_message_dialog" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
{* Capture the dialog body, to pass it to the generic dialog *}
|
||||
{capture "creation_dialog"}
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>{intl l="Delete a mailing template"}</h3>
|
||||
</div>
|
||||
{form_field form=$form field='success_url'}
|
||||
{* on success, redirect to the edition page, _ID_ is replaced with the created message ID, see controller *}
|
||||
<input type="hidden" name="{$name}" value="{url path='/admin/configuration/messages/update' message_id='_ID_'}" />
|
||||
{/form_field}
|
||||
|
||||
<div class="modal-body">
|
||||
<p>{intl l="Do you really want to delete this mailing template ?"}</p>
|
||||
</div>
|
||||
{* We do not allow users to create secured messages from here *}
|
||||
|
||||
<form method="post" action="{url path='/admin/configuration/messages/delete'}">
|
||||
<input type="hidden" name="message_id" id="message_delete_id" value="" />
|
||||
{form_field form=$form field='secured'}
|
||||
<input type="hidden" name="{$name}" value="0" />
|
||||
{/form_field}
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove"></span> {intl l="No"}</button>
|
||||
<button type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span> {intl l="Yes"}</button>
|
||||
</div>
|
||||
</form>
|
||||
{form_field form=$form field='name'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" value="{$value}" title="{intl l='Mailing template name'}" placeholder="{intl l='Mailing template name'}" class="form-control">
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{form_field form=$form field='title'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
|
||||
{loop type="lang" name="default-lang" default_only="1"}
|
||||
|
||||
{* Switch edition to the current locale *}
|
||||
<input type="hidden" name="edit_language_id" value="{$ID}" />
|
||||
|
||||
<div class="input-group">
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" value="{$value}" title="{intl l='Mailing template purpose'}" placeholder="{intl l='Mailing template purpose'}" class="form-control">
|
||||
<span class="input-group-addon"><img src="{image file="assets/img/flags/{$CODE}.gif"}" alt="{intl l=$TITLE}" /></span>
|
||||
</div>
|
||||
|
||||
<div class="help-block">{intl l="Enter here the mailing template purpose in the default language ($TITLE)"}</div>
|
||||
|
||||
{form_field form=$form field='locale'}
|
||||
<input type="hidden" name="{$name}" value="{$LOCALE}" />
|
||||
{/form_field}
|
||||
{/loop}
|
||||
|
||||
</div>
|
||||
{/form_field}
|
||||
{/capture}
|
||||
|
||||
{include
|
||||
file = "includes/generic-create-dialog.html"
|
||||
|
||||
dialog_id = "creation_dialog"
|
||||
dialog_title = {intl l="Create a new mailing template"}
|
||||
dialog_body = {$smarty.capture.creation_dialog nofilter}
|
||||
|
||||
dialog_ok_label = {intl l="Create this mailing template"}
|
||||
|
||||
form_action = {url path='/admin/configuration/messages/create'}
|
||||
form_enctype = {form_enctype form=$form}
|
||||
form_error_message = $form_error_message
|
||||
}
|
||||
{/form}
|
||||
|
||||
{* Delete confirmation dialog *}
|
||||
|
||||
{capture "delete_dialog"}
|
||||
<input type="hidden" name="message_id" id="message_delete_id" value="" />
|
||||
{/capture}
|
||||
|
||||
{include
|
||||
file = "includes/generic-confirm-dialog.html"
|
||||
|
||||
dialog_id = "delete_dialog"
|
||||
dialog_title = {intl l="Delete mailing template"}
|
||||
dialog_message = {intl l="Do you really want to delete this mailing template ?"}
|
||||
|
||||
form_action = {url path='/admin/configuration/messages/delete'}
|
||||
form_content = {$smarty.capture.delete_dialog nofilter}
|
||||
}
|
||||
{/block}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
@@ -217,26 +196,12 @@
|
||||
$('#message_delete_id').val($(this).data('id'));
|
||||
});
|
||||
|
||||
{* display the form creation dialog if it contains errors *}
|
||||
|
||||
{form name="thelia.admin.message.creation"}
|
||||
{if #form_error}
|
||||
$('#add_message_dialog').modal();
|
||||
{/if}
|
||||
{/form}
|
||||
|
||||
{* Always reset create dialog on close *}
|
||||
|
||||
$('#add_message_dialog').on('hidden',function() {
|
||||
// Hide error message
|
||||
$('#add_message_dialog_error').remove();
|
||||
|
||||
// Clear error status
|
||||
$("#add_message_dialog .error").removeClass('error');
|
||||
|
||||
// Empty field values
|
||||
$("#add_message_dialog input[type=text]").val('');
|
||||
});
|
||||
// JS stuff for creation form
|
||||
{include
|
||||
file = "includes/generic-js-dialog.html"
|
||||
dialog_id = "creation_dialog"
|
||||
form_name = "thelia.admin.message.creation"
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
@@ -26,7 +26,7 @@
|
||||
{intl l='Thelia system variables'}
|
||||
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.variables.create"}
|
||||
<div class="pull-right">
|
||||
<a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new variable'}" href="#add_variable_dialog" data-toggle="modal">
|
||||
<a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new variable'}" href="#creation_dialog" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-plus-sign"></span>
|
||||
</a>
|
||||
<button class="btn btn-default btn-primary" title="{intl l='Save chages'}"><span class="glyphicon glyphicon-ok"></span> {intl l='Save changes'}</button>
|
||||
@@ -135,148 +135,116 @@
|
||||
|
||||
{* Adding a new variable *}
|
||||
|
||||
<div class="modal fade" id="add_variable_dialog" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>{intl l="Create a new variable"}</h3>
|
||||
</div>
|
||||
{form name="thelia.admin.config.creation"}
|
||||
|
||||
{form name="thelia.admin.config.creation"}
|
||||
<form method="POST" action="{url path='/admin/configuration/variables/create'}" {form_enctype form=$form}>
|
||||
{* Capture the dialog body, to pass it to the generic dialog *}
|
||||
{capture "creation_dialog"}
|
||||
|
||||
{form_hidden_fields form=$form}
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
{form_field form=$form field='success_url'}
|
||||
{* on success, redirect to the edition page, _ID_ is replaced with the created variable ID, see controller *}
|
||||
<input type="hidden" name="{$name}" value="{url path='/admin/configuration/variables/update' variable_id='_ID_'}" />
|
||||
{/form_field}
|
||||
{form_field form=$form field='success_url'}
|
||||
{* on success, redirect to the edition page, _ID_ is replaced with the created variable ID, see controller *}
|
||||
<input type="hidden" name="{$name}" value="{url path='/admin/configuration/variables/update' variable_id='_ID_'}" />
|
||||
{/form_field}
|
||||
|
||||
{* We do not allow users to create hidden or secured variables from here *}
|
||||
{* We do not allow users to create hidden or secured variables from here *}
|
||||
|
||||
{form_field form=$form field='hidden'}
|
||||
<input type="hidden" name="{$name}" value="0" />
|
||||
{/form_field}
|
||||
{form_field form=$form field='hidden'}
|
||||
<input type="hidden" name="{$name}" value="0" />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='secured'}
|
||||
<input type="hidden" name="{$name}" value="0" />
|
||||
{/form_field}
|
||||
{form_field form=$form field='secured'}
|
||||
<input type="hidden" name="{$name}" value="0" />
|
||||
{/form_field}
|
||||
|
||||
<div class="modal-body">
|
||||
{form_field form=$form field='name'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" value="{$value}" title="{intl l='Variable name'}" placeholder="{intl l='Variable name'}" class="form-control">
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{if #form_error}<div class="alert alert-error" id="add_variable_dialog_error">#form_error_message</div>{/if}
|
||||
|
||||
{form_field form=$form field='name'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" value="{$value}" title="{intl l='Variable name'}" placeholder="{intl l='Variable name'}" class="form-control">
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='value'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
<input type="text" id="{$label_attr.for}" name="{$name}" value="{$value}" title="{intl l='Variable value'}" placeholder="{intl l='Variable value'}" class="form-control">
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='title'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
{form_field form=$form field='value'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
<input type="text" id="{$label_attr.for}" name="{$name}" value="{$value}" title="{intl l='Variable value'}" placeholder="{intl l='Variable value'}" class="form-control">
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{loop type="lang" name="default-lang" default_only="1"}
|
||||
{form_field form=$form field='title'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
|
||||
{* Switch edition to the current locale *}
|
||||
<input type="hidden" name="edit_language_id" value="{$ID}" />
|
||||
{loop type="lang" name="default-lang" default_only="1"}
|
||||
|
||||
<div class="input-group">
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" value="{$value}" title="{intl l='Variable purpose'}" placeholder="{intl l='Variable purpose'}" class="form-control">
|
||||
<span class="input-group-addon"><img src="{image file="assets/img/flags/{$CODE}.gif"}" alt="{intl l=$TITLE}" /></span>
|
||||
</div>
|
||||
{* Switch edition to the current locale *}
|
||||
<input type="hidden" name="edit_language_id" value="{$ID}" />
|
||||
|
||||
<div class="help-block">{intl l="Enter here the variable purpose in the default language ($TITLE)"}</div>
|
||||
<div class="input-group">
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" value="{$value}" title="{intl l='Variable purpose'}" placeholder="{intl l='Variable purpose'}" class="form-control">
|
||||
<span class="input-group-addon"><img src="{image file="assets/img/flags/{$CODE}.gif"}" alt="{intl l=$TITLE}" /></span>
|
||||
</div>
|
||||
|
||||
{form_field form=$form field='locale'}
|
||||
<input type="hidden" name="{$name}" value="{$LOCALE}" />
|
||||
{/form_field}
|
||||
{/loop}
|
||||
</div>
|
||||
{/form_field}
|
||||
<div class="help-block">{intl l='Enter here the category name in the default language (%title)' title="$TITLE"}</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove"></span> {intl l="Cancel"}</button>
|
||||
<button type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span> {intl l="Create this variable"}</button>
|
||||
</div>
|
||||
{form_field form=$form field='locale'}
|
||||
<input type="hidden" name="{$name}" value="{$LOCALE}" />
|
||||
{/form_field}
|
||||
{/loop}
|
||||
</div>
|
||||
{/form_field}
|
||||
{/capture}
|
||||
|
||||
</form>
|
||||
{/form}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{include
|
||||
file = "includes/generic-create-dialog.html"
|
||||
|
||||
dialog_id = "creation_dialog"
|
||||
dialog_title = {intl l="Create a new variable"}
|
||||
dialog_body = {$smarty.capture.creation_dialog nofilter}
|
||||
|
||||
{* Delete confirmation dialog *}
|
||||
dialog_ok_label = {intl l="Create this variable"}
|
||||
|
||||
<div class="modal fade" id="delete_variable_dialog" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
form_action = {url path='/admin/configuration/variables/create'}
|
||||
form_enctype = {form_enctype form=$form}
|
||||
form_error_message = $form_error_message
|
||||
}
|
||||
{/form}
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>{intl l="Delete a variable"}</h3>
|
||||
</div>
|
||||
{* Delete category confirmation dialog *}
|
||||
|
||||
<div class="modal-body">
|
||||
<p>{intl l="Do you really want to delete this variable ?"}</p>
|
||||
</div>
|
||||
{capture "delete_dialog"}
|
||||
<input type="hidden" name="variable_id" id="variable_delete_id" value="" />
|
||||
{/capture}
|
||||
|
||||
<form method="post" action="{url path='/admin/configuration/variables/delete'}">
|
||||
<input type="hidden" name="variable_id" id="variable_delete_id" value="" />
|
||||
{include
|
||||
file = "includes/generic-confirm-dialog.html"
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove"></span> {intl l="No"}</button>
|
||||
<button type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span> {intl l="Yes"}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
dialog_id = "delete_variable_dialog"
|
||||
dialog_title = {intl l="Delete a variable"}
|
||||
dialog_message = {intl l="Do you really want to delete this variable ?"}
|
||||
|
||||
form_action = {url path='/admin/configuration/variables/delete'}
|
||||
form_content = {$smarty.capture.delete_dialog nofilter}
|
||||
}
|
||||
{/block}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
// JS stuff for creation form
|
||||
{include
|
||||
file = "includes/generic-js-dialog.html"
|
||||
dialog_id = "creation_dialog"
|
||||
form_name = "thelia.admin.config.creation"
|
||||
}
|
||||
|
||||
// Set proper variable ID in delete from
|
||||
$('a.config-delete').click(function(ev) {
|
||||
$('#variable_delete_id').val($(this).data('id'));
|
||||
});
|
||||
|
||||
{* display the form creation dialog if it contains errors *}
|
||||
|
||||
{form name="thelia.admin.config.creation"}
|
||||
{if #form_error}
|
||||
$('#add_variable_dialog').modal();
|
||||
{/if}
|
||||
{/form}
|
||||
|
||||
{* Always reset create dialog on close *}
|
||||
|
||||
$('#add_variable_dialog').on('hidden',function() {
|
||||
// Hide error message
|
||||
$('#add_variable_dialog_error').remove();
|
||||
|
||||
// Clear error status
|
||||
$("#add_variable_dialog .error").removeClass('error');
|
||||
|
||||
// Empty field values
|
||||
$("#add_variable_dialog input[type=text]").val('');
|
||||
});
|
||||
|
||||
// Edition canceling management
|
||||
$('.cancel-edit').each(function() {
|
||||
var zis = $(this);
|
||||
|
||||
Reference in New Issue
Block a user