{extends file="admin-layout.tpl"} {block name="no-return-functions"} {$admin_current_location = 'configuration'} {/block} {block name="page-title"}{intl l='Edit an attribute'}{/block} {block name="check-resource"}admin.configuration.attribute{/block} {block name="check-access"}update{/block} {block name="main-content"}
{loop name="attribute_edit" type="attribute" id=$attribute_id backend_context="1" lang=$edit_language_id} {hook name="attribute-edit.top" attribute_id=$attribute_id}
{intl l='Edit attribute "%name"' name={$TITLE}}
{form name="thelia.admin.attribute.modification"}
{include file="includes/inner-form-toolbar.html" close_url="{url path='/admin/configuration/attributes'}"}

{intl l='Attribute information'}

{form_field field='id'} {/form_field} {* Be sure to get the attribute ID, even if the form could not be validated *} {form_hidden_fields} {form_field field='success_url'} {/form_field} {form_field field='locale'} {/form_field} {if $form_error}
{$form_error_message}
{/if} {include file="includes/standard-description-form-fields.html"}

{intl l='Attribute values'} {include file='renderer/buttons.html' btn_group=false buttons=[ [ 'type' => 'create', 'class' => 'pull-right', 'title' => {intl l='Add a new attribute value'}, 'href' => '#creation_dialog', 'auth' => ['resource' => 'admin.configuration.attribute'], 'data' => [ 'toggle' => 'modal' ] ] ]}

{intl l="Enter here all possible attribute values."}
{hook name="attributes-value.table-header" location="attributes_value_table_header" attribute_id=$attribute_id} {loop name="list" type="attribute_availability" attribute=$attribute_id backend_context="1" lang=$edit_language_id order=$attributeav_order} {hook name="attributes-value.table-row" location="attributes_value_table_row" attribute_id=$attribute_id} {/loop} {elseloop rel="list"} {/elseloop}
{admin_sortable_header current_order=$attributeav_order order='id' reverse_order='id_reverse' request_parameter_name='attributeav_order' path={url path='/admin/configuration/attributes/update' attribute_id=$attribute_id} label="{intl l='ID'}" } {admin_sortable_header current_order=$attributeav_order order='alpha' reverse_order='alpha_reverse' request_parameter_name='attributeav_order' path={url path='/admin/configuration/attributes/update' attribute_id=$attribute_id} label="{intl l='Value'}" } {admin_sortable_header current_order=$attributeav_order order='manual' reverse_order='manual_reverse' request_parameter_name='attributeav_order' path={url path='/admin/configuration/attributes/update' attribute_id=$attribute_id} label="{intl l="Position"}" } {intl l="Actions"}
{$ID} {* FIXME : integrate this in the encolsing form to provide standard form processing *} {admin_position_block resource="admin.configuration.attribute" access="UPDATE" path={url path='/admin/configuration/attributes-av/update-position' attribute_id=$attribute_id} url_parameter="attributeav_id" in_place_edit_class="positionChange" position="$POSITION" id="$ID" } {loop type="auth" name="can_create" role="ADMIN" resource="admin.configuration.attribute" access="UPDATE"} {/loop}
{intl l="No value has been created yet. Click the + button to create one."}
{/form}
{hook name="attribute-edit.bottom" attribute_id=$attribute_id} {/loop} {elseloop rel="attribute_edit"}
{intl l="Sorry, attribute ID=%id was not found." id={$attribute_id}}
{/elseloop}
{* Adding a new attribute *} {form name="thelia.admin.attributeav.creation"} {* Capture the dialog body, to pass it to the generic dialog *} {capture "creation_dialog"} {form_hidden_fields} {* Be sure to get the attribute ID, even if the form could not be validated *} {form_field field='success_url'} {* on success, redirect to this page *} {/form_field} {form_field field='attribute_id'} {/form_field} {form_field field='title'}
{loop type="lang" name="current-edit-lang" id="$edit_language_id"}
{intl l={$TITLE}}
{intl l="Enter here the value in the current edit language (%title)" title={$TITLE}}
{form_field field='locale'} {/form_field} {/loop}
{/form_field} {hook name="attribute-value.create-form" location="attribute_value_create_form" } {/capture} {include file = "includes/generic-create-dialog.html" dialog_id = "creation_dialog" dialog_title = {intl l="Create a new attribute value"} dialog_body = {$smarty.capture.creation_dialog nofilter} dialog_ok_label = {intl l="Create this value"} form_action = {url path='/admin/configuration/attributes-av/create'} form_enctype = {form_enctype} form_error_message = $form_error_message } {/form} {* Delete value confirmation dialog *} {capture "delete_dialog"} {hook name="attribute.id-delete-form" location="attribute_id_delete_form" attribute_id=$attribute_id} {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "delete_dialog" dialog_title = {intl l="Delete attribute value"} dialog_message = {intl l="Do you really want to delete this attribute value ?"} form_action = {token_url path='/admin/configuration/attributes-av/delete'} form_content = {$smarty.capture.delete_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="attribute.edit-js" location="attribute-edit-js" attribute_id=$attribute_id} {hook name="wysiwyg.js" location="wysiwyg-attribute-edit-js" } {/block}