{extends file="admin-layout.tpl"} {block name="no-return-functions"} {$admin_current_location = 'configuration'} {/block} {block name="page-title"}{intl l='Back-office users'}{/block} {block name="check-resource"}admin.configuration.administrator{/block} {block name="check-access"}view{/block} {block name="main-content"}
{hook name="administrators.top" location="administrators_top" }

{intl l="Administrators"} {loop type="auth" name="can_create" role="ADMIN" resource="admin.administrator" access="CREATE"} {/loop}
{intl l="Login"} | {intl l="First Name"} | {intl l="Last Name"} | {intl l="E-mail"} | {intl l="Locale"} | {intl l="Profile"} {hook name="administrators.header" location="administrator_list_header" } | {intl l="Actions"}
--- | --- | --- | --- | --- | --- | ---
{loop type="admin" name="administrators" backend_context="1"} {* the current current admin can always update its own profile *} {$can_update = $ID == {admin attr="id"}} {loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.administrator" access="UPDATE"} {$can_update = true} {/loop}
{if $can_update} {$LOGIN} {else} {$LOGIN} {/if} | {$FIRSTNAME} | {$LASTNAME} {* Do not display invalid emails *} {if $EMAIL|strpos:'@'} | {$EMAIL} {else} | {intl l="No email defined"} {/if} | {$LOCALE} | {if $PROFILE} {loop type="profile" name="admin-profile" id={$PROFILE}} {$TITLE} {/loop} {else} {intl l='Superadministrator'} {/if} {hook name="administrators.row" location="administrator_list_row" admin_id={$ID}} | {* if admin is current admin : - can UPDATE anyway - cannot delete himself *} {if $can_update} {/if} {if $ID != {admin attr="id"}} {loop type="auth" name="can_delete" role="ADMIN" resource="admin.configuration.administrator" access="DELETE"} {/loop} {/if}
{/loop}

{hook name="administrators.bottom" location="administrators_bottom" }
{* -- Add administrator confirmation dialog ----------------------------------- *} {form name="thelia.admin.administrator.add"} {if $form_error_message} {$administratorCreateError = true} {else} {$administratorCreateError = false} {/if} {* Capture the dialog body, to pass it to the generic dialog *} {capture "administrator_create_dialog"} {form_hidden_fields}
{render_form_field field='login'} {render_form_field field='email'}
{render_form_field field='firstname'} {render_form_field field='lastname'}
{form_field field='password_confirm'} {$passwordError = $error} {/form_field}
{render_form_field field='password'}
{render_form_field field='password_confirm'}
{custom_render_form_field field="locale"}
{/custom_render_form_field}
{custom_render_form_field field="profile"}
{/custom_render_form_field}
{hook name="administrator.create-form" location="administrator_create_form" } {/capture} {include file = "includes/generic-create-dialog.html" dialog_id = "administrator_create_dialog" dialog_title = {intl l="Create a new administrator"} dialog_body = {$smarty.capture.administrator_create_dialog nofilter} dialog_ok_label = {intl l="Create"} dialog_cancel_label = {intl l="Cancel"} form_action = {url path="/admin/configuration/administrators/add"} form_enctype = {form_enctype} form_error_message = $form_error_message } {/form} {* -- Update administrator confirmation dialog ----------------------------------- *} {form name="thelia.admin.administrator.update"} {if $form_error_message} {$administratorUpdateError = true} {else} {$administratorUpdateError = false} {/if} {* Capture the dialog body, to pass it to the generic dialog *} {capture "administrator_update_dialog"} {form_hidden_fields} {if $show_email_change_notice}
{intl l="From Thelia 2.3, you have to add an email address to your administrator profile. Please enter your email address below."}
{/if}
{render_form_field field='login' extra_classes='js-login'} {render_form_field field='firstname' extra_classes='js-firstname'}
{custom_render_form_field field='email'} {/custom_render_form_field} {render_form_field field='lastname' extra_classes='js-lastname'}
{form_field field='password_confirm'} {$passwordError = $error} {/form_field}
{custom_render_form_field field='password'} {/custom_render_form_field}
{custom_render_form_field field='password_confirm'} {/custom_render_form_field}
{custom_render_form_field field="locale"}
{/custom_render_form_field}
{custom_render_form_field field="profile"}
{/custom_render_form_field}
{hook name="administrator.update-form" location="administrator_update_form" } {/capture} {include file = "includes/generic-create-dialog.html" dialog_id = "administrator_update_dialog" dialog_title = {intl l="Update an administrator"} dialog_body = {$smarty.capture.administrator_update_dialog nofilter} dialog_ok_label = {intl l="Update"} dialog_cancel_label = {intl l="Cancel"} form_action = {url path="/admin/configuration/administrators/save"} form_enctype = {form_enctype} form_error_message = $form_error_message } {/form} {* -- Delete administrator confirmation dialog ----------------------------------- *} {capture "administrator_delete_dialog"} {hook name="administrator.delete-form" location="administrator_delete_form" } {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "administrator_delete_dialog" dialog_title = {intl l="Delete administrator"} dialog_message = {intl l="Do you really want to delete this administrator ?"} form_action = {token_url path='/admin/configuration/administrators/delete'} form_content = {$smarty.capture.administrator_delete_dialog nofilter} } {include file = "includes/generic-warning-dialog.html" dialog_id = "administrator_cannot_delete_dialog" dialog_title = {intl l="You can't delete this administrator"} dialog_body = {intl l="They are some administrator which are linked to this administrator. Please edit/remove them before deleting this administrator."} } {/block} {block name="javascript-initialization"} {javascripts file='assets/js/bootstrap-select/bootstrap-select.js'}
{/javascripts}
{/block} {block name="javascript-last-call"} {hook name="administrators.js" location="administrators-js" } {if $show_update_dialog}
{/if} {/block}