{extends file="admin-layout.tpl"} {block name="no-return-functions"} {$admin_current_location = 'configuration'} {/block} {block name="page-title"}{intl l='Administration profiles'}{/block} {block name="check-resource"}admin.configuration.profile{/block} {block name="check-access"}view{/block} {block name="main-content"}
{hook name="profiles.top" location="profiles_top" }
{hook name="profile.table-header"} {loop type="profile" name="profiles" backend_context="1"} {$can_change = false} {loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.profile" access="UPDATE"} {$can_change = true} {/loop} {hook name="profile.table-row" profile_id=$ID} {/loop} {elseloop rel="profiles"} {/elseloop}
{intl l="Administration profiles"} {include file='renderer/buttons.html' btn_group=false buttons=[ [ 'type' => 'create', 'class' => 'action-btn', 'title' => {intl l='Create a new profile'}, 'href' => '#profile_create_dialog', 'auth' => ['resource' => 'admin.profile'], 'data' => [ 'toggle' => 'modal' ] ] ]}
{intl l="Code"} {intl l="Name"} {intl l="Description"}{intl l="Actions"}
{if $can_change} {$CODE} {else} {$CODE} {/if} {if $can_change} {$TITLE} {else} {$TITLE} {/if} {$DESCRIPTION} {$buttons = []} {if $can_change} {$buttons[] = [ 'type' => 'edit', 'title' => {intl l='Change this profile'}, 'href' => {url path="/admin/configuration/profiles/update/%id" id=$ID}, 'auth' => ['resource' => 'admin.configuration.profile'] ]} {/if} {assign linkedAdminCount {count name="linked-admin" type="admin" profile=$ID}} {if $linkedAdminCount > 0}{$href = "#profile_cannot_delete_dialog"}{else}{$href="#profile_delete_dialog"}{/if} {$buttons[] = [ 'type' => 'delete', 'class' => 'js-delete-profile', 'title' => {intl l='Delete this profile'}, 'href' => $href, 'data' => [ 'id' => $ID, 'toggle' => 'modal' ], 'auth' => ['resource' => 'admin.configuration.profile'] ]} {include file='renderer/buttons.html' buttons=$buttons}
{intl l="No administration profile defined yet. Click the + button to create one."}
{hook name="profiles.bottom" location="profiles_bottom" }
{* -- Add profile confirmation dialog ----------------------------------- *} {form name="thelia.admin.profile.add"} {if $form_error_message} {$profileCreateError = true} {else} {$profileCreateError = false} {/if} {* Capture the dialog body, to pass it to the generic dialog *} {capture "profile_create_dialog"} {form_hidden_fields} {loop type="lang" name="current-edit-lang" default_only="1"}
{$TITLE} {intl l="Enter information in the default language (%title)" title={$TITLE}}
{form_field field='locale'} {/form_field} {/loop} {form_field field='code'}
{/form_field} {form_field field='title'}
{/form_field} {form_field field='chapo'}
{/form_field} {form_field field='description'}
{/form_field} {form_field field='postscriptum'}
{/form_field} {hook name="profile.create-form" location="profile_create_form" } {/capture} {include file = "includes/generic-create-dialog.html" dialog_id = "profile_create_dialog" dialog_title = {intl l="Create a new profile"} dialog_body = {$smarty.capture.profile_create_dialog nofilter} dialog_ok_label = {intl l="Create"} dialog_cancel_label = {intl l="Cancel"} form_action = {url path="/admin/configuration/profiles/add"} form_enctype = {form_enctype} form_error_message = $form_error_message } {/form} {* -- Delete profile confirmation dialog ----------------------------------- *} {capture "profile_delete_dialog"} {hook name="profile.delete-form" location="profile_delete_form" } {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "profile_delete_dialog" dialog_title = {intl l="Delete profile"} dialog_message = {intl l="Do you really want to delete this profile ?"} form_action = {token_url path='/admin/configuration/profiles/delete'} form_content = {$smarty.capture.profile_delete_dialog nofilter} } {include file = "includes/generic-warning-dialog.html" dialog_id = "profile_cannot_delete_dialog" dialog_title = {intl l="You can't delete this profile"} dialog_body = {intl l="They are some administrator which are linked to this profile. Please edit/remove them before deleting this profile."} } {/block} {block name="javascript-initialization"} {javascripts file='assets/js/bootstrap-select/bootstrap-select.js'} {/javascripts} {/block} {block name="javascript-last-call"} {hook name="profiles.js" location="profiles-js" } {hook name="wysiwyg.js" location="wysiwyg-profiles-js" } {/block}