{extends file="admin-layout.tpl"} {block name="no-return-functions"} {$admin_current_location = 'configuration'} {/block} {block name="page-title"}{intl l='Thelia Product Attributes'}{/block} {block name="check-resource"}admin.configuration.attribute{/block} {block name="check-access"}view{/block} {block name="main-content"}
{hook name="attributes.top" location="attributes_top" }

{intl l='Thelia product attributes'} {loop type="auth" name="can_create" role="ADMIN" resource="admin.configuration.attribute" access="CREATE"} {/loop}
{admin_sortable_header current_order=$order order='id' reverse_order='id_reverse' path='/admin/configuration/attributes' label="{intl l='ID'}" } | {admin_sortable_header current_order=$order order='alpha' reverse_order='alpha_reverse' path='/admin/configuration/attributes' label="{intl l='Title'}" } | {admin_sortable_header current_order=$order order='manual' reverse_order='manual_reverse' path='/admin/configuration/attributes' label="{intl l="Position"}" } {hook name="attributes.table-header" location="attributes_table_header" } | {intl l="Actions"}
--- | --- | --- | ---
{loop name="list" type="attribute" backend_context="1" lang=$lang_id order=$order}
{$ID} | {loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.attribute" access="UPDATE"} {$TITLE} {/loop} {elseloop rel="can_change"} {$TITLE} {/elseloop} | {admin_position_block resource="admin.configuration.attribute" access="UPDATE" path="/admin/configuration/attributes/update-position" url_parameter="attribute_id" in_place_edit_class="positionChange" position="$POSITION" id="$ID" } {hook name="attributes.table-row" location="attributes_table_row" attribute_id={$ID} } | {loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.attribute" access="UPDATE"} {/loop} {loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.attribute" access="UPDATE"} {/loop} {loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.attribute" access="DELETE"} {/loop}
{/loop} {elseloop rel="list"}
{intl l="No product attribute has been created yet. Click the + button to create one."}
{/elseloop}

{hook name="attributes.bottom" location="attributes_bottom" }
{* Adding a new attribute *} {form name="thelia.admin.attribute.creation"} {* Capture the dialog body, to pass it to the generic dialog *} {capture "creation_dialog"} {form_hidden_fields} {form_field field='success_url'} {* on success, redirect to the edition page, _ID_ is replaced with the created attribute ID, see controller *} {/form_field} {form_field field='title'}
{$label} : {loop type="lang" name="default-lang" default_only="1"}
{intl l="Enter here the attribute name in the default language (%language_name)" language_name={$TITLE}}
{* Switch edition to the current locale *} {form_field field='locale'} {/form_field} {/loop}
{/form_field} {form_field field='add_to_all'}
{$label} {intl l='Check this box if you want to add this attributes to all product templates'}
{/form_field} {hook name="attribute.create-form" location="attribute_create_form" } {/capture} {include file = "includes/generic-create-dialog.html" dialog_id = "creation_dialog" dialog_title = {intl l="Create a new attribute"} dialog_body = {$smarty.capture.creation_dialog nofilter} dialog_ok_label = {intl l="Create this attribute"} form_action = {url path='/admin/configuration/attributes/create'} form_enctype = {form_enctype} form_error_message = $form_error_message } {/form} {* Delete confirmation dialog *} {capture "delete_dialog"} {hook name="attribute.delete-form" location="attribute_delete_form" } {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "delete_dialog" dialog_title = {intl l="Delete attribute"} dialog_message = {intl l="Do you really want to delete this attribute ? It will be removed from all product templates."} form_action = {token_url path='/admin/configuration/attributes/delete'} form_content = {$smarty.capture.delete_dialog nofilter} } {* Add to all dialog *} {capture "add_to_all_dialog"} {hook name="attribute.add-to-all-form" location="attribute_add_to_all_form" } {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "add_to_all_dialog" dialog_title = {intl l="Add to all product templates"} dialog_message = {intl l="Do you really want to add this attribute to all product templates ?"} form_action = {url path='/admin/configuration/attributes/add-to-all-templates'} form_content = {$smarty.capture.add_to_all_dialog nofilter} } {* Remove from all dialog *} {capture "remove_from_all_dialog"} {hook name="attribute.remove-to-all-form" location="attribute_remove_to_all_form" } {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "remove_from_all_dialog" dialog_title = {intl l="Remove from all product templates"} dialog_message = {intl l="Do you really want to remove this attribute from all product templates ? You'll loose all product related data for this attribute."} form_action = {url path='/admin/configuration/attributes/remove-from-all-templates'} form_content = {$smarty.capture.remove_from_all_dialog nofilter} } {/block} {block name="javascript-initialization"} {javascripts file='assets/js/bootstrap-editable/bootstrap-editable.js'}
{/javascripts}
{/block} {block name="javascript-last-call"} {hook name="attributes.js" location="attributes-js" } {/block}