{extends file="admin-layout.tpl"} {block name="no-return-functions"} {$admin_current_location = 'configuration'} {/block} {block name="page-title"}{intl l='Thelia Product Templates'}{/block} {block name="check-resource"}admin.configuration.template{/block} {block name="check-access"}view{/block} {block name="main-content"}
{hook name="templates.top" location="templates_top" }
{if ! empty($general_error) }
{$general_error}
{/if}

{intl l='Thelia product templates'} {loop type="auth" name="can_create" role="ADMIN" resource="admin.configuration.template" access="CREATE"} {/loop}
{admin_sortable_header current_order=$order order='id' reverse_order='id_reverse' path='/admin/configuration/templates' label="{intl l='ID'}" } | {admin_sortable_header current_order=$order order='alpha' reverse_order='alpha_reverse' path='/admin/configuration/templates' label="{intl l='Title'}" } {hook name="templates.table-header" location="templates_table_header" } | {intl l="Actions"}
--- | --- | ---
{loop name="list" type="product-template" backend_context="1" lang=$lang_id order=$order}
{$ID} | {loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.template" access="UPDATE"} {$NAME} {/loop} {elseloop rel="can_change"} {$NAME} {/elseloop} {hook name="templates.table-row" location="templates_table_row" template_id=$ID} | {loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.template" access="UPDATE"} {/loop} {loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.template" access="CREATE"} {/loop} {loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.template" access="DELETE"} {/loop}
{/loop} {elseloop rel="list"}
{intl l="No product template has been created yet. Click the + button to create one."}
{/elseloop}

{hook name="templates.bottom" location="templates_bottom" }
{* Adding a new template *} {form name="thelia.admin.template.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 template ID, see controller *} {/form_field} {form_field field='name'}
{$label} : {loop type="lang" name="default-lang" default_only="1"}
{intl l="Enter here the template name in the default language (%title)" title={$TITLE}}
{* Switch edition to the current locale *} {form_field field='locale'} {/form_field} {/loop}
{/form_field} {hook name="template.create-form" location="template_create_form" } {/capture} {include file = "includes/generic-create-dialog.html" dialog_id = "creation_dialog" dialog_title = {intl l="Create a new product template"} dialog_body = {$smarty.capture.creation_dialog nofilter} dialog_ok_label = {intl l="Create this product template"} form_action = {url path='/admin/configuration/templates/create'} form_enctype = {form_enctype} form_error_message = $form_error_message } {/form} {* Delete confirmation dialog *} {capture "delete_dialog"} {hook name="template.delete-form" location="template_delete_form" } {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "delete_dialog" dialog_title = {intl l="Delete template"} dialog_message = {intl l="Do you really want to delete this template ? It will be removed from all products."} form_action = {token_url path='/admin/configuration/templates/delete'} form_content = {$smarty.capture.delete_dialog nofilter} } {/block} {block name="javascript-initialization"}
{/block} {block name="javascript-last-call"} {hook name="templates.js" location="templates-js" } {/block}