change template subdirs

This commit is contained in:
Etienne Roudeix
2013-11-13 10:24:14 +01:00
parent 2da2a2d6c1
commit 25192cf366
382 changed files with 121 additions and 119 deletions

View File

@@ -0,0 +1,7 @@
{*
This snippet is used by the AdminUtilities Smarty plugin to generate
the position maagement block in tables
*}
<a href="{$admin_utilities_go_up_url}"><i class="glyphicon glyphicon-arrow-up"></i></a>
<span class="{$admin_utilities_in_place_edit_class}" data-id="{$admin_utilities_object_id}">{$admin_utilities_current_position}</span>
<a href="{$admin_utilities_go_down_url}"><i class="glyphicon glyphicon-arrow-down"></i></a>

View File

@@ -0,0 +1,10 @@
{*
This snippet is used by the AdminUtilities Smarty plugin to generate
the header on a sortable column
*}
{if $admin_utilities_sort_direction == 'up'}
<i class="glyphicon glyphicon-chevron-up"></i>
{else if $admin_utilities_sort_direction == 'down'}
<i class="glyphicon glyphicon-chevron-down"></i>
{/if}
<a href="{$admin_utilities_sorting_url}">{$admin_utilities_header_text}</a>

View File

@@ -0,0 +1,28 @@
{* Breadcrumb for categories browsing and editing *}
<ul class="breadcrumb">
<li><a href="{url path='admin/home'}">{intl l="Home"}</a></li>
<li><a href="{url path='admin/catalog'}">{intl l="Catalog"}</a></li>
{ifloop rel="category_path"}
{loop name="category_path" type="category-path" visible="*" category=$category_id}
{if $ID == $category_id && $editing_product == false}
<li class="active">
{if $editing_category == true}
{intl l='Editing %cat' cat="{$TITLE}"}
{else}
{$TITLE} <a href="{url path='/admin/categories/update' category_id=$ID}" title="{intl l='Edit this category'}">{intl l="(edit)"}</a>
{/if}
</li>
{else}
<li><a href="{url path='/admin/categories' category_id=" $ID" action='browse'}">{$TITLE}</a></li>
{/if}
{/loop}
{/ifloop}
{if $editing_product == true}
{loop name="product_path" type="product" visible="*" id=$product_id}
<li>{intl l="Editing %title" title="$TITLE"}</li>
{/loop}
{/if}
</ul>

View 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}

View File

@@ -0,0 +1,102 @@
<div class="form-container">
<div class="row">
{* -- Begin folders management ----------------------------------- *}
<div class="col-md-6">
<div class="well well-sm">
<div class="form-group">
<form method="POST" action="{url path='/admin/content/folder/add'}" id="related_content_form">
<p class="title title-without-tabs">{intl l='Additional Folders'}</p>
<p>{intl l='A content could be attached to more than one folder. Select here the additional fodlers for this content.'}
{loop name="default_folder" type="folder" id=$DEFAULT_FOLDER}
{intl l='You can change the default folder (%title) in the "General" tab.' title=$TITLE}
{/loop}
{$exclude_from_tree = "-1"}
{loop name="additional_folders" type="folder" exclude=$DEFAULT_FOLDER content=$content_id backend_context="1" lang="$edit_language_id"}
{$exclude_from_tree = "$exclude_from_tree,$ID"}
{/loop}
<input type="hidden" name="content_id" value="{$content_id}" />
<input type="hidden" name="current_tab" value="association" />
{ifloop rel="folders"}
<div class="input-group">
<select name="additional_folder_id" id="additional_folder_id" class="form-control">
<option value="">{intl l='Select a folder...'}</option>
{loop name="folders" type="folder-tree" folder="0" exclude=$exclude_from_tree backend_context="1" lang="$edit_language_id"}
<option value="{$ID}" style="padding-left: {3 + $LEVEL * 20}px" {if $DEFAULT_FOLDER==$ID}disabled="disabled"{/if}>
{$TITLE} {if $DEFAULT_FOLDER==$ID}{intl l=' (default)'}{/if}
</option>
{/loop}
</select>
<span class="input-group-btn" id="content_add_button">
<button class="btn btn-default btn-primary action-btn" type="submit"><span class="glyphicon glyphicon-plus-sign"></span></button>
</span>
</div>
<span class="help-block">{intl l='Select a folder and click (+) to add it to the additional folder list'}</span>
{/ifloop}
{elseloop rel="folders"}
<div class="alert alert-info">{intl l="No Folders found"}</div>
{/elseloop}
</form>
</div>
<div class="table-responsive">
<table class="table table-striped table-condensed table-left-aligned">
<thead>
<tr>
<th>{intl l='ID'}</th>
<th>{intl l='Folder title'}</th>
{module_include location='product_folders_table_header'}
<th class="actions">{intl l="Actions"}</th>
</tr>
</thead>
<tbody>
{loop name="additional_folders" type="folder" content=$content_id exclude=$DEFAULT_FOLDER backend_context="1" lang="$edit_language_id"}
<tr>
<td>{$ID}</td>
<td>
{$TITLE}
</td>
{module_include location='product_folders_table_row'}
<td class="actions">
<div class="btn-group">
{loop type="auth" name="can_delete" role="ADMIN" resource="admin.category" access="UPDATE"}
<a class="btn btn-default btn-xs delete-folder" title="{intl l='Remove the product from this category'}" href="#delete_folder_dialog" data-id="{$ID}" data-toggle="modal">
<span class="glyphicon glyphicon-trash"></span>
</a>
{/loop}
</div>
</td>
</tr>
{/loop}
{elseloop rel="additional_folders"}
<tr>
<td colspan="3">
<div class="alert alert-info">
{intl l="This product doesn't belong to any additional folder."}
</div>
</td>
</tr>
{/elseloop}
</tbody>
</table>
</div>
</div>
</div>
{* -- End folders management ------------------------------------- *}
</div>
</div>

View File

@@ -0,0 +1,123 @@
{* Customer address creation / modification fields, used in the customer-edit.html template *}
{form_hidden_fields form=$form}
<input type="hidden" name="customer_id" value="{$customer_id}">
<input type="hidden" name="page" value="{$page}">
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{url path='/admin/customer/update'} customer_id=$customer_id page=$page" />
{/form_field}
{form_field form=$form field='label'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<input {if $required}required{/if} type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{$label}">
</div>
{/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">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<input {if $required}required{/if} type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Company'}">
</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">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<select {if $required}required{/if} name="{$name}" id="{$label_attr.for}" class="form-control">
{loop type="title" name="title1"}
<option value="{$ID}" {if $value == $ID}selected{/if}>{$LONG}</option>
{/loop}
</select>
</div>
{/form_field}
<div class="row">
<div class="col-md-6">
{form_field form=$form field='firstname'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<input {if $required}required{/if} type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Firstname'}">
</div>
{/form_field}
</div>
<div class="col-md-6">
{form_field form=$form field='lastname'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<input {if $required}required{/if} type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Lastname'}">
</div>
{/form_field}
</div>
</div>
{form_field form=$form field='address1'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<input {if $required}required{/if} type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Address'}">
</div>
<div class="form-group">
{form_field form=$form field='address2'}
<input {if $required}required{/if} type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Additional address'}">
{/form_field}
</div>
<div class="form-group">
{form_field form=$form field='address3'}
<input {if $required}required{/if} type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Additional address'}">
{/form_field}
</div>
{/form_field}
<div class="row">
<div class="col-md-3">
{form_field form=$form field='zipcode'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<input {if $required}required{/if} type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Zip code'}">
</div>
{/form_field}
</div>
<div class="col-md-9">
{form_field form=$form field='city'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<input {if $required}required{/if} type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='City'}">
</div>
{/form_field}
</div>
</div>
{form_field form=$form field='country'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<select {if $required}required{/if} name="{$name}" id="{$label_attr.for}" class="form-control">
{loop type="country" name="country1"}
<option value="{$ID}" {if $value == $ID}selected{/if}>{$TITLE}</option>
{/loop}
</select>
</div>
{/form_field}
<div class="row">
<div class="col-md-6">
{form_field form=$form field='phone'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<input {if $required}required{/if} type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Phone number'}">
</div>
{/form_field}
</div>
<div class="col-md-6">
{form_field form=$form field='cellphone'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<input {if $required}required{/if} type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Cellular phone number'}">
</div>
{/form_field}
</div>
</div>

View File

@@ -0,0 +1,36 @@
{*
A generic document upload form
Parameters:
documentType = Document type (category, product, folder, content, module)
parentId = Document parent id, ex: category id
*}
<div class="document-manager" >
<form action="{url path="/admin/document/type/$documentType/$parentId/save-ajax"}" class="dropzone" id="documents-dropzone" enctype="multipart/form-data">
<div class="fallback">
<input name="file" type="file" />
<button type="submit" class="btn btn-info btn-upload"><span class="glyphicon glyphicon-send"></span> {intl l="Send files"}</button>
</div>
<div class="btn-browse hide">
{intl l="Drop files to upload"}
<span>Or</span>
<button type="button" class="btn btn-info btn-upload"><span class="glyphicon glyphicon-upload"></span> {intl l="Browse files"}</button>
</div>
</form>
<div class="existing-document">
{include file='includes/document-upload-list-ajax.html'}
</div>
</div>
<script>
var documentDropZoneUrl = "{url path="/admin/document/type/$documentType/$parentId/save-ajax"}";
var documentListUrl = "{url path="/admin/document/type/$documentType/$parentId/list-ajax"}";
var documentListErrorMessage = "{intl l='Can\'t load documents, please refresh this page.'}";
</script>

View File

@@ -0,0 +1,34 @@
{*
A generic document upload form
Parameters:
documentType = Document type (category, product, folder, content, module)
parentId = Document parent id, ex: category id
*}
{ifloop rel="document"}
<table class="table table-striped table-condensed table-left-aligned">
{loop type="document" name="document" source="{$documentType}" order="manual-reverse" source_id="{$parentId}"}
<tr>
<td>
<a href="{$DOCUMENT_PATH}" title="{$TITLE}" class="" target="_blank">{$TITLE}</a>
</td>
<td>
<div class="btn-group">
<a class="document-update-btn btn btn-default btn-xs" href="{url path="/admin/document/type/$documentType/$ID/update"}" data-error-message="{intl l='Please retry'}">
<span class="glyphicon glyphicon-edit"></span>
</a>
<a class="document-delete-btn btn btn-default btn-xs" href="{url path="/admin/document/type/$documentType/delete/$ID"}" data-error-message="{intl l='Please retry'}">
<span class="glyphicon glyphicon-trash"></span>
</a>
</div>
<td>
</tr>
{/loop}
</table>
{/ifloop}
{elseloop rel="document"}
<div class="alert alert-info">{intl l='There is no documents attached to this %type.' type=$documentType}</div>
{/elseloop}

View File

@@ -0,0 +1,28 @@
{* Breadcrumb for folders browsing and editing *}
<ul class="breadcrumb">
<li><a href="{url path='admin/home'}">{intl l="Home"}</a></li>
<li><a href="{url path='admin/folders'}">{intl l="Folders"}</a></li>
{ifloop rel="folder_path"}
{loop name="folder_path" type="folder-path" visible="*" folder=$folder_id}
{if $ID == $parent}
<li class="active">
{if $editing_folder == true}
{intl l='Editing %fold' fold="{$TITLE}"}
{else}
{$TITLE} <a href="{url path="/admin/folders/update/$ID"}" title="{intl l='Edit this folder'}">{intl l="(edit)"}</a>
{/if}
</li>
{else}
<li><a href="{url path='/admin/folders' parent="$ID" }">{$TITLE}</a></li>
{/if}
{/loop}
{/ifloop}
{if $editing_content == true}
{loop name="content_path" type="content" visible="*" id=$content_id}
<li>{intl l="Editing %title" title="$TITLE"}</li>
{/loop}
{/if}
</ul>

View File

@@ -0,0 +1,44 @@
{*
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
form_id = the form id
*}
<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">&times;</button>
<h3>{$dialog_title}</h3>
</div>
<div class="modal-body">
{$dialog_message nofilter}
</div>
<form method="{$form_method|default:POST}" action="{$form_action}" id="{$form_id|default:"{$dialog_id}_form"}">
{$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>

View File

@@ -0,0 +1,44 @@
{*
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)
ok_button_id (optionnal) = the id of the OK button
*}
<div class="modal fade {if ! empty($form_error_message)}modal-force-show{/if}" id="{$dialog_id}" tabindex="-1" {if empty($form_error_message)}aria-hidden="true"{else}aria-hidden="false"{/if}>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</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-danger" 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 {if ! empty($ok_button_id)}id="{$ok_button_id}"{/if} 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>

View File

@@ -0,0 +1,42 @@
{*
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.bs.modal', function() {
// Hide error message
$('#{$dialog_id}_error').remove();
// Clear error status
$("#{$dialog_id} .error").removeClass('error');
$('#{$dialog_id} .form-group').removeClass('has-error')
// Empty field values
$("#{$dialog_id} input[type=text], #{$dialog_id} select").val('');
// Uncheck boxes
$("#{$dialog_id} input[type=checkbox]").removeAttr('checked');
{$additionnal_js_code|default:''}
});

View File

@@ -0,0 +1,34 @@
{*
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 OK
ok_button_id (optionnal) = the id of the OK button
*}
<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">&times;</button>
<h3>{$dialog_title nofilter}</h3>
</div>
<div class="modal-body">
{$dialog_body nofilter}
</div>
<div class="modal-footer">
<button {if ! empty($ok_button_id)}id="{$ok_button_id}"{/if} type="button" data-dismiss="modal" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span> {$dialog_ok_label|default:{intl l='OK'}}</button>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,36 @@
{*
A generic image upload form
Parameters:
imageType = Image type (category, product, folder, content, module)
parentId = Image parent id, ex: category id
*}
<div class="image-manager" >
<form action="{url path="/admin/image/type/$imageType/$parentId/save-ajax"}" class="dropzone" id="images-dropzone" enctype="multipart/form-data">
<div class="fallback">
<input name="file" type="file" />
<button type="submit" class="btn btn-info btn-upload"><span class="glyphicon glyphicon-send"></span> {intl l="Send files"}</button>
</div>
<div class="btn-browse hide">
{intl l="Drop files to upload"}
<span>Or</span>
<button type="button" class="btn btn-info btn-upload"><span class="glyphicon glyphicon-upload"></span> {intl l="Browse files"}</button>
</div>
</form>
<div class="existing-image">
{include file='includes/image-upload-list-ajax.html'}
</div>
</div>
<script>
var imageDropZoneUrl = "{url path="/admin/image/type/$imageType/$parentId/save-ajax"}";
var imageListUrl = "{url path="/admin/image/type/$imageType/$parentId/list-ajax"}";
var imageListErrorMessage = "{intl l='Can\'t load images, please refresh this page.'}";
</script>

View File

@@ -0,0 +1,33 @@
{*
A generic image upload form
Parameters:
imageType = Image type (category, product, folder, content, module)
parentId = Image parent id, ex: category id
*}
{ifloop rel="image"}
<div class="row">
{loop type="image" name="image" source="{$imageType}" order="manual-reverse" source_id="{$parentId}" width="200" height="100" resize_mode="borders"}
<div class="col-sm-6 col-md-3" >
<a href="{url path="/admin/image/type/$imageType/$ID/update"}" alt="{intl l='Update this image'}" class="thumbnail">
<img src="{$IMAGE_URL}" alt="{$TITLE}">
</a>
<div class="btn-group" >
<a class="image-update-btn btn btn-default btn-xs" href="{url path="/admin/image/type/$imageType/$ID/update"}" data-error-message="{intl l='Please retry'}">
<span class="glyphicon glyphicon-edit"></span>
</a>
<a class="image-delete-btn btn btn-default btn-xs" href="{url path="/admin/image/type/$imageType/delete/$ID"}" data-error-message="{intl l='Please retry'}">
<span class="glyphicon glyphicon-trash"></span>
</a>
</div>
</div>
{/loop}
</div>
{/ifloop}
{elseloop rel="image"}
<div class="alert alert-info">{intl l='There is no images attached to this %type.' type=$imageType}</div>
{/elseloop}

View File

@@ -0,0 +1,53 @@
{*
A toolbar displayed in forms, to display language change flags, submit and close buttons.
Parameters:
- hide_flags: true / false. If true, the flags will not be visible
- hide_submit_buttons: true / false. If true, only the close button will be deplayed.
- show_currencies: true/false. If true, show the currency selection bar
- page_url: the current page URL. Default is $current_url. Used to switchedition anguage.
- close_url: no default. URL displayed when close button is clicked. If empty, the close button is not displayed.
*}
<div class="row inner-toolbar">
<div class="col-md-3 inner-actions">
{if $hide_flags != true}
<ul class="nav nav-pills">
{loop name="lang_list" type="lang"}
<li {if $ID == $edit_language_id}class="active"{/if}>
<a class="language-change-button" data-language-id="{$ID}" href="{url path={$page_url|default:$current_url nofilter} edit_language_id=$ID}" title="{intl l='Edit information in %lng' lng=$TITLE}">
<img src="{image file="../assets/img/flags/{$CODE}.gif"}" alt="$TITLE" />
</a>
</li>
{/loop}
</ul>
{/if}
</div>
<div class="col-md-3 inner-actions">
{if $show_currencies == true}
<div class="row">
<div class="col-md-12">
<div class="button-group">
{loop name="currency_list" type="currency"}
<a class="btn btn-sm {if $ID == $edit_currency_id}btn-primary{else}btn-default{/if}" href="{url noamp=1 path='/admin/products/update' edit_currency_id=$ID product_id=$product_id current_tab='details'}" title="{intl l='Edit prices in %curr' curr=$NAME}">
{$SYMBOL}
</a>
{/loop}
</div>
</div>
</div>
{/if}
</div>
<div class="col-md-6 inner-actions">
{if $hide_submit_buttons != true}
<button type="submit" name="save_mode" value="stay" class="form-submit-button btn btn-default btn-success" title="{intl l='Save'}">{intl l='Save'} <span class="glyphicon glyphicon-ok"></span></button>
<button type="submit" name="save_mode" value="close" class="form-submit-button btn btn-default btn-info" title="{intl l='Save and close'}">{intl l='Save and close'} <span class="glyphicon glyphicon-remove"></span></button>
{/if}
{if ! empty($close_url)}
<a href="{$close_url}" class="page-close-button btn btn-default">{intl l='Close'} <span class="glyphicon glyphicon-remove"></span></a>
{/if}
</div>
</div>

View File

@@ -0,0 +1,67 @@
<div class="general-block-decorator">
<div class="table-responsive">
<table class="table table-striped table-condensed table-left-aligned">
<caption class="clearfix">
{$caption_title|default:{intl l='classic modules'}}
</caption>
<thead>
<tr>
<th>{intl l="Name"}</th>
<th>{intl l="Description"}</th>
<th>{intl l="Enable/Disable"}</th>
{module_include location='modules_table_header'}
<th class="actions">{intl l="Actions"}</th>
</tr>
</thead>
<tbody>
{loop type="module" name="module.{$module_type}" module_type={$module_type|default:1} backend_context=1}
<tr>
<td><a href="#">{$TITLE}</a></td>
<td>{$CHAPO}</td>
<td>
<div class="make-switch switch-small module-activation" data-id="{$ID}" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok-circle'></i>" data-off-label="<i class='glyphicon glyphicon-remove-circle'></i>">
<input type="checkbox" {if $ACTIVE}checked{/if}>
</div>
<noscript>
{if $ACTIVE}
<a title="{intl l="Deactivate %title module" title=$TITLE}" href="{url path="/admin/module/toggle-activation/{$ID}"}">{intl l="deactivation"}</a>
{else}
<a title="{intl l="activate %title module" title=$TITLE}" href="{url path="/admin/module/toggle-activation/{$ID}"}">{intl l="activation"}</a>
{/if}
</noscript>
</td>
{module_include location='modules_table_row'}
<td class="text-right">
<div class="btn-group">
{loop type="auth" name="can_change" role="ADMIN" module=$CODE access="VIEW"}
<a class="btn btn-primary btn-xs" title="{intl l='Configure this module'}" href="{url path="/admin/module/update/$CODE"}">{intl l="Configure"}</a>
{/loop}
{*loop type="auth" name="can_change" role="ADMIN" resource="admin.modules" access="VIEW"}
<a class="btn btn-default btn-xs" title="{intl l='Read the documentation of this module'}" href="{url path="/admin/module/documentation/$ID"}"><span class="glyphicon glyphicon-book"></span></a>
{/loop*}
{loop type="auth" name="can_change" role="ADMIN" resource="admin.module" access="UPDATE"}
<a class="btn btn-default btn-xs" title="{intl l='Edit this module'}" href="{url path="/admin/module/update/$ID"}"><span class="glyphicon glyphicon-edit"></span></a>
{/loop}
{loop type="auth" name="can_delete" role="ADMIN" resource="admin.module" access="DELETE"}
<a class="btn btn-default btn-xs module-delete-action" title="{intl l='Delete this module'}" href="#delete_module_dialog" data-id="{$ID}" data-toggle="modal"><span class="glyphicon glyphicon-trash"></span></a>
{/loop}
</div>
</td>
</tr>
{/loop}
</tbody>
</table>
</div>
</div>

View 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}

View File

@@ -0,0 +1,770 @@
<div class="form-container">
{$has_at_least_one_combination = false}
{$default_product_sale_element_id = 0}
{loop name="product.sales.elements.test" type="product_sale_elements" product=$product_id currency=$edit_currency_id backend_context="1"}
{loop name="product.combinations" type="attribute_combination" product_sale_elements="$ID"}
{$has_at_least_one_combination = true}
{/loop}
{elseloop rel="product.combinations"}
{$default_product_sale_element_id = $ID}
{/elseloop}
{/loop}
{if $has_at_least_one_combination == false}
{form name="thelia.admin.product_default_sale_element.update"}
<form method="POST" action="{url path='/admin/product/default-price/update'}" {form_enctype form=$form} class="clearfix">
{include
file = "includes/inner-form-toolbar.html"
hide_submit_buttons = false
show_currencies = true
page_url = "{url path='/admin/products/update' product_id=$ID}"
close_url = "{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}"
}
{* Be sure to get the product ID and current tab, even if the form could not be validated *}
<input type="hidden" name="product_id" value="{$product_id}" />
<input type="hidden" name="current_tab" value="details" />
{form_hidden_fields form=$form}
{form_field form=$form field='product_id'}
<input type="hidden" name="{$name}" value="{$value}" />
{/form_field}
{form_field form=$form field='product_sale_element_id'}
<input type="hidden" name="{$name}" value="{$default_product_sale_element_id}" />
{/form_field}
{form_field form=$form field='isdefault'}
<input type="hidden" name="{$name}" value="{$value}" />
{/form_field}
{form_field form=$form field='reference'}
<input type="hidden" name="{$name}" value="{$value}" />
{/form_field}
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}" />
{/form_field}
{loop type="currency" name="product-currency" id=$edit_currency_id backend_context="1"}
{$currency_symbol = $SYMBOL}
{$currency_name = $NAME}
{form_field form=$form field='currency'}
<input type="hidden" name="{$name}" value="{$ID}" />
{/form_field}
{$current_currency_is_default = $IS_DEFAULT}
{/loop}
{if $form_error}
<div class="row">
<div class="col-md-12">
<div class="alert alert-danger">{$form_error_message}</div>
</div>
</div>
{/if}
<div class="row">
<div class="col-md-4">
{form_field form=$form field='tax_rule'}
<div class="form-group {if $error}has-error{/if}">
<label for="tax_rule_field" class="control-label">{$label} : </label>
<div class="form-group">
<select id="tax_rule_field" required="required" name="{$name}" class="form-control">
<option value="">{intl l="Select a tax tule"}</option>
{loop name="tax" type="tax-rule" backend_context="1"}
<option value="{$ID}" {if $ID == $TAX_RULE_ID}selected="selected"{/if}>{$TITLE}</option>
{/loop}
</select>
</div>
</div>
{/form_field}
</div>
</div>
<p class="title title-without-tabs">{intl l='Pricing'}</p>
<p>{intl l="The default pricing is used when no combination is defined."}</p>
<div class="row">
{* -- Pricing ------------------------------------------------------- *}
<div class="col-md-4">
<div class="well well-sm">
<p class="title title-without-tabs">{intl l='Pricing'}</p>
<p></p> <!-- LAME !!! FIXME -->
{form_field form=$form field='use_exchange_rate'}
{if $current_currency_is_default}
<input type="hidden" name="{$name}" value="0">
{$show_pricing_fields = true}
{else}
<div class="form-group {if $error}has-error{/if}">
<div class="checkbox">
<label>
<input type="checkbox" data-pse-id="{$default_product_sale_element_id}" class="use_exchange_rate_box" name="{$name}" value="1" {if $value != 0}checked="checked"{/if}>
{$label}
</label>
</div>
</div>
{$show_pricing_fields = ($value == 0)}
{/if}
{/form_field}
{form_field form=$form field='price'}
<div class="form-group {if $error}has-error{/if}">
<label for="price_without_tax" class="control-label">{$label} : </label>
<div class="input-group">
<input {if !$show_pricing_fields}readonly{/if} data-pse-id="{$default_product_sale_element_id}" data-price-type="price-without-tax" data-rel-price="price_with_tax" type="text" id="price_without_tax" required="required" name="{$name}" class="price_field automatic_price_field form-control" value="{$value}" title="{$label}" placeholder="{intl l='Price excl. taxes'}">
<span class="input-group-addon">{$currency_symbol}</span>
</div>
</div>
{/form_field}
{form_field form=$form field='price_with_tax'}
<div class="form-group">
<label for="price_with_tax" class="control-label">{intl l="Product price including taxes"} : </label>
<div class="input-group">
<input {if !$show_pricing_fields}readonly{/if} data-pse-id="{$default_product_sale_element_id}" data-price-type="price-with-tax" data-rel-price="price_without_tax" type="text" id="price_with_tax" name="{$name}" class="price_field automatic_price_field form-control" value="{$value}" title="{$value}" placeholder="{intl l='Price incl. taxes'}">
<span class="input-group-addon">{$currency_symbol}</span>
</div>
</div>
{/form_field}
{module_include location='product_details_pricing_form'}
</div>
</div>
{* -- Details -------------------------------------------------- *}
<div class="col-md-4">
<div class="well well-sm">
<p class="title title-without-tabs">{intl l='Details'}</p>
{form_field form=$form field='ean_code'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<div class="form-group">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Product EAN Code'}">
</div>
</div>
{/form_field}
{form_field form=$form field='weight'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<div class="input-group">
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Product weight'}">
<span class="input-group-addon">{intl l="Kg"}</span>
</div>
</div>
{/form_field}
{form_field form=$form field='quantity'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<div class="form-group">
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Current quantity'}">
</div>
</div>
{/form_field}
{module_include location='product_details_details_form'}
</div>
</div>
{* -- Promotion ------------------------------------------------- *}
<div class="col-md-4">
<div class="well well-sm">
<p class="title title-without-tabs">{intl l='Promotion'}</p>
{form_field form=$form field='sale_price'}
<div class="form-group {if $error}has-error{/if}">
<label for="sale_price_without_tax" class="control-label">{$label} : </label>
<div class="input-group">
<input {if !$show_pricing_fields}readonly{/if} data-pse-id="{$default_product_sale_element_id}" data-price-type="sale-price-without-tax" data-rel-price="sale_price_with_tax" type="text" id="sale_price_without_tax" required="required" name="{$name}" class="price_field automatic_price_field form-control" value="{$value}" title="{$label}" placeholder="{intl l='Product price'}">
<span class="input-group-addon">{$currency_symbol}</span>
</div>
</div>
{/form_field}
{form_field form=$form field='sale_price_with_tax'}
<div class="form-group">
<label for="sale_price_with_tax" class="control-label">{$label} : </label>
<div class="input-group">
<input {if !$show_pricing_fields}readonly{/if} data-pse-id="{$default_product_sale_element_id}" data-price-type="sale-price-with-tax" data-rel-price="sale_price_without_tax" type="text" id="sale_price_with_tax" name="sale_price_with_tax" class="price_field automatic_price_field form-control" value="{$value}" title="{$label}" placeholder="{intl l='Sale price incl. taxes'}">
<span class="input-group-addon">{$currency_symbol}</span>
</div>
</div>
{/form_field}
{form_field form=$form field='onsale'}
<div class="form-group {if $error}has-error{/if}">
<div class="checkbox">
<label>
<input type="checkbox" id="{$label_attr.for}" name="{$name}" value="1" {if $value != 0}checked="checked"{/if}>
{$label}
</label>
</div>
</div>
{/form_field}
{form_field form=$form field='isnew'}
<div class="form-group {if $error}has-error{/if}">
<div class="checkbox">
<label>
<input type="checkbox" id="{$label_attr.for}" name="{$name}" value="1" {if $value != 0}checked="checked"{/if}>
{$label}
</label>
</div>
</div>
{/form_field}
{module_include location='product_details_promotion_form'}
</div>
</div>
</div>
</form>
{/form}
{/if}
{* -- Attribute combinations -------------------------------------------- *}
{if $has_at_least_one_combination}
{form name="thelia.admin.product_sale_element.update"}
<form method="POST" action="{url path='/admin/product/combinations/update'}" {form_enctype form=$form}>
<div class="row">
<div class="col-md-12">
{include
file = "includes/inner-form-toolbar.html"
hide_submit_buttons = false
show_currencies = true
page_url = "{url path='/admin/products/update' product_id=$ID}"
close_url = "{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}"
}
{* Be sure to get the product ID and current tab, even if the form could not be validated *}
<input type="hidden" name="product_id" value="{$product_id}" />
<input type="hidden" name="current_tab" value="details" />
{form_hidden_fields form=$form}
{form_field form=$form field='product_id'}
<input type="hidden" name="{$name}" value="{$value}" />
{/form_field}
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}" />
{/form_field}
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
{loop type="currency" name="get-currency-symbol" id=$edit_currency_id backend_context="1"}
{$currency_symbol = $SYMBOL}
{$current_currency_is_default = $IS_DEFAULT}
{form_field form=$form field='currency'}
<input type="hidden" name="{$name}" value="{$ID}" />
{/form_field}
{/loop}
<div class="row">
<div class="col-md-4">
{form_field form=$form field='tax_rule'}
<div class="form-group {if $error}has-error{/if}">
<label for="tax_rule_field" class="control-label">{$label} : </label>
<div class="form-group">
<select id="tax_rule_field" required="required" name="{$name}" class="form-control">
<option value="">{intl l="Select a tax tule"}</option>
{loop name="tax" type="tax-rule" backend_context="1"}
<option value="{$ID}" {if $ID == $TAX_RULE_ID}selected="selected"{/if}>{$TITLE}</option>
{/loop}
</select>
</div>
</div>
{/form_field}
</div>
<div class="col-md-4">
{form_field form=$form field='use_exchange_rate'}
{if $current_currency_is_default}
<input type="hidden" name="{$name}" value="0">
{$show_pricing_fields = true}
{else}
<div class="form-group {if $error}has-error{/if}">
<label>&nbsp;</label>
<div class="checkbox">
<label>
<input type="checkbox" class="use_exchange_rate_box" name="{$name}" value="1" {if $value != 0}checked="checked"{/if}>
{$label}
</label>
</div>
</div>
{$show_pricing_fields = ($value == 0)}
{/if}
{/form_field}
</div>
</div>
{module_include location='product_before_combinations'}
<table class="table table-striped table-condensed" id="category_list">
<caption>
{intl l='Attribute Combinations'}
{module_include location='product_combinations_list_caption'}
{loop type="auth" name="can_create" role="ADMIN" resource="admin.product" access="UPDATE"}
<a class="btn btn-default btn-primary action-btn" id="open_combination_builder" title="{intl l='Quickly create combinations using the combination builder'}" href="#combination_builder_dialog" data-toggle="modal">
{intl l='Combination builder'}
</a>
<a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new combination'}" href="#combination_creation_dialog" data-toggle="modal">
<span class="glyphicon glyphicon-plus-sign"></span>
</a>
{/loop}
</caption>
<thead>
<tr>
<th class="text-center">{intl l='Reference'}</th>
<th class="text-center">{intl l='EAN Code'}</th>
<th class="text-center">{intl l='Quantity'}</th>
<th class="text-center">{intl l='Price<br />w/o taxes (%currency)' currency=$currency_symbol}</th>
<th class="text-center">{intl l='Price<br />w/ taxes (%currency)' currency=$currency_symbol}</th>
<th class="text-center">{intl l='Weight<br />(Kg)'}</th>
<th class="text-center">{intl l='Default'}</th>
<th class="text-center">{intl l='Sale'}</th>
<th class="text-center">{intl l='New'}</th>
<th class="text-center">{intl l='Sale price<br />w/o taxes (%currency)' currency=$currency_symbol}</th>
<th class="text-center">{intl l='Sale price<br />w/ taxes (%currency)' currency=$currency_symbol}</th>
<th class="actions">&nbsp;</th>
</tr>
</thead>
<tbody>
{* Get number of PSE defined, assumin the form have the same number of values for each fields *}
{form_field form=$form field='product_sale_element_id' value_key=0}
{$pse_count = $total_value_count}
{/form_field}
{for $idx = 0 to $total_value_count-1}
<tr>
<td colspan="10">
{form_field form=$form field='product_sale_element_id' value_key=$idx}
<input type="hidden" name="{$name}" value="{$value}" />
{$current_pse_id = $value}
{loop name="product.sales.elements.combinations" type="attribute_combination" product_sale_elements=$current_pse_id backend_context="1"}
{if $LOOP_COUNT > 1} - {/if}{$ATTRIBUTE_TITLE}
{/loop}
{/form_field}
</td>
<td colspan"2" class="text-right">ID: {$current_pse_id}</td>
</tr>
<tr>
{form_field form=$form field='reference' value_key=$idx}
<td {if $error}class="has-error"{/if}><input class="form-control" type="text" name="{$name}" value="{$value}" /></td>
{/form_field}
{form_field form=$form field='ean_code' value_key=$idx}
<td {if $error}class="has-error"{/if}><input class="form-control" type="text" name="{$name}" value="{$value}" /></td>
{/form_field}
{form_field form=$form field='quantity' value_key=$idx}
<td {if $error}class="has-error"{/if}>
<input class="form-control text-right" required type="text" name="{$name}" value="{$value}" />
</td>
{/form_field}
{form_field form=$form field='price' value_key=$idx}
<td {if $error}class="has-error"{/if}><input {if !$show_pricing_fields}readonly{/if} required data-price-type="price-without-tax" data-rel-price="price_with_tax_{$idx}" id="price_without_tax_{$idx}" class="price_field automatic_price_field form-control text-right" required type="text" name="{$name}" value="{$value}" /></td>
{/form_field}
{form_field form=$form field='price_with_tax' value_key=$idx}
<td {if $error}class="has-error"{/if}><input {if !$show_pricing_fields}readonly{/if} data-price-type="price-with-tax" data-rel-price="price_without_tax_{$idx}" id="price_with_tax_{$idx}" class="price_field automatic_price_field form-control text-right" type="text" name="{$name}" value="{$value}" /></td>
{/form_field}
{form_field form=$form field='weight' value_key=$idx}
<td {if $error}class="has-error"{/if}><input required class="form-control text-right" required type="text" name="{$name}" value="{$value}" /></td>
{/form_field}
{form_field form=$form field='default_pse'}
<td class="{if $error}has-error {/if}text-center">
<input class="form-control" type="radio" name="{$name}" value="{$current_pse_id}" {if $value == $current_pse_id}checked="checked"{/if}/>
</td>
{/form_field}
{form_field form=$form field='onsale' value_key=$idx}
<td class="{if $error}has-error {/if}text-center">
<input class="form-control" type="checkbox" name="{$name}" value="1" {if $value != 0}checked="checked"{/if}/>
</td>
{/form_field}
{form_field form=$form field='isnew' value_key=$idx}
<td class="{if $error}has-error {/if}text-center">
<input class="form-control" type="checkbox" name="{$name}" value="1" {if $value != 0}checked="checked"{/if}/>
</td>
{/form_field}
{form_field form=$form field='sale_price' value_key=$idx}
<td {if $error}class="has-error"{/if}>
<input {if !$show_pricing_fields}readonly{/if} required data-price-type="sale-price-without-tax" data-rel-price="sale_price_with_tax_{$idx}" id="sale_price_without_tax_{$idx}" class="price_field automatic_price_field form-control text-right" type="text" name="{$name}" value="{$value}" />
</td>
{/form_field}
{form_field form=$form field='sale_price_with_tax' value_key=$idx}
<td {if $error}class="has-error"{/if}>
<input {if !$show_pricing_fields}readonly{/if} data-price-type="sale-price-with-tax" data-rel-price="sale_price_without_tax_{$idx}" id="sale_price_with_tax_{$idx}" class="price_field automatic_price_field form-control text-right" type="text" name="{$name}" value="{$value}" />
</td>
{/form_field}
<td class="actions">
<a class="btn btn-default btn-xs combination-delete" title="{intl l='Delete this combination'}" href="#combination_delete_dialog" data-id="{$current_pse_id}" data-toggle="modal"><i class="glyphicon glyphicon-trash"></i></a>
</td>
</tr>
{/for}
</tbody>
</table>
{module_include location='product_after_combinations'}
</div>
</div>
</form>
{/form}
{/if}
{if $has_at_least_one_combination == false}
<div class="row">
<div class="col-md-12">
<p class="title title-without-tabs">{intl l='Attribute Combinations'}</p>
<div class="alert alert-info">
<p>{intl
l='This product has no combination. The default price is used. <a data-toggle="modal" href="%url">Click here to create a new combination</a>.'
url='#combination_creation_dialog'
}</p>
<p>
{intl
l='You may also quickly create combinations from products attributes using the <a href="%url" data-toggle="modal">Combination Builder</a>.'
url='#combination_builder_dialog'
}
</p>
</div>
</div>
</div>
{/if}
{module_include location='product_after_combinations'}
</div>
{* -- Adding a new combination ------------------------------------------------- *}
{* Capture the dialog body, to pass it to the generic dialog *}
{capture "combination_creation_dialog"}
<input type="hidden" name="product_id" value="{$product_id}" />
<input type="hidden" name="current_tab" value="details" />
<div class="form-group">
<label class="control-label">{intl l="Attribute"} : </label>
<select name="attribute_id" id="attribute_id" class="form-control">
<option value="">{intl l='Select an attribute...'}</option>
{loop name="product-attributes" type="attribute" order="manual" product=$product_id backend_context="1" lang=$edit_language_id}
<option value="{$ID}">{$TITLE}</option>
{/loop}
</select>
<span class="help-block">{intl l='Select an attribute and click (+) to view available values'}</span>
</div>
<div id="attribute_value_selector" class="hide">
<div class="input-group">
{* <label class="control-label">{intl l="Attribute values"} : </label> *}
<select name="attribute_value_id" id="attribute_value_id" class="form-control">
<option value="">{intl l='Select an attribute value...'}</option>
</select>
<span class="input-group-btn" id="add_attr_value_button">
<button class="btn btn-default btn-primary action-btn add-value-to-combination" type="button"><span class="glyphicon glyphicon-plus-sign"></span></button>
</span>
</div>
<span class="help-block">{intl l='Select a value click (+) to add it to the combination'}</span>
</div>
<div id="attribute_value_selector_empty" class="hide">
<div class="alert alert-info">
{intl l="No available value for this attribute"}
</div>
</div>
<div class="form-group">
<div class="alert alert-danger hide" id="combination_attributes_error"></div>
<select required="required" multiple="multiple" size="5" name="combination_attributes[]" id="combination_attributes" class="form-control">
</select>
<div class="help-block">
{intl l='To remove a value from the combination, select it and click "remove"'}
<div class="pull-right">
<button class="btn btn-info btn-xs remove-value-from-combination" type="button">
{intl l="Remove selected values"} <span class="glyphicon glyphicon-minus-sign"></span>
</button>
</div>
</div>
</div>
{/capture}
{include
file = "includes/generic-create-dialog.html"
dialog_id = "combination_creation_dialog"
dialog_title = {intl l="Create a new combination"}
dialog_body = {$smarty.capture.combination_creation_dialog nofilter}
dialog_ok_label = {intl l="Create this combination"}
form_action = {url path='/admin/product/combination/add'}
form_enctype = ''
form_error_message = ''
ok_button_id = "combination_creation_dialog_ok"
}
{* -- Delete combination confirmation dialog ----------------------------------- *}
{capture "combination_delete_dialog"}
<input type="hidden" name="product_id" value="{$product_id}" />
<input type="hidden" name="current_tab" value="details" />
<input type="hidden" name="product_sale_element_id" id="combination_delete_id" value="" />
{module_include location='category_delete_form'}
{/capture}
{include
file = "includes/generic-confirm-dialog.html"
dialog_id = "combination_delete_dialog"
dialog_title = {intl l="Delete a combination"}
dialog_message = {intl l="Do you really want to delete this combination ?"}
form_action = {url path='/admin/product/combination/delete'}
form_content = {$smarty.capture.combination_delete_dialog nofilter}
}
{* -- Combination builder dialog -------------------------------------------- *}
{* Capture the dialog body, to pass it to the generic dialog *}
{form name="thelia.admin.product_combination.build"}
{capture "combination_builder_dialog"}
{* Be sure to get the product ID and current tab, even if the form could not be validated *}
<input type="hidden" name="product_id" value="{$product_id}" />
<input type="hidden" name="current_tab" value="details" />
{form_hidden_fields form=$form}
{form_field form=$form field='product_id'}
<input type="hidden" name="{$name}" value="{$product_id}" />
{/form_field}
{if $form_error}<div class="alert alert-danger" id="combination_builder_dialog_error">{$form_error_message}</div>{/if}
{loop type="currency" name="get-currency-symbol" id=$edit_currency_id backend_context="1"}
{$currency_symbol = $SYMBOL}
{form_field form=$form field='currency'}
<input type="hidden" name="{$name}" value="{$ID}" />
{/form_field}
{/loop}
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{url path='/admin/products/update' product_id=$product_id current_tab='details'}" />
{/form_field}
<div class="alert alert-info">
{intl l='Select attribute values to combine. You may enter a default value for some of the fields of the generated combinations.'}
</div>
<div class="row">
<div class="col-md-6">
<div class="scrollable">
<ul class="list-unstyled">
{$index = 0}
{loop name="product-attributes" type="attribute" order="manual" product=$product_id backend_context="1" lang=$edit_language_id}
{ifloop rel="product-attributes-av"}
<li>
<strong>{$TITLE}</strong>
<ul class="list-unstyled">
{loop name="product-attributes-av" type="attribute_availability" attribute="{$ID}" order="manual" backend_context="1" lang=$edit_language_id}
<li>
<div class="checkbox">
<label>
{form_field form=$form field='attribute_av' value_key=$index}
<input data-attribute-id="{$ATTRIBUTE_ID}" class="attribute_av_value" type="checkbox" name="{$name}" value="{$ATTRIBUTE_ID}:{$ID}" {if $value == "$ATTRIBUTE_ID:$ID"}checked="checked"{/if}>{$TITLE}
{/form_field}
</label>
</div>
</li>
{$index = $index + 1}
{/loop}
</ul>
</li>
{/ifloop}
{/loop}
</ul>
</div>
</div>
<div class="col-md-6">
{form_field form=$form field='price'}
<div class="form-group {if $error}has-error{/if}">
<label for="price_without_tax" class="control-label">{$label} : </label>
<div class="input-group">
<input type="text" id="price_without_tax" name="{$name}" class="price_field automatic_price_field form-control" value="{$value}" title="{$label}" placeholder="{intl l='Price excl. taxes'}">
<span class="input-group-addon">{$currency_symbol}</span>
</div>
</div>
{/form_field}
{form_field form=$form field='reference'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<div class="form-group">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Combination reference'}">
</div>
</div>
{/form_field}
{form_field form=$form field='ean_code'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<div class="form-group">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Combination EAN Code'}">
</div>
</div>
{/form_field}
<div class="row">
<div class="col-md-6">
{form_field form=$form field='weight'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<div class="input-group">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Product weight'}">
<span class="input-group-addon">{intl l="Kg"}</span>
</div>
</div>
{/form_field}
</div>
<div class="col-md-6">
{form_field form=$form field='quantity'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l='Quantity'} : </label>
<div class="form-group">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Current quantity'}">
</div>
</div>
{/form_field}
</div>
</div>
{form_field form=$form field='sale_price'}
<div class="form-group {if $error}has-error{/if}">
<label for="sale_price_without_tax" class="control-label">{$label} : </label>
<div class="input-group">
<input type="text" id="sale_price_without_tax" name="{$name}" class="price_field automatic_price_field form-control" value="{$value}" title="{$label}" placeholder="{intl l='Product price'}">
<span class="input-group-addon">{$currency_symbol}</span>
</div>
</div>
{/form_field}
{form_field form=$form field='onsale'}
<div class="form-group {if $error}has-error{/if}">
<div class="checkbox">
<label>
<input type="checkbox" id="{$label_attr.for}" name="{$name}" value="1">
{$label}
</label>
</div>
</div>
{/form_field}
{form_field form=$form field='isnew'}
<div class="form-group {if $error}has-error{/if}">
<div class="checkbox">
<label>
<input type="checkbox" id="{$label_attr.for}" name="{$name}" value="1">
{$label}
</label>
</div>
</div>
{/form_field}
<div class="well well-sm" style="margin-bottom: 0"><b>{intl l='<span id="number_of_generated_combinations">0</span> combinations'}</b></div>
</div>
</div>
{/capture}
{include
file = "includes/generic-create-dialog.html"
dialog_id = "combination_builder_dialog"
dialog_title = {intl l="Create combinations"}
dialog_body = {$smarty.capture.combination_builder_dialog nofilter}
dialog_ok_label = {intl l="Create combinations"}
form_action = {url path='/admin/product/combination/build'}
form_enctype = {form_enctype form=$form}
form_error_message = ''
ok_button_id = "combination_builder_dialog_ok"
}
{/form}

View File

@@ -0,0 +1,112 @@
<div class="form-container">
{form name="thelia.admin.product.modification"}
<form method="POST" action="{url path='/admin/products/save'}" {form_enctype form=$form} class="clearfix">
{include
file = "includes/inner-form-toolbar.html"
hide_submit_buttons = false
page_url = "{url path='/admin/products/update' product_id=$ID}"
close_url = "{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}"
}
{* Be sure to get the product ID, even if the form could not be validated *}
<input type="hidden" name="product_id" value="{$product_id}" />
<input type="hidden" name="current_tab" value="general" />
{form_hidden_fields form=$form}
{form_field form=$form field='id'}
<input type="hidden" name="{$name}" value="{$value}" />
{/form_field}
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}" />
{/form_field}
{form_field form=$form field='locale'}
<input type="hidden" name="{$name}" value="{$edit_language_locale}" />
{/form_field}
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
<div class="form-group">
<label class="control-label">
{intl l='Product reference'} :
</label>
<div class="well well-sm">{$REF}</div>
{form_field form=$form field='ref'}
<input type="hidden" name="{$name}" value="{$value}" />
{/form_field}
</div>
{include file="includes/standard-description-form-fields.html"}
{form_field form=$form field='url'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">
{$label} :
</label>
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" value="{$value}" title="{intl l='Rewritten URL'}" placeholder="{intl l='Rewriten URL'}" class="form-control">
</div>
{/form_field}
<div class="row">
<div class="col-md-6">
{form_field form=$form field='default_category'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">
{$label} :
</label>
<select id="{$label_attr.for}" required="required" name="{$name}" class="form-control">
<option value="0">{intl l="Top level"}</option>
{loop name="cat-parent" type="category-tree" category="0" visible="*" product="0"}
<option value="{$ID}" style="padding-left: {3 + $LEVEL * 20}px" {if $DEFAULT_CATEGORY == $ID}selected="selected"{/if}>{$TITLE}</option>
{/loop}
</select>
<span class="help-block">{intl l='You can attach this product to more categories in the details tab.'}</span>
</div>
{/form_field}
</div>
<div class="col-md-6">
{form_field form=$form field='visible'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l='Visibility'}</label>
<div class="checkbox">
<label>
<input type="checkbox" id="{$label_attr.for}" name="{$name}" value="1" {if $value != 0}checked="checked"{/if}>
{$label}
</label>
</div>
</div>
{/form_field}
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="control-group">
<label>&nbsp;</label>
<div class="controls">
<p>{intl l='Product created on %date_create. Last modification: %date_change' date_create="{format_date date=$CREATE_DATE}" date_change="{format_date date=$UPDATE_DATE}"}</p>
</div>
</div>
</div>
</div>
</form>
{/form}
</div>

View File

@@ -0,0 +1,43 @@
{*
The standard description fields, used by many Thelia objects
*}
{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>
<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}
{form_field form=$form field='chapo'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">
{$label} :
<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}</textarea>
</div>
{/form_field}
{form_field form=$form field='description'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">
{$label} :
<span class="label-help-block">{intl l="The detailed description."}</span>
</label>
<textarea name="{$name}" id="{$label_attr.for}" rows="10" class="form-control wysiwyg">{$value}</textarea>
</div>
{/form_field}
{form_field form=$form field='postscriptum'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">
{$label} :
<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}</textarea>
</div>
{/form_field}