Initial commit

This commit is contained in:
2021-01-19 18:19:37 +01:00
commit 6524a071df
14506 changed files with 1808535 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
{* Set the default translation domain, that will be used by {intl} when the 'd' parameter is not set *}
{default_translation_domain domain='bo.default'}
{loop type="export" name="export" id=$exportId}
{form name="thelia.export"}
<form action="{$URL nofilter}" method="post" {form_enctype}>
{form_hidden_fields}
<div id="real-export-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="export-modal-label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button class="close" type="button" data-dismiss="modal">
<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
</button>
<h4 id="export-modal-label" class="modal-title">
{intl l="Export"}&nbsp;: {$TITLE}
</h4>
</div>
<div class="modal-body">
{hook name="export.top" type="modal" id=$ID}
{include 'includes/export-form-body.html'}
{hook name="export.bottom" type="modal" id=$ID}
</div>
{ifloop rel="serializer"}
<div class="modal-footer">
<button class="btn btn-default" type="button" data-dismiss="modal">
{intl l="Close"}
</button>
<button class="btn btn-primary" type="submit">
{intl l="Do this export"}
</button>
</div>
{/ifloop}
</div>
</div>
</div>
</form>
{/form}
{/loop}

View File

@@ -0,0 +1,38 @@
{* Set the default translation domain, that will be used by {intl} when the 'd' parameter is not set *}
{default_translation_domain domain='bo.default'}
{loop type="import" name="import" id=$importId}
{form name="thelia.import"}
<form action="{$URL nofilter}" method="post" {form_enctype}>
{form_hidden_fields}
<div id="real-import-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="import-modal-label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button class="close" type="button" data-dismiss="modal">
<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
</button>
<h4 id="import-modal-label" class="modal-title">
{intl l="Import"}&nbsp;: {$TITLE}
</h4>
</div>
<div class="modal-body">
{include 'includes/import-form-body.html'}
</div>
<div class="modal-footer">
<button class="btn btn-default" type="button" data-dismiss="modal">
{intl l="Close"}
</button>
<button class="btn btn-primary" type="submit">
{intl l="Import this file"}
</button>
</div>
</div>
</div>
</div>
</form>
{/form}
{/loop}

View File

@@ -0,0 +1,99 @@
{* Set the default translation domain, that will be used by {intl} when the 'd' parameter is not set *}
{default_translation_domain domain='bo.default'}
{* Update an Address *}
{form name="thelia.lang.update"}
{* Capture the dialog body, to pass it to the generic dialog *}
{capture "edit_lang_dialog"}
{form_hidden_fields}
{form_field 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}" class="form-control" value="{$value}" title="{intl l={$label} }" placeholder="{intl l='Label'}">
</div>
{/form_field}
{form_field 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}" name="{$name}" class="form-control" value="{$value}" title="{intl l={$label}}" placeholder="{intl l='ISO Code'}">
<span class="help-block">{intl l='<a href="http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes" target="_other">Check the list</a> of ISO 639-1 codes'}</span>
</div>
{/form_field}
{form_field field='locale'}
<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='en_US'}">
</div>
{/form_field}
{form_field field='date_time_format'}
<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='d-m-Y H:i:s'}">
<span class="help-block">{intl l='The syntax used is identical to the PHP <a href="http://www.php.net/date" target="_other">date()</a> function'}</span>
</div>
{/form_field}
{form_field field='date_format'}
<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='d-m-Y'}">
<span class="help-block">{intl l='The syntax used is identical to the PHP <a href="http://www.php.net/date" target="_other">date()</a> function'}</span>
</div>
{/form_field}
{form_field field='time_format'}
<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='H:i:s'}">
<span class="help-block">{intl l='The syntax used is identical to the PHP <a href="http://www.php.net/date" target="_other">date()</a> function'}</span>
</div>
{/form_field}
{form_field field='decimal_separator'}
<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}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='eg: . or ,'}">
<span class="help-block">{intl l='Sets the separator for the decimal point'}</span>
</div>
{/form_field}
{form_field field='thousands_separator'}
<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}" class="form-control" value="{$value}" title="{$label}">
<span class="help-block">{intl l='Sets the thousands separator.'}</span>
</div>
{/form_field}
{form_field field='decimals'}
<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}" class="form-control" value="{$value}" title="{$label}" placeholder="2">
<span class="help-block">{intl l='Decimal places'}</span>
</div>
{/form_field}
{/capture}
{include
file = "includes/generic-create-dialog.html"
dialog_id = "edit_lang_dialog"
dialog_title = {intl l="Edit a language"}
dialog_body = {$smarty.capture.edit_lang_dialog nofilter}
dialog_ok_label = {intl l="Save changes"}
dialog_cancel_label = {intl l="Cancel"}
form_action = {url path="/admin/configuration/languages/save/%id" id=$lang_id}
form_enctype = {form_enctype}
form_error_message = $form_error_message
}
{/form}

View File

@@ -0,0 +1,11 @@
<div class="logger">
<ul id="logger-content">
{foreach $entries as $entry}
<li class="entry">
<span class="head">{$entry.head}</span> <span class="data">{$entry.data}</span>
</li>
{foreachelse}
<li class="no-entry">NO ENTRIES FOUND</li>
{/foreach}
</ul>
</div>

View File

@@ -0,0 +1,152 @@
{* Set the default translation domain, that will be used by {intl} when the 'd' parameter is not set *}
{default_translation_domain domain='bo.default'}
{$locale = {lang attr='locale'}}
{loop type="module" name="module-information" id=$moduleId lang=$locale}
<h4>{intl l="Module detailed information"}</h4>
<table class="table table-striped table-condensed">
{if $TITLE}
<tr>
<th>{intl l="Title"}</th>
<td>{$TITLE}</td>
</tr>
{/if}
<tr>
<th>{intl l="Module code"}</th>
<td>{$CODE}</td>
</tr>
<tr>
<th>{intl l="Module type"}</th>
<td>{$moduleData.type}</td>
</tr>
{if $CHAPO}
<tr>
<th>{intl l="Subtitle"}</th>
<td>{$CHAPO}</td>
</tr>
{/if}
{if $DESCRIPTION}
<tr>
<th>{intl l="Description"}</th>
<td>{$DESCRIPTION nofilter}</td>
</tr>
{/if}
{if $POSTSCRIPTUM}
<tr>
<th>{intl l="Postscriptum"}</th>
<td>{$POSTSCRIPTUM}</td>
</tr>
{/if}
{if $moduleData.tags.tag}
<tr>
<th>{intl l="Tags"}</th>
<td>
{foreach $moduleData.tags.tag as $label}{if $label@index > 0}, {/if}{$label}{/foreach}
</td>
</tr>
{/if}
{if $moduleData.languages.language}
<tr>
<th>{intl l="Supported locales"}</th>
<td>
{foreach $moduleData.languages.language as $label}{if $label@index > 0}, {/if}{$label}{/foreach}
</td>
</tr>
{/if}
<tr>
<th>{intl l="Namespace of main class"}</th>
<td><code>{$moduleData.fullnamespace}</code></td>
</tr>
<tr>
<th>{intl l="Minimum required Thelia version"}</th>
<td>{$moduleData.thelia}</td>
</tr>
{if $moduleData.required.module}
<tr>
<th>{intl l="Required modules"}</th>
<td>
<ul class="list-unstyled">
{foreach $moduleData.required.module as $module}
<li>{$module}</li>
{/foreach}
</ul>
</td>
</tr>
{/if}
<tr>
<th>{intl l="Stability"}</th>
<td>{$moduleData.stability}</td>
</tr>
{if $moduleData.urlmiseajour}
<tr>
<th>{intl l="Update URL"}</th>
<td><a href="{$moduleData.urlmiseajour}" target="_blank">{$moduleData.urlmiseajour}</a></td>
</tr>
{/if}
{if $moduleData.updateurl}
<tr>
<th>{intl l="Update URL"}</th>
<td><a href="{$moduleData.updateurl}" target="_blank">{$moduleData.updateurl}</a></td>
</tr>
{/if}
{if $moduleData.authors.author}
<tr>
<th colspan="2">{intl l="Authors"}</th>
</tr>
{foreach $moduleData.authors.author as $author}
<tr>
<th>
<span class="glyphicon glyphicon-user"></span> {if $author.name}{$author.name}{else}{intl l='Unspecified'}{/if}{if $author.company}, {$author.company}{/if}
</th>
<td>
{if $author.email}
<i class="glyphicon glyphicon-envelope"></i> {mailto address=$author.email encode='hex'}
{/if}
&nbsp;&nbsp;&nbsp;
{if $author.website}
<i class="glyphicon glyphicon-globe"></i> <a href="{$author.website}">{$author.website}</a>
{/if}
</td>
</tr>
{/foreach}
{else}
<tr>
<th>{intl l="Author"}</th>
<td>
{if $moduleData.author.name}{$moduleData.author.name}{else}{intl l='Unspecified'}{/if}{if $moduleData.author.company}, {$moduleData.author.company}{/if}
</td>
</tr>
{if $moduleData.author.email}
<tr>
<th>{intl l="E-mail"}</th>
<td>{mailto address=$moduleData.author.email encode='hex'}</td>
</tr>
{/if}
{if $moduleData.author.website}
<tr>
<th>{intl l="Web site"}</th>
<td><a href="{$moduleData.author.website}">{$moduleData.author.website}</a></td>
</tr>
{/if}
{/if}
</table>
{/loop}
{* fro debugging only <pre>{$moduleData|print_r}</pre> *}

View File

@@ -0,0 +1,267 @@
{config_load file='variables.conf'}
{* Set the default translation domain, that will be used by {intl} when the 'd' parameter is not set *}
{default_translation_domain domain='bo.default'}
{loop name="product_edit" type="product" visible="*" id=$product_id backend_context="1" lang=$edit_language_id}
<div class="form-container">
<div class="row">
<div class="col-md-12">
<p></p> {* <---- FIXME Lame ! *}
<form method="POST" class="clearfix" action="{url path="/admin/product/%id/set-product-template" id=$ID}" id="product_template_form">
<input type="hidden" name="product_id" value="{$product_id}" />
<input type="hidden" name="current_tab" value="attributes" />
<div class="row">
<div class="col-md-12">
<div class="well well-sm">
<p>{intl
l="To use features or attributes on this product, please select a product template. You can define product templates in the <a href=\"%tpl_mgmt_url\" target=\"tpl_window\">configuration section</a> of the administration."
tpl_mgmt_url={url path='/admin/configuration/templates'}
}
</p>
<label for="template_id" class="control-label">
{intl l='Current product template'} :
</label>
<div class="input-group">
<select required="required" name="template_id" id="template_id" class="form-control">
<option value="0">{intl l='Do not use a product template'}</option>
{loop name="product_template_select" type="product-template"}
<option value="{$ID}" {if $TEMPLATE == $ID}selected="selected"{/if}>{$NAME}</option>
{/loop}
</select>
<span class="input-group-btn" id="apply_template_button">
<button class="btn btn-primary action-btn" type="submit">{intl l="Apply"}</button>
</span>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
{* Check if a product template is defined *}
<div class="row">
<div class="col-md-12">
<form method="POST" action="{url path="/admin/product/$ID/update-attributes-and-features"}" id="attribute_form">
<input type="hidden" name="product_id" value="{$product_id}" />
<input type="hidden" name="current_tab" value="attributes" />
{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}"
}
{* -- Begin attributes management ------------------------------- *}
<div class="row">
<div class="col-md-12">
<div class="well well-sm">
<div class="form-group">
<p class="title title-without-tabs">{intl l='Product Attributes'}</p>
<p>
{if $TEMPLATE}
{intl
l="You can change template attributes and their positions in <a href=\"%tpl_mgmt_url\" target=\"tpl_window\">the template configuration page</a>."
tpl_mgmt_url={url path='/admin/configuration/templates/update' template_id=$TEMPLATE}
}
{else}
{intl
l="You can change attributes and their positions in <a href=\"%tpl_mgmt_url\" target=\"tpl_window\">the attributes configuration page</a>."
tpl_mgmt_url={url path='/admin/configuration/attributes'}
}
{/if}
</p>
<div class="table-responsive">
<table class="table table-striped table-condensed table-left-aligned">
<thead>
<tr>
<th>{intl l='ID'}</th>
<th>{intl l='Attribute Name'}</th>
{hook name="product.attributes-table-header" location="product_attributes_table_header" }
</tr>
</thead>
<tbody>
{loop name="product-attributes" type="attribute" order="manual" product=$product_id backend_context="1" lang="$edit_language_id"}
<tr>
<td>{$ID}</td>
<td>{$TITLE}</td>
{hook name="product.attributes-table-row" location="product_attributes_table_row" }
</tr>
{/loop}
{elseloop rel="product-attributes"}
<tr>
<td colspan="2">
<div class="alert alert-info">
{intl l="This product template does not contains any features"}
</div>
</td>
</tr>
{/elseloop}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
{* -- Begin features management ---------------------------------- *}
<div class="row">
<div class="col-md-12">
<div class="well well-sm">
<div class="form-group">
<p class="title title-without-tabs">{intl l='Product Features'}</p>
<p>
{if $TEMPLATE}
{intl
l="You can change templates features and their positions in <a href=\"%tpl_mgmt_url\" target=\"tpl_window\">the template configuration page</a>."
tpl_mgmt_url={url path='/admin/configuration/templates/update' template_id=$TEMPLATE}
}
{else}
{intl
l="You can change feature and their positions in <a href=\"%tpl_mgmt_url\" target=\"tpl_window\">the features configuration page</a>."
tpl_mgmt_url={url path='/admin/configuration/features'}
}
{/if}
</p>
<div class="table-responsive">
<table class="table table-striped table-condensed table-left-aligned">
<thead>
<tr>
<th>{intl l='ID'}</th>
<th>{intl l='Feature Name'}</th>
<th>{intl l='Feature value for this product'}</th>
{hook name="product.features-table-header" location="product_features_table_header" }
</tr>
</thead>
<tbody>
{loop name="product-features" type="feature" order="manual" product=$product_id backend_context="1" lang="$edit_language_id"}
<tr>
<td>{$ID}</td>
<td>{$TITLE}</td>
<td>
{* Multiple values *}
{ifloop rel="product-features-av"}
{* load all selected values in an array to speed up things a little *}
{$selected = array()}
{loop name="free-text-value" exclude_free_text="true" type="feature_value" product=$product_id feature=$ID backend_context="1" lang="$edit_language_id"}
{$selected[] = $FEATURE_AV_ID}
{/loop}
{capture name="select_options"}
{loop name="product-features-av" type="feature-availability" feature=$ID order="manual" backend_context="1" lang="$edit_language_id"}
<option value="{$ID}" {if in_array($ID, $selected)}selected="selected"{/if}>{$TITLE}</option>
{$options_count = $LOOP_COUNT} {* LOOP_COUNT is only available inside the loop ! *}
{/loop}
{if $options_count > #maximum_product_attribute_select_size#}
{$select_size = #maximum_product_attribute_select_size#}
{else}
{$select_size = $options_count}
{/if}
{/capture}
<div class="input-form">
<select multiple="multiple" name="feature_value[{$ID}][]" id="feature_value_{$ID}" size="{$select_size}" class="form-control">
{$smarty.capture.select_options nofilter}
</select>
</div>
<span class="help-block text-right">
{intl l='Use Ctrl+click to select more than one value. You can also <a href="#" class="clear_feature_value" data-id="%id">clear selected values</a>.' id={$ID}}
</span>
{/ifloop}
{* Free text *}
{elseloop rel="product-features-av"}
{$feature_value=''}
{loop name="free-text-value" type="feature_value" product=$product_id feature=$ID backend_context="1" lang="$edit_language_id" limit="1"}
{$feature_value=$TITLE}
{/loop}
<input type="text" id="feature_text_value_{$ID}" name="feature_text_value[{$ID}]" title="{intl l='Enter here the feature value as free text'}" placeholder="{intl l='Feature value'}" class="form-control" value="{$feature_value}">
{/elseloop}
</td>
{hook name="product.features-table-row" location="product_features_table_row" }
</tr>
{/loop}
{elseloop rel="product-features"}
<tr>
<td colspan="3">
<div class="alert alert-info">
{intl l="This product template does not contains any features"}
</div>
</td>
</tr>
{/elseloop}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
{include
file = "includes/inner-form-toolbar.html"
hide_submit_buttons = false
hide_flags = true
page_url = "{url path='/admin/products/update' product_id=$ID}"
close_url = "{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}"
}
</form>
</div>
</div>
</div>
{/loop}
<script>
$(function() {
// Unselect all options in attribute + feature tab
$('.clear_feature_value').click(function(event){
$('#feature_value_' + $(this).data('id') + ' option').prop('selected', false);
event.preventDefault();
});
});
</script>

View File

@@ -0,0 +1,623 @@
{* Set the default translation domain, that will be used by {intl} when the 'd' parameter is not set *}
{default_translation_domain domain='bo.default'}
{loop name="product_edit" type="product" visible="*" id=$product_id backend_context="1" lang=$edit_language_id}
<div class="form-container">
{include
file = "includes/inner-form-toolbar.html"
hide_submit_buttons = true
page_url = "{url path='/admin/products/update' product_id=$ID}"
close_url = "{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}"
}
<div class="row">
{* -- Begin related content management ------------------------------ *}
<div class="col-md-6">
<div class="well well-sm">
<div class="form-group">
<form method="POST" action="{url path='/admin/products/content/add'}" id="related_content_form">
<p class="title title-without-tabs">{intl l='Related content'}</p>
<p>{intl l='You can attach here some content to this product'}</p>
<input type="hidden" name="product_id" value="{$product_id}" />
<input type="hidden" name="current_tab" value="related" />
{ifloop rel="folders"}
<div class="form-group">
<select name="folder_id" id="folder_id" class="form-control">
<option value="">{intl l='Select a folder...'}</option>
{loop name="folders" type="folder-tree" folder="0" backend_context="1" visible="*" lang="$edit_language_id" return_url=false}
<option value="{$ID}" style="padding-left: {3 + $LEVEL * 20}px">{$TITLE}</option>
{/loop}
</select>
<span class="help-block">{intl l='Select a folder to get its content'}</span>
</div>
<div id="content_selector" class="hide">
<div class="input-group">
<select required="required" name="content_id" id="content_id" class="form-control">
<option value="">{intl l='Select a folder content...'}</option>
</select>
<span class="input-group-btn" id="content_add_button">
<button class="btn btn-primary action-btn" type="submit"><span class="glyphicon glyphicon-plus-sign"></span></button>
</span>
</div>
<span class="help-block">{intl l='Select a content and click (+) to add it to this product'}</span>
</div>
<div id="content_selector_empty" class="hide">
<div class="alert alert-info">
{intl l="No available content in this folder"}
</div>
</div>
{/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='Content title'}</th>
<th class="text-center">{intl l='Position'}</th>
{hook name="product.contents-table-header" location="product_contents_table_header" }
<th class="actions">{intl l="Actions"}</th>
</tr>
</thead>
<tbody>
{loop name="assigned_contents" type="associated_content" visible="*" product="$product_id" backend_context="1" lang="$edit_language_id"}
<tr>
<td>{$CONTENT_ID}</td>
<td>
<a href="{url path="/admin/content/update/%id" id=$CONTENT_ID}">{$TITLE}</a>
</td>
<td class="text-center">
{admin_position_block
resource="admin.product"
access="UPDATE"
path={url path='/admin/product/update-content-position' product_id=$product_id current_tab="related"}
url_parameter="content_id"
in_place_edit_class="contentPositionChange"
position=$POSITION
id=$ID
}
</td>
{hook name="product.contents-table-row" location="product_contents_table_row-bottom" }
<td class="actions">
{loop type="auth" name="can_create" role="ADMIN" resources="admin.product" access="UPDATE"}
<a class="btn btn-default btn-xs delete-content" title="{intl l='Delete this content'}" href="#delete_content_dialog" data-id="{$CONTENT_ID}" data-toggle="modal">
<span class="glyphicon glyphicon-trash"></span>
</a>
{/loop}
</td>
</tr>
{/loop}
{elseloop rel="assigned_contents"}
<tr>
<td colspan="4">
<div class="alert alert-info">
{intl l="This product contains no contents"}
</div>
</td>
</tr>
{/elseloop}
</tbody>
</table>
</div>
</div>
</div>
{* -- End related content management -------------------------------- *}
{* -- Begin accessories management ---------------------------------- *}
<div class="col-md-6">
<div class=" well well-sm">
<div class="form-group">
<form method="POST" action="{url path='/admin/products/accessory/add'}" id="accessory_form">
<p class="title title-without-tabs">{intl l='Product accessories'}</p>
<p>{intl l='Define here this product\'s accessories'}</p>
<input type="hidden" name="product_id" value="{$product_id}" />
<input type="hidden" name="current_tab" value="related" />
{ifloop rel="categories"}
<div class="form-group">
<div class="input-group">
<select name="accessory_category_id" id="accessory_category_id" class="form-control">
<option value="">{intl l='Select a category...'}</option>
{loop name="categories" type="category-tree" category="0" backend_context="1" visible="*" lang="$edit_language_id" return_url=false}
<option value="{$ID}" style="padding-left: {3 + $LEVEL * 20}px">{$TITLE}</option>
{/loop}
</select>
<span class="input-group-btn">
<a class="js-btn-accessories-search-category btn btn-info" href="#"><span class="glyphicon glyphicon-search"></span></a>
</span>
</div>
<span class="help-block">{intl l='Select a category to get its products'}</span>
</div>
<div id="accessory_selector" class="hide">
<div class="input-group">
<select required="required" name="accessory_id" id="accessory_id" class="form-control">
<option value="">{intl l='Select a product...'}</option>
</select>
<span class="input-group-btn" id="accessory_add_button">
<button class="btn btn-primary action-btn" type="submit"><span class="glyphicon glyphicon-plus-sign"></span></button>
<a class="js-btn-accessories-search-product btn btn-info" href="#"><span class="glyphicon glyphicon-search"></span></a>
</span>
</div>
<span class="help-block">{intl l='Select a product and click (+) to add it as an accessory'}</span>
</div>
<div id="accessory_selector_empty" class="hide">
<div class="alert alert-info">
{intl l="No available product in this category"}
</div>
</div>
{/ifloop}
{elseloop rel="categories"}
<div class="alert alert-info">{intl l="No categories 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='Accessory title'}</th>
<th class="text-center">{intl l='Position'}</th>
{hook name="product.accessories-table-header" location="product_accessories_table_header-bottom" }
<th class="actions">{intl l="Actions"}</th>
</tr>
</thead>
<tbody>
{loop name="assigned_accessories" order="accessory" visible="*" type="accessory" product="$product_id" backend_context="1" lang="$edit_language_id" return_url=false}
<tr>
<td>{$ID}</td>
<td>
{$TITLE}
</td>
<td class="text-center">
{admin_position_block
resource="admin.product"
access="UPDATE"
path={url path='/admin/product/update-accessory-position' product_id=$product_id current_tab="related"}
url_parameter="accessory_id"
in_place_edit_class="accessoryPositionChange"
position=$POSITION
id=$ID
}
</td>
{hook name="product.accessories-table-row" location="product_accessories_table_row-bottom" }
<td class="actions">
{loop type="auth" name="can_create" role="ADMIN" resources="admin.product" access="UPDATE"}
<a class="btn btn-default btn-xs delete-accessory" title="{intl l='Delete this accessory'}" href="#delete_accessory_dialog" data-id="{$ACCESSORY_ID}" data-toggle="modal">
<span class="glyphicon glyphicon-trash"></span>
</a>
{/loop}
</td>
</tr>
{/loop}
{elseloop rel="assigned_accessories"}
<tr>
<td colspan="4">
<div class="alert alert-info">
{intl l="This product contains no accessories"}
</div>
</td>
</tr>
{/elseloop}
</tbody>
</table>
</div>
</div>
</div>
{* -- End accessories management ------------------------------------ *}
</div>
<div class="row">
{* -- Begin categories management ----------------------------------- *}
<div class="col-md-6">
<div class="well well-sm">
<div class="form-group">
<form method="POST" action="{url path='/admin/products/category/add'}" id="related_content_form">
<p class="title title-without-tabs">{intl l='Additional categories'}</p>
<p>{intl l='A product could be attached to more than one category. Select here the additional categories for this product.'}
{loop name="default_category" visible="*" type="category" id=$DEFAULT_CATEGORY return_url=false}
{intl l='You can change the default category (%title) in the "General" tab.' title={$TITLE}}
{/loop}
{$exclude_from_tree = "-1"}
{loop name="additional_categories" type="category" product=$product_id visible="*" exclude=$DEFAULT_CATEGORY backend_context="1" lang="$edit_language_id" return_url=false}
{$exclude_from_tree = "$exclude_from_tree,$ID"}
{/loop}
<input type="hidden" name="product_id" value="{$product_id}" />
<input type="hidden" name="current_tab" value="related" />
{ifloop rel="categories"}
<div class="input-group">
<select name="additional_category_id" id="additional_category_id" class="form-control">
<option value="">{intl l='Select a category...'}</option>
{loop name="categories" type="category-tree" category="0" exclude=$exclude_from_tree visible="*" backend_context="1" lang="$edit_language_id" return_url=false}
<option value="{$ID}" style="padding-left: {3 + $LEVEL * 20}px" {if $DEFAULT_CATEGORY==$ID}disabled="disabled"{/if}>
{$TITLE} {if $DEFAULT_CATEGORY==$ID}{intl l=' (default)'}{/if}
</option>
{/loop}
</select>
<span class="input-group-btn" id="content_add_button">
<button class="btn btn-primary action-btn" type="submit"><span class="glyphicon glyphicon-plus-sign"></span></button>
<a class="js-btn-additional-search-category btn btn-info" href="#"><span class="glyphicon glyphicon-search"></span></a>
</span>
</div>
<span class="help-block">{intl l='Select a category and click (+) to add it to the additional category list'}</span>
{/ifloop}
{elseloop rel="categories"}
<div class="alert alert-info">{intl l="No categories 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='Category title'}</th>
{hook name="product.categories-table-header" location="product_categories_table_header" }
<th class="actions">{intl l="Actions"}</th>
</tr>
</thead>
<tbody>
{loop name="additional_categories" type="category" visible="*" product=$product_id exclude=$DEFAULT_CATEGORY backend_context="1" lang="$edit_language_id" return_url=false}
<tr>
<td>{$ID}</td>
<td>
{$TITLE}
</td>
{hook name="product.categories-table-row" location="product_categories_table_row" }
<td class="actions">
{loop type="auth" name="can_delete" role="ADMIN" resources="admin.product" access="UPDATE"}
<a class="btn btn-default btn-xs delete-category" title="{intl l='Remove the product from this category'}" href="#delete_category_dialog" data-id="{$ID}" data-toggle="modal">
<span class="glyphicon glyphicon-trash"></span>
</a>
{/loop}
</td>
</tr>
{/loop}
{elseloop rel="additional_categories"}
<tr>
<td colspan="3">
<div class="alert alert-info">
{intl l="This product doesn't belong to any additional category."}
</div>
</td>
</tr>
{/elseloop}
</tbody>
</table>
</div>
</div>
</div>
{* -- End categories management ------------------------------------- *}
</div>
</div>
{* Delete related content confirmation dialog *}
{capture "delete_content_dialog"}
<input type="hidden" name="product_id" value="{$product_id}" />
<input type="hidden" name="content_id" id="content_delete_id" value="" />
<input type="hidden" name="folder_id" id="folder_delete_id" value="" />
<input type="hidden" name="current_tab" value="related" />
{/capture}
{include
file = "includes/generic-confirm-dialog.html"
dialog_id = "delete_content_dialog"
dialog_title = {intl l="Remove related content"}
dialog_message = {intl l="Do you really want to remove this related content from the product ?"}
form_action = {token_url path='/admin/products/content/delete'}
form_content = {$smarty.capture.delete_content_dialog nofilter}
}
{* Delete accessory confirmation dialog *}
{capture "delete_accessory_dialog"}
<input type="hidden" name="product_id" value="{$product_id}" />
<input type="hidden" name="accessory_id" id="accessory_delete_id" value="" />
<input type="hidden" name="accessory_category_id" id="accessory_category_delete_id" value="" />
<input type="hidden" name="current_tab" value="related" />
{/capture}
{include
file = "includes/generic-confirm-dialog.html"
dialog_id = "delete_accessory_dialog"
dialog_title = {intl l="Remove an accessory"}
dialog_message = {intl l="Do you really want to remove this accessory from the product ?"}
form_action = {token_url path='/admin/products/accessory/delete'}
form_content = {$smarty.capture.delete_accessory_dialog nofilter}
}
{* Delete category confirmation dialog *}
{capture "delete_category_dialog"}
<input type="hidden" name="product_id" value="{$product_id}" />
<input type="hidden" name="additional_category_id" id="additional_category_delete_id" value="" />
<input type="hidden" name="current_tab" value="related" />
{/capture}
{include
file = "includes/generic-confirm-dialog.html"
dialog_id = "delete_category_dialog"
dialog_title = {intl l="Remove from category"}
dialog_message = {intl l="Do you really want to remove the product from this category ?"}
form_action = {token_url path='/admin/products/category/delete'}
form_content = {$smarty.capture.delete_category_dialog nofilter}
}
<script>
$(function() {
// Set proper content ID in delete content from
$('a.delete-content').click(function(ev) {
$('#content_delete_id').val($(this).data('id'));
$('#folder_delete_id').val($('#folder_id').val());
});
// Set proper content ID in accessory delete from
$('a.delete-accessory').click(function(ev) {
$('#accessory_delete_id').val($(this).data('id'));
$('#accessory_category_delete_id').val($('#accessory_category_id').val());
});
// Set proper content ID in accessory delete from
$('a.delete-category').click(function(ev) {
$('#additional_category_delete_id').val($(this).data('id'));
});
// Load content on folder selection
$('#folder_id').change(function(event) {
var val = $(this).val();
if (val != "") {
$.ajax({
url : '{url path="/admin/product/$product_id/available-content/"}' + $(this).val() + '.xml',
type : 'get',
dataType : 'json',
success : function(json) {
$('#content_id :not(:first-child)').remove();
var have_content = false;
$.each(json, function(idx, value) {
$('#content_id').append($('<option>').text(value.title).attr('value', value.id));
have_content = true; // Lame...
});
if (have_content) {
$('#content_selector_empty').addClass('hide');
$('#content_selector').removeClass('hide');
}
else {
$('#content_selector_empty').removeClass('hide');
$('#content_selector').addClass('hide');
}
}
});
}
else {
$('#content_selector_empty').addClass('hide');
$('#content_selector').addClass('hide');
}
});
// Load accessory on category selection
$('#accessory_category_id').change(function(event) {
var val = $(this).val();
if (val != "") {
$.ajax({
url : '{url path="/admin/product/$product_id/available-accessories/"}' + $(this).val() + '.xml',
type : 'get',
dataType : 'json',
success : function(json) {
$('#accessory_id :not(:first-child)').remove();
var have_content = false;
$.each(json, function(idx, value) {
$('#accessory_id').append($('<option>').text(value.title).attr('value', value.id));
have_content = true; // Lame...
});
if (have_content) {
$('#accessory_selector_empty').addClass('hide');
$('#accessory_selector').removeClass('hide');
}
else {
$('#accessory_selector_empty').removeClass('hide');
$('#accessory_selector').addClass('hide');
}
}
});
}
else {
$('#accessory_selector_empty').addClass('hide');
$('#accessory_selector').addClass('hide');
}
});
{* Inline editing of accessory position using bootstrap-editable *}
$('.accessoryPositionChange').editable({
type : 'text',
title : "{intl l="Enter new accessory position"}",
mode : 'popup',
inputclass : 'input-mini',
placement : 'left',
success : function(response, newValue) {
// The URL template
var url = "{url noamp='1' path='/admin/product/update-accessory-position' accessory_id='__ID__' position='__POS__' product_id=$product_id current_tab='related' }";
// Perform subtitutions
url = url.replace('__ID__', $(this).data('id')).replace('__POS__', newValue);
// Reload the page
location.href = url;
}
});
$('.contentPositionChange').editable({
type : 'text',
title : "{intl l="Enter new content position"}",
mode : 'popup',
inputclass : 'input-mini',
placement : 'left',
success : function(response, newValue) {
// The URL template
var url = "{url noamp='1' path='/admin/product/update-content-position' content_id='__ID__' position='__POS__' product_id=$product_id current_tab='related' }";
// Perform subtitutions
url = url.replace('__ID__', $(this).data('id')).replace('__POS__', newValue);
// Reload the page
location.href = url;
}
});
// Initialize folder select value
{if $folder_id != 0}
$('#folder_id').val("{$folder_id}").change();
{/if}
// Initialize accessory category id select value
{if $accessory_category_id != 0}
$('#accessory_category_id').val("{$accessory_category_id}").change();
{/if}
// Unselect all options in attribute + feature tab
$('.clear_feature_value').click(function(event){
$('#feature_value_' + $(this).data('id') + ' option').prop('selected', false);
event.preventDefault();
});
// Search categories and products
$('.js-btn-accessories-search-category').on('click', function(event){
event.preventDefault();
$modalSearch.initAndShow(
'{intl l="Search category"}',
'{url path="/admin/products/related/tab/categories/search"}',
'#accessory_category_id',
"{intl l='Category title'}"
);
});
$('.js-btn-accessories-search-product').on('click', function(event){
event.preventDefault();
$modalSearch.initAndShow(
'{intl l="Search product in category %category"}'.replace('%category', $("#accessory_category_id option:selected" ).text().trim()),
'{url path="/admin/products/related/tab/products/search"}',
'#accessory_id',
"{intl l='Product title'}",
$('#accessory_category_id').val()
);
});
$('.js-btn-additional-search-category').on('click', function(event){
event.preventDefault();
$modalSearch.initAndShow(
'{intl l="Search category"}',
'{url path="/admin/products/related/tab/categories/search"}',
'#additional_category_id',
"{intl l='Category title'}"
);
});
});
</script>
{/loop}

View File

@@ -0,0 +1,93 @@
{* Set the default translation domain, that will be used by {intl} when the 'd' parameter is not set *}
{default_translation_domain domain='bo.default'}
<div class="modal fade" id="pse-image-document-assoc-modal" tabindex="-1" role="dialog" aria-labelledby="associate_images_label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="associate_images_label">{$modal_title}</h4>
</div>
<div class="modal-body">
{if empty($items)}
<div class="alert alert-danger">
{if $error_message}
{$error_message}
{else}
{intl l="An unknow error happend"}
{/if}
</div>
{else}
{if $type == "image"}
<div class='images-container'>
<div class="row">
{foreach from=$items key=key item=item}
{if ($key % 4 == 0) && $key != 0}
</div>
<br/>
<div class="row">
{/if}
<div class='col-md-3'>
<div class='product-pse-image-container'>
{if $item.is_associated}
<i class='glyphicon glyphicon-ok product-pse-image-join-glyphicon'></i>
{/if}
<img data-id='{$item.id}' class='img-responsive do-associate {if $item.is_associated}is-associated{/if}' src='{$item.url nofilter}' alt='{$item.title}' />
</div>
</div>
{/foreach}
</div>
</div>
{elseif $type == "document" || $type == "virtual" }
<div class='documents-container'>
<div class="table-responsive">
<table class="table table-striped table-condensed">
<thead>
<tr>
<th>
{intl l="ID"}
</th>
<th>
{intl l="Filename"}
</th>
<th>
{intl l="Title"}
</th>
<th>
{intl l="Associated"}
</th>
</tr>
</thead>
<tbody>
{foreach from=$items item=item}
<tr>
<td>{$item.id}</td>
<td>{$item.filename}</td>
<td>{$item.title}</td>
<td>
<div class="switch-small do-associate document-switch" data-id="{$item.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 $item.is_associated}checked{/if}>
</div>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
</div>
{/if}
{/if}
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<script>
$(".document-switch").bootstrapSwitch();
</script>

View File

@@ -0,0 +1,33 @@
{* Set the default translation domain, that will be used by {intl} when the 'd' parameter is not set *}
{default_translation_domain domain='bo.default'}
{loop type="product" name="product-info" id=$product_id}
<p>{intl l="Select the attributes values of \"%title\" that should be included in this sale operation." title={$TITLE}}</p>
{/loop}
<form>
<input type="hidden" name="attribute-selector-product-id" value="{$product_id}">
<table class="table table-bordered table-condensed table-striped">
{loop name="product-attributes" type="attribute" product="{$product_id}"}
{ifloop rel="product-attributes-av"}
<tr>
<th>{intl l="Attribute %title" title={$TITLE}}</th>
</tr>
<tr>
<td>
{loop name="product-attributes-av" type="attribute_availability" attribute="{$ID}" product="{$product_id}"}
{$selected = in_array($ID, $selected_attributes_av_id)}
<div class="checkbox">
<label>
<input {if $selected}checked {/if}type="checkbox" class="attribute-selector-box" value="{$ID}" name="attr[]"> {$TITLE}
</label>
</div>
{/loop}
</td>
</tr>
{/ifloop}
</tr>
{/loop}
</table>
</form>

View File

@@ -0,0 +1,72 @@
{* Set the default translation domain, that will be used by {intl} when the 'd' parameter is not set *}
{default_translation_domain domain='bo.default'}
{form name="thelia.admin.sale.modification"}
{ifloop rel="product-list"}
<div class="alert alert-default">
{intl l="Select the products included in this sale operation. You can limit your selection to some product's attribute only, if required."}
</div>
<table class="table table-striped table-condensed table-responsive">
<thead>
<tr>
<th class="text-center">
ID
</th>
<th class="text-center">
<input type="checkbox" title="{intl l='Select or deselect all products'}" class="invert-selection">
</th>
<th>{intl l="Product title"}</th>
<th>{intl l="Reference"}</th>
<th class="text-right">{intl l="Best taxed price"}</th>
<th class="text-center">{intl l="Attributes"}</th>
</tr>
</thead>
<tbody>
{* protect ourselves against empty $category_list, which causes all products to be displayed *}
{if empty($category_list)}{$category_list = '0'}{/if}
{loop type="product" name="product-list" category_default="{$category_list}" backend_context=1 return_url=false}
{$selected = in_array($ID, $product_list)}
<tr data-product-id="{$ID}"{if $selected} class="success"{/if}>
<td class="text-center">
{$ID}
</td>
<td class="text-center">
<input {if $selected}checked {/if}data-product-id="{$ID}" type="checkbox" {form_field_attributes field="products" value=$ID value_key=$ID extra_class="product-selector-checkbox"}>
</td>
<td>{$TITLE}</td>
<td><a target="_blank" title="{intl l='View this product in a new page'}" href="{url path="/admin/products/update" product_id=$ID current_tab=prices}">{$REF}</a></td>
<td class="text-right">{format_money number=$BEST_TAXED_PRICE}</td>
<td class="text-center">
{$has_combinations = false}
{loop name="product.sales.elements.test" type="product_sale_elements" product=$ID currency=$edit_currency_id backend_context="1"}
{loop name="product.combinations" type="attribute_combination" product_sale_elements=$ID backend_context="1"}
{$has_combinations = true}
{/loop}
{/loop}
{if $has_combinations}
<button {if ! $selected}disabled="disabled"{/if} title="{intl l='Product\'s attributes included in this sale operation'}" class="btn btn-primary btn-xs product-attribute-selector" data-product-id="{$ID}">{intl l='All'}</button>
<input data-product-id="{$ID}" type="hidden" {form_field_attributes field="product_attributes" value="" value_key=$ID extra_class="product-selected-attributes-ids"}>
{else}
{intl l="No attributes."}
<input type="hidden" {form_field_attributes field="product_attributes" value='' value_key=$ID}>
{/if}
</td>
</tr>
{/loop}
</tbody>
</table>
{/ifloop}
{elseloop rel="product-list"}
<div class="alert alert-info">
{intl l="Please select one or more categories which contains some products"}
</div>
{/elseloop}
{/form}

View File

@@ -0,0 +1,138 @@
{* Set the default translation domain, that will be used by intl when the 'd' parameter is not set *}
{default_translation_domain domain='bo.default'}
<div class="form-group">
{ifloop rel="free_attributes"}
<form method="POST" action="{url path='/admin/configuration/templates/attributes/add'}">
<input type="hidden" name="template_id" value="{$template_id}" />
<div class="input-group">
<select required="required" name="attribute_id" id="attribute_id" class="form-control">
<option value="">{intl l='Select an attribute...'}</option>
{loop name="free_attributes" type="attribute" exclude_template="$template_id" backend_context="1" lang="$edit_language_id"}
<option value="{$ID}">{$TITLE}</option>
{/loop}
</select>
<span class="input-group-btn">
<button class="btn btn-primary action-btn" type="submit"><span class="glyphicon glyphicon-plus-sign"></span></button>
</span>
</div>
<span class="help-block">{intl l='Select an attribute and click (+) to add it to this template'}</span>
</form>
{/ifloop}
{elseloop rel="free_attributes"}
<div class="alert alert-info">{intl l="There is currently no available attributes."}</div>
{/elseloop}
</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='Attribute title'}</th>
<th class="text-center">{intl l='Position'}</th>
{hook name="template.attributes-table-header" location="template_attributes_table_header" }
<th class="actions">{intl l="Actions"}</th>
</tr>
</thead>
<tbody>
{loop name="assigned_attributes" type="attribute" template="$template_id" backend_context="1" lang="$edit_language_id"}
<tr>
<td>{$ID}</td>
<td><a href="{url path="admin/configuration/attributes/update" attribute_id=$ID}">{$TITLE}</a></td>
<td class="text-center">
{admin_position_block
resource="admin.configuration.template"
access="UPDATE"
path={url path="admin/template/update-attribute-position" template_id=$template_id}
url_parameter="attribute_id"
in_place_edit_class="attributePositionChange"
position=$POSITION
id=$ID
}
</td>
{hook name="template.attributes-table-row" location="template_attributes_table_row" }
<td class="actions">
{loop type="auth" name="can_create" role="ADMIN" resource="admin.configuration.template" access="UPDATE"}
<a class="btn btn-default btn-xs delete-attribute" title="{intl l='Delete this attribute'}" href="#delete_attribute_dialog" data-id="{$ID}" data-toggle="modal">
<span class="glyphicon glyphicon-trash"></span>
</a>
{/loop}
</td>
</tr>
{/loop}
{elseloop rel="assigned_attributes"}
<tr>
<td colspan="4">
<div class="alert alert-info">
{intl l="This template contains no attributes"}
</div>
</td>
</tr>
{/elseloop}
</tbody>
</table>
</div>
{* Delete value confirmation dialog *}
{capture "delete_attribute_dialog"}
<input type="hidden" name="template_id" value="{$template_id}" />
<input type="hidden" name="attribute_id" id="attribute_delete_id" value="" />
{/capture}
{include
file = "includes/generic-confirm-dialog.html"
dialog_id = "delete_attribute_dialog"
dialog_title = {intl l="Remove attribute"}
dialog_message = {intl l="Do you really want to remove this attribute from the template ? The attributes combinations that uses this attributes <strong>will be deleted</strong> for the products that uses this template."}
form_action = {token_url path='/admin/configuration/templates/attributes/delete'}
form_content = {$smarty.capture.delete_attribute_dialog nofilter}
}
<script>
$(function() {
// Set proper attribute ID in delete attribute from
$('a.delete-attribute').click(function(ev) {
$('#attribute_delete_id').val($(this).data('id'));
});
{* Inline editing of object position using bootstrap-editable *}
$('.attributePositionChange').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 noamp='1' path="admin/template/update-attribute-position" template_id=$template_id attribute_id='__ID__' position='__POS__'}";
// Perform subtitutions
url = url.replace('__ID__', $(this).data('id')).replace('__POS__', newValue);
// Reload the page
location.href = url;
}
});
});
</script>

View File

@@ -0,0 +1,140 @@
{* Set the default translation domain, that will be used by intl when the 'd' parameter is not set *}
{default_translation_domain domain='bo.default'}
<div class="form-group">
{ifloop rel="free_features"}
<form method="POST" action="{url path='/admin/configuration/templates/features/add'}">
<input type="hidden" name="template_id" value="{$template_id}" />
<div class="input-group">
<select required="required" name="feature_id" id="feature_id" class="form-control">
<option value="">{intl l='Select a feature...'}</option>
{loop name="free_features" type="feature" exclude_template="$template_id" backend_context="1" lang="$edit_language_id"}
<option value="{$ID}">{$TITLE}</option>
{/loop}
</select>
<span class="input-group-btn">
<button class="btn btn-primary action-btn" type="submit"><span class="glyphicon glyphicon-plus-sign"></span></button>
</span>
</div>
<span class="help-block">{intl l='Select a feature and click (+) to add it to this template'}</span>
</form>
{/ifloop}
{elseloop rel="free_features"}
<div class="alert alert-info">{intl l="There is currently no available features."}</div>
{/elseloop}
</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='Feature title'}</th>
<th class="text-center">{intl l='Position'}</th>
{hook name="template.features-table-header" location="template_features_table_header" }
<th class="actions">{intl l="Actions"}</th>
</tr>
</thead>
<tbody>
{loop name="assigned_features" type="feature" template="$template_id" backend_context="1" lang="$edit_language_id"}
<tr>
<td>{$ID}</td>
<td>
<a href="{url path="admin/configuration/features/update" feature_id=$ID}">{$TITLE}</a>
</td>
<td class="text-center">
{admin_position_block
resource="admin.configuration.template"
access="UPDATE"
path={url path="/admin/template/update-feature-position" template_id=$template_id}
url_parameter="feature_id"
in_place_edit_class="featurePositionChange"
position=$POSITION
id=$ID
}
</td>
{hook name="template.features-table-row" location="template_features_table_row" }
<td class="actions">
{loop type="auth" name="can_create" role="ADMIN" resource="admin.configuration.template" access="UPDATE"}
<a class="btn btn-default btn-xs delete-feature" title="{intl l='Delete this feature'}" href="#delete_feature_dialog" data-id="{$ID}" data-toggle="modal">
<span class="glyphicon glyphicon-trash"></span>
</a>
{/loop}
</td>
</tr>
{/loop}
{elseloop rel="assigned_features"}
<tr>
<td colspan="4">
<div class="alert alert-info">
{intl l="This template contains no features"}
</div>
</td>
</tr>
{/elseloop}
</tbody>
</table>
</div>
{* Delete value confirmation dialog *}
{capture "delete_feature_dialog"}
<input type="hidden" name="template_id" value="{$template_id}" />
<input type="hidden" name="feature_id" id="feature_delete_id" value="" />
{/capture}
{include
file = "includes/generic-confirm-dialog.html"
dialog_id = "delete_feature_dialog"
dialog_title = {intl l="Remove feature"}
dialog_message = {intl l="Do you really want to remove this feature from the template ? It will also be removed from the products that uses this template."}
form_action = {token_url path='/admin/configuration/templates/features/delete'}
form_content = {$smarty.capture.delete_feature_dialog nofilter}
}
<script>
$(function() {
// Set proper feature ID in delete feature from
$('a.delete-feature').click(function(ev) {
$('#feature_delete_id').val($(this).data('id'));
});
{* Inline editing of object position using bootstrap-editable *}
$('.featurePositionChange').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 noamp='1' path='/admin/template/update-feature-position' template_id=$template_id feature_id='__ID__' position='__POS__'}";
// Perform subtitutions
url = url.replace('__ID__', $(this).data('id')).replace('__POS__', newValue);
// Reload the page
location.href = url;
}
});
});
</script>