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

{intl l='Feature information'}

{form_field field='id'} {/form_field} {* Be sure to get the feature 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='Feature values'} {include file='renderer/buttons.html' btn_group=false buttons=[ [ 'type' => 'create', 'class' => 'action-btn pull-right', 'title' => {intl l='Add a new feature value'}, 'href' => '#creation_dialog', 'auth' => ['resource' => 'admin.configuration.feature', 'access' => 'UPDATE'], 'data' => [ 'toggle' => 'modal' ] ] ]}

{intl l="Enter here all possible feature values. To get a free text feature in product forms, don't add any value."}
{hook name="features-value.table-header" location="features_value_table_header" } {loop name="list" type="feature-availability" feature=$feature_id backend_context="1" lang=$edit_language_id order=$featureav_order} {hook name="features-value.table-row" location="features_value_table_row" feature_id={$feature_id} } {/loop} {elseloop rel="list"} {/elseloop}
{admin_sortable_header current_order=$featureav_order order='id' reverse_order='id_reverse' request_parameter_name='featureav_order' path={url path='/admin/configuration/features/update' feature_id=$feature_id} label="{intl l='ID'}" } {admin_sortable_header current_order=$featureav_order order='alpha' reverse_order='alpha_reverse' request_parameter_name='featureav_order' path={url path='/admin/configuration/features/update' feature_id=$feature_id} label="{intl l='Value'}" } {admin_sortable_header current_order=$featureav_order order='manual' reverse_order='manual_reverse' request_parameter_name='featureav_order' path={url path='/admin/configuration/features/update' feature_id=$feature_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.feature" access="UPDATE" path={url path='/admin/configuration/features-av/update-position' feature_id=$feature_id} url_parameter="featureav_id" in_place_edit_class="positionChange" position="$POSITION" id="$ID" } {loop type="auth" name="can_create" role="ADMIN" resource="admin.configuration.feature" access="UPDATE"} {/loop}
{intl l="No value has been created yet. Click the + button to create one."}
{/form}
{hook name="feature-edit.bottom" feature_id=$feature_id} {/loop} {elseloop rel="feature_edit"}
{intl l="Sorry, feature ID=%id was not found." id={$feature_id}}
{/elseloop}
{* Adding a new feature *} {form name="thelia.admin.featureav.creation"} {* Capture the dialog body, to pass it to the generic dialog *} {capture "creation_dialog"} {form_hidden_fields} {* Be sure to get the feature 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='feature_id'} {/form_field} {form_field field='title'}
{loop type="lang" name="current-edit-lang" id="$edit_language_id"}
{$TITLE}
{intl l="Enter here the value in the current edit language (%language_name)" language_name={$TITLE}}
{form_field field='locale'} {/form_field} {/loop}
{/form_field} {hook name="feature.value-create-form" location="feature_value_create_form" feature_id={$feature_id} } {/capture} {include file = "includes/generic-create-dialog.html" dialog_id = "creation_dialog" dialog_title = {intl l="Create a new feature value"} dialog_body = {$smarty.capture.creation_dialog nofilter} dialog_ok_label = {intl l="Create this value"} form_action = {url path='/admin/configuration/features-av/create'} form_enctype = {form_enctype} form_error_message = $form_error_message } {/form} {* Delete value confirmation dialog *} {capture "delete_dialog"} {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "delete_dialog" dialog_title = {intl l="Delete feature value"} dialog_message = {intl l="Do you really want to delete this feature value ?"} form_action = {token_url path='/admin/configuration/features-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="feature.edit-js" location="feature-edit-js" feature_id={$feature_id} } {hook name="wysiwyg.js" location="wysiwyg-feature-edit-js" } {/block}