Conflicts:
	templates/admin/default/customers.html
This commit is contained in:
mespeche
2013-09-13 11:59:21 +02:00
65 changed files with 1790 additions and 371 deletions

View File

@@ -74,6 +74,13 @@ tfoot{
.table-left-aligned {
th, td {
text-align: left;
&.text-center {
text-align: center;
}
&.text-right {
text-align: right;
}
}
select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input {

View File

@@ -37,6 +37,10 @@
<p class="title title-without-tabs">{intl l='Attribute information'}</p>
{form_field form=$form field='id'}
<input type="hidden" name="{$name}" value="{$attribute_id}" />
{/form_field}
{* Be sure to get the attribute ID, even if the form could not be validated *}
<input type="hidden" name="attribute_id" value="{$attribute_id}" />
@@ -52,7 +56,7 @@
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
{include file="includes/standard-description-form-fields.html"}
{include file="includes/standard-description-form-fields.html" form=$form}
</div>
<div class="col-md-6">
@@ -61,7 +65,7 @@
{intl l='Attribute values'}
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.attribute-values.create"}
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.attribute-av.create"}
<span class="pull-right">
<a data-toggle="modal" href="#creation_dialog" title="Add a new attribute value" class="btn btn-default btn-primary">
<span class="glyphicon glyphicon-plus-sign"></span>
@@ -79,9 +83,10 @@
<tr>
<th>
{admin_sortable_header
current_order=$order
current_order=$attributeav_order
order='id'
reverse_order='id_reverse'
request_parameter_name='attributeav_order'
path={url path='/admin/configuration/attributes/update' attribute_id=$attribute_id}
label="{intl l='ID'}"
}
@@ -89,9 +94,10 @@
<th>
{admin_sortable_header
current_order=$order
current_order=$attributeav_order
order='alpha'
reverse_order='alpha_reverse'
request_parameter_name='attributeav_order'
path={url path='/admin/configuration/attributes/update' attribute_id=$attribute_id}
label="{intl l='Value'}"
}
@@ -99,9 +105,10 @@
<th class="text-center">
{admin_sortable_header
current_order=$order
current_order=$attributeav_order
order='manual'
reverse_order='manual_reverse'
request_parameter_name='attributeav_order'
path={url path='/admin/configuration/attributes/update' attribute_id=$attribute_id}
label="{intl l="Position"}"
}
@@ -114,19 +121,20 @@
</thead>
<tbody>
{loop name="list" type="attribute_availability" attribute=$attribute_id backend_context="1" lang=$edit_language_id order=$order}
{loop name="list" type="attribute_availability" attribute=$attribute_id backend_context="1" lang=$edit_language_id order=$attributeav_order}
<tr>
<td>{$ID}</td>
<td>
<input class="js-edit form-control" type="text" name="" value="{$TITLE}" />
{* FIXME : integrate this in the encolsing form to provide standard form processing *}
<input class="js-edit form-control" type="text" name="attribute_values[{$ID}]" value="{$TITLE}" />
</td>
<td class="text-center">
{admin_position_block
permission="admin.attributes.edit"
path="/admin/configuration/attributes/update-value-position"
url_parameter="attribute_id"
path={url path='/admin/configuration/attributes-av/update-position' attribute_id=$attribute_id}
url_parameter="attributeav_id"
in_place_edit_class="positionChange"
position="$POSITION"
id="$ID"
@@ -137,7 +145,11 @@
<td class="actions">
<div class="btn-group">
<a class="btn btn-default btn-xs value-delete" title="{intl l='Delete this value'}" href="#delete_dialog" data-id="{$ID}" data-toggle="modal"><span class="glyphicon glyphicon-trash"></span></a>
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.attribute-av.delete"}
<a class="btn btn-default btn-xs value-delete" title="{intl l='Delete this value'}" href="#delete_dialog" data-id="{$ID}" data-toggle="modal">
<span class="glyphicon glyphicon-trash"></span>
</a>
{/loop}
</div>
</td>
</tr>
@@ -147,7 +159,7 @@
<tr>
<td colspan="4">
<div class="alert alert-info">
{intl l="No product attribute has been created yet. Click the + button to create one."}
{intl l="No value has been created yet. Click the + button to create one."}
</div>
</td>
</tr>
@@ -181,7 +193,7 @@
{* Adding a new attribute *}
{form name="thelia.admin.attribute-value.creation"}
{form name="thelia.admin.attributeav.creation"}
{* Capture the dialog body, to pass it to the generic dialog *}
@@ -232,7 +244,7 @@
dialog_ok_label = {intl l="Create this value"}
form_action = {url path='/admin/configuration/attributes-av'}
form_action = {url path='/admin/configuration/attributes-av/create'}
form_enctype = {form_enctype form=$form}
form_error_message = $form_error_message
}
@@ -241,7 +253,8 @@
{* Delete value confirmation dialog *}
{capture "delete_dialog"}
<input type="hidden" name="attribute_value_id" id="value_delete_id" value="" />
<input type="hidden" name="attribute_id" value="{$attribute_id}" />
<input type="hidden" name="attributeav_id" id="value_delete_id" value="" />
{/capture}
{include
@@ -275,7 +288,7 @@
{include
file = "includes/generic-js-dialog.html"
dialog_id = "creation_dialog"
form_name = "thelia.admin.attribute-value.creation"
form_name = "thelia.admin.attributeav.creation"
}
{* Inline editing of object position using bootstrap-editable *}
@@ -288,7 +301,7 @@
placement : 'left',
success : function(response, newValue) {
// The URL template
var url = "{url path='/admin/configuration/attributes/update-value-position' attribute_value_id='__ID__' position='__POS__'}";
var url = "{url path='/admin/configuration/attributes-av/update-position' attributeav_id='__ID__' position='__POS__' attribute_id=$attribute_id}";
// Perform subtitutions
url = url.replace('__ID__', $(this).data('id')).replace('__POS__', newValue);

View File

@@ -97,6 +97,17 @@
{module_include location='attributes_table_row'}
<td class="actions">
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.attributes.change"}
<div class="btn-group">
<a class="btn btn-default btn-xs attribute-remove-from-all" title="{intl l='Remove this attribute from all product templates'}" href="#remove_from_all_dialog" data-id="{$ID}" data-toggle="modal">
<span class="glyphicon glyphicon-minus"></span>
</a>
<a class="btn btn-default btn-xs attribute-add-to-all" title="{intl l='Add this attribute to all product templates'}" href="#add_to_all_dialog" data-id="{$ID}" data-toggle="modal">
<span class="glyphicon glyphicon-plus"></span>
</a>
</div>
{/loop}
<div class="btn-group">
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.attributes.change"}
<a class="btn btn-default btn-xs attribute-change" title="{intl l='Change this product attribute'}" href="{url path='/admin/configuration/attributes/update' attribute_id=$ID}"><span class="glyphicon glyphicon-edit"></span></a>
@@ -213,10 +224,51 @@
dialog_title = {intl l="Delete attribute"}
dialog_message = {intl l="Do you really want to delete this attribute ? It will be removed from all product templates."}
form_action = {url path='/admin/configuration/attributes/delete'}
form_action = {url path='/admin/configuration/attributes/remove_from-all-templates' attribute_id=$ID}
form_content = {$smarty.capture.delete_dialog nofilter}
}
{* Add to all dialog *}
{capture "add_to_all_dialog"}
<input type="hidden" name="attribute_id" id="attribute_add_to_all_id" value="" />
{module_include location='attribute_add_to_all_form'}
{/capture}
{include
file = "includes/generic-confirm-dialog.html"
dialog_id = "add_to_all_dialog"
dialog_title = {intl l="Add to all product templates"}
dialog_message = {intl l="Do you really want to add this attribute to all product templates ?"}
form_action = {url path='/admin/configuration/attributes/add-to-all-templates'}
form_content = {$smarty.capture.add_to_all_dialog nofilter}
}
{* Remove from all dialog *}
{capture "remove_from_all_dialog"}
<input type="hidden" name="attribute_id" id="attribute_remove_from_all_id" value="" />
{module_include location='attribute_add_to_all_form'}
{/capture}
{include
file = "includes/generic-confirm-dialog.html"
dialog_id = "remove_from_all_dialog"
dialog_title = {intl l="Remove from all product templates"}
dialog_message = {intl l="Do you really want to remove this attribute from all product templates ? You'll loose all product related data for this attribute."}
form_action = {url path='/admin/configuration/attributes/remove-from-all-templates'}
form_content = {$smarty.capture.remove_from_all_dialog nofilter}
}
{/block}
{block name="javascript-initialization"}
@@ -233,6 +285,14 @@
$('#attribute_delete_id').val($(this).data('id'));
});
$('a.attribute-add-to-all').click(function(ev) {
$('#attribute_add_to_all_id').val($(this).data('id'));
});
$('a.attribute-remove-from-all').click(function(ev) {
$('#attribute_remove_from_all_id').val($(this).data('id'));
});
// JS stuff for creation form
{include
file = "includes/generic-js-dialog.html"

View File

@@ -82,7 +82,7 @@
}
</th>
<th>{intl l='Actions'}</th>
<th class="actions">{intl l='Actions'}</th>
</tr>
</thead>

View File

@@ -111,7 +111,7 @@
{module_include location='currencies_table_header'}
<th class="text-right">{intl l='Actions'}</th>
<th class="actions">{intl l='Actions'}</th>
</tr>
</thead>

View File

@@ -29,17 +29,18 @@
<div class="col-md-12">
{form name="thelia.customer.modification"}
<form method="POST" action="{url path='/admin/customers/save'}" {form_enctype form=$form} class="clearfix">
{* Be sure to get the customer ID, even if the form could not be validated *}
<input type="hidden" name="customer_id" value="{$customer_id}" />
{include file="includes/inner-form-toolbar.html" close_url="{url path='/admin/customers'}"}
<form method="POST" action="{url path="/admin/customer/update/{$ID}"}" {form_enctype form=$form} class="clearfix">
<div class="row inner-toolbar clearfix">
<div class="col-md-6 inner-actions pull-right">
<button type="submit" name="save_mode" value="stay" class="btn btn-default btn-primary" title="{intl l='Save'}">{intl l='Save'} <span class="glyphicon glyphicon-ok"></span></button>
<button type="submit" name="save_mode" value="close" class="btn btn-default btn-info" title="{intl l='Save and close'}">{intl l='Save and close'} <span class="glyphicon glyphicon-remove"></span></button>
</div>
</div>
{form_hidden_fields form=$form}
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{url path='/admin/customers'}" />
<input type="hidden" name="{$name}" value="{url path="/admin/customer/update/{$ID}"}" />
{/form_field}
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
@@ -52,8 +53,8 @@
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<select name="{$name}" id="{$label_attr.for}" class="form-control">
{loop type="title" name="title1"}
<option value="{$ID}">{$LONG}</option>
{loop type="title" name="title1" backend_context="1"}
<option value="{$ID}" {if $ID == $TITLE}selected{/if}>{$LONG}</option>
{/loop}
</select>
</div>
@@ -77,6 +78,13 @@
<p class="title title-without-tabs">{intl l="Default address"}</p>
{form_field form=$form field='company'}
<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}" class="form-control" value="{$COMPANY}" title="{intl l="{$label}"}" placeholder="{intl l='Company'}">
</div>
{/form_field}
{form_field form=$form field='address1'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
@@ -143,67 +151,20 @@
</tr>
</thead>
<tbody>
{loop name="address" type="address" customer="$customer_id" backend_context="1" default="0"}
<tr>
<td>
<address>
<strong>Twitter, Inc.</strong><br>
795 Folsom Ave, Suite 600<br>
San Francisco, CA 94107<br>
<abbr title="Phone">P:</abbr> (123) 456-7890
</address>
</td>
<td>
<div class="btn-group">
<a class="btn btn-default btn-xs" title="{intl l='Edit this address'}" href="#edit_address_dialog" data-toggle="modal">
<span class="glyphicon glyphicon-edit"></span>
</a>
<a class="btn btn-default btn-xs" title="{intl l='Use this address by default'}" href="#use_address_dialog" data-toggle="modal" rel="tooltip">
<span class="glyphicon glyphicon-pushpin"></span>
</a>
<a class="btn btn-default btn-xs customer-delete" title="{intl l='Delete this customer and all his orders'}" href="#delete_address_dialog" data-id="{$ID}" data-toggle="modal">
<span class="glyphicon glyphicon-trash"></span>
</a>
</div>
</td>
</tr>
<tr>
<td>
<address>
<strong>Twitter, Inc.</strong><br>
795 Folsom Ave, Suite 600<br>
San Francisco, CA 94107<br>
<abbr title="Phone">P:</abbr> (123) 456-7890
</address>
</td>
<td>
<div class="btn-group">
<a class="btn btn-default btn-xs" title="{intl l='Edit this address'}" href="#edit_address_dialog" data-toggle="modal">
<span class="glyphicon glyphicon-edit"></span>
</a>
<a class="btn btn-default btn-xs" title="{intl l='Use this address by default'}" href="#use_address_dialog" data-toggle="modal" rel="tooltip">
<span class="glyphicon glyphicon-pushpin"></span>
</a>
<a class="btn btn-default btn-xs customer-delete" title="{intl l='Delete this customer and all his orders'}" href="#delete_address_dialog" data-id="{$ID}" data-toggle="modal">
<span class="glyphicon glyphicon-trash"></span>
</a>
</div>
</td>
</tr>
<tr>
<td>
<address>
<strong>Twitter, Inc.</strong><br>
795 Folsom Ave, Suite 600<br>
San Francisco, CA 94107<br>
<abbr title="Phone">P:</abbr> (123) 456-7890
<strong>{loop name="address.title" type="title" id=$TITLE}{$SHORT}{/loop} {$FIRSTNAME} {$LASTNAME}</strong><br>
{$ADDRESS1}<br>
{$ADDRESS2}<br>
{$ADDRESS3}<br>
{if $PHONE}
<abbr title="{intl l="Phone"}">P:</abbr> {$PHONE}<br>
{/if}
{if $CELLPHONE}
<abbr title="{intl l="cell phone"}">P:</abbr> {$CELLPHONE}
{/if}
</address>
</td>
<td>
@@ -224,6 +185,7 @@
</div>
</td>
</tr>
{/loop}
</tbody>
</table>
</div>

View File

@@ -11,9 +11,9 @@
<div class="customer">
<div id="wrapper" class="container">
<ul class="breadcrumb">
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
<li><a href="{url path='/admin/customers'}">{intl l="Customers"}</a></li>
</ul>
@@ -58,7 +58,7 @@
<th>{intl l='order amount'}</th>
<th>{intl l='Actions'}</th>
<th class="actions">{intl l='Actions'}</th>
</tr>
</thead>
@@ -107,7 +107,7 @@
<td colspan="6">
<div class="text-center">
<ul class="pagination pagination-sm">
<ul class="pagination pagination-centered">
{if $customer_page != 1}
<li><a href="{url path="/admin/customers" page="1"}">&laquo;</a></li>
{else}
@@ -122,12 +122,13 @@
<li class="active"><a href="#">{$PAGE}</a></li>
{/if}
{/pageloop}
{if $PAGE == $LAST && $LAST != $CURRENT}
<li><a href="{url path="/admin/customers" page="$PAGE"}">&raquo;</a></li>
{else}
<li class="disabled"><a href="#">&raquo;</a></li>
{/if}
{/pageloop}
</ul>
</div>
@@ -157,23 +158,23 @@
{* 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/customer/update/_ID_'}" />
{/form_field}
{form_field form=$form field='company'}
<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}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Company'}">
</div>
{/form_field}
{form_field form=$form field='title'}
{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>
<select name="{$name}" id="{$label_attr.for}" class="form-control">
{loop type="title" name="title1"}
<option value="{$ID}">{$LONG}</option>
{/loop}
</select>
</select>
</div>
{/form_field}
@@ -194,13 +195,13 @@
{form_field form=$form field='address1'}
<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}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Address'}">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Address'}">
</div>
<div class="form-group">
{form_field form=$form field='address2'}
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Additional address'}">
{/form_field}
{/form_field}
</div>
<div class="form-group">
@@ -240,8 +241,8 @@
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Email address'}">
</div>
{/form_field}
{/form_field}
{/capture}
{include
@@ -263,7 +264,8 @@
{* Delete confirmation dialog *}
{capture "delete_customer_dialog"}
<input type="hidden" name="customer_id" id="customer_delete_id" value="" />
<input type="hidden" name="customer_page" value="{$customer_page}">
<input type="hidden" name="customer_id" id="delete_customer_id">
{/capture}
{include
@@ -274,7 +276,18 @@
dialog_message = {intl l="Do you really want to delete this customer ?"}
form_action = {url path='/admin/customer/delete'}
form_content = {$smarty.capture.delete_dialog nofilter}
form_content = {$smarty.capture.delete_customer_dialog nofilter}
form_id = "form_delete_customer"
}
{/block}
{block name="javascript-initialization"}
<script type="text/javascript">
$(".customer-delete").click(function(){
$("#delete_customer_id").val($(this).attr("data-id"));
});
</script>
{/block}

View File

@@ -14,6 +14,7 @@ Parameters:
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
form_id = the form id
*}
<div class="modal fade" id="{$dialog_id}" tabindex="-1" role="dialog" aria-hidden="true">
@@ -28,7 +29,7 @@ Parameters:
{$dialog_message nofilter}
</div>
<form method="{$form_method|default:POST}" action="{$form_action}">
<form method="{$form_method|default:POST}" action="{$form_action}" id="{$form_id}">
{$form_content nofilter}

View File

@@ -12,7 +12,7 @@
<ul class="nav nav-pills">
{loop name="lang_list" type="lang" default_only={$default_only}}
<li {if $ID == $edit_language_id}class="active"{/if}>
<a href="{$current_url nofilter}&amp;edit_language_id={$ID}" title="{intl l="Edit information in %lng" lng=$TITLE}">
<a href="{url path=$current_url edit_language_id=$ID}" title="{intl l="Edit information in %lng" lng=$TITLE}">
<img src="{image file="../assets/img/flags/{$CODE}.gif"}" alt="{intl l=$TITLE}" />
</a>
</li>

View File

@@ -3,7 +3,7 @@
{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>
<input type="text" id="{$label_attr.for}" name="{$name}" required="required" title="{intl l='Title'}" placeholder="{intl l='Title'}" class="form-control" value="{$value|htmlspecialchars}">
<input type="text" id="{$label_attr.for}" name="{$name}" required="required" title="{intl l='Title'}" placeholder="{intl l='Title'}" class="form-control" value="{$value}">
</div>
{/form_field}
@@ -14,7 +14,7 @@
<span class="label-help-block">{intl l="A short description, used when a summary or an introduction is required"}</span>
</label>
<textarea name="{$name}" id="{$label_attr.for}" rows="3" title="{intl l='Short description'}" placeholder="{intl l='Short description'}" class="form-control">{$value|htmlspecialchars}</textarea>
<textarea name="{$name}" id="{$label_attr.for}" rows="3" title="{intl l='Short description'}" placeholder="{intl l='Short description'}" class="form-control">{$value}</textarea>
</div>
{/form_field}
@@ -25,7 +25,7 @@
<span class="label-help-block">{intl l="The détailed description."}</span>
</label>
<textarea name="{$name}" id="{$label_attr.for}" rows="10" class="form-control">{$value|htmlspecialchars}</textarea>
<textarea name="{$name}" id="{$label_attr.for}" rows="10" class="form-control">{$value}</textarea>
</div>
{/form_field}
@@ -36,6 +36,6 @@
<span class="label-help-block">{intl l="A short post-description information"}</span>
</label>
<textarea name="{$name}" id="{$label_attr.for}" rows="3" title="{intl l='Short conclusion'}" placeholder="{intl l='Short conclusion'}" class="form-control">{$value|htmlspecialchars}</textarea>
<textarea name="{$name}" id="{$label_attr.for}" rows="3" title="{intl l='Short conclusion'}" placeholder="{intl l='Short conclusion'}" class="form-control">{$value}</textarea>
</div>
{/form_field}

View File

@@ -4,7 +4,8 @@
<div class="span4 feed-list-item">
<h3>{$DATE}</h3>
<h2><a href="{$URL}" target="_blank" title="{intl l='Lire la suite'}">{$TITLE|strip_tags nofilter}</a></h2>
<p>{$DESCRIPTION|strip_tags|truncate:250:"...":true nofilter}</p>
{* we use unescape:"htmlall" to unescape var before truncate, to prevent a cut in the middel of an HTML entity, eg &ea... *}
<p>{$DESCRIPTION|strip_tags|unescape:"htmlall"|truncate:250:"...":true nofilter}</p>
<p><a class="btn" href="{$URL}" target="_blank">{intl l='Lire la suite »'}</a></p>
</div>
{/loop}

View File

@@ -17,7 +17,7 @@
{module_include location='orders_top'}
<div class="row">
<div class="col-md-12">
<div class="col-md-12">
<div class="general-block-decorator">
<table class="table table-striped table-condensed table-left-aligned">
<caption class="clearfix">
@@ -36,14 +36,14 @@
<th>{intl l="Name"}</th>
<th>{intl l="Amount"}</th>
<th>{intl l="Status"}</th>
{module_include location='orders_table_header'}
<th>{intl l="Actions"}</th>
<th class="actions">{intl l="Actions"}</th>
</tr>
</thead>
<tbody>
<tbody>
<tr>
<td><a href="">01230450123045</a></td>
@@ -116,7 +116,7 @@
</div>
</td>
</tr>
<!-- <tr>
<td colspan="3">
<div class="alert alert-info">
@@ -124,10 +124,10 @@
</div>
</td>
</tr> -->
</tbody>
</table>
</div>
</div>
</div>
</div>