{extends file="admin-layout.tpl"} {block name="no-return-functions"} {$admin_current_location = 'configuration'} {/block} {block name="page-title"}{intl l='Countries'}{/block} {block name="check-resource"}admin.configuration.country{/block} {block name="check-access"}view{/block} {block name="main-content"}
{hook name="countries.top" location="countries_top" }
{ifloop rel="country-not-in-any-zone"}
{intl l='Warning, some of your countries are not included in any shipping zone:'} {loop name="country-not-in-any-zone" type="country" with_area=false} {$TITLE}{if $LOOP_COUNT < $LOOP_TOTAL},{else}.{/if} {/loop}
{/ifloop}
{hook name="countries.table-header" location="countries_table_header" } {loop name="countries" type="country" backend_context="1" lang=$lang_id order=$order|default:null visible="*"} {hook name="countries.table-row" location="countries_table_row" country_id={$ID} } {/loop} {elseloop rel="countries"} {/elseloop}
{intl l='Countries'} {include file='renderer/buttons.html' btn_group=false buttons=[ [ 'type' => 'create', 'class' => 'action-btn', 'title' => {intl l='admin.configuration.country'}, 'href' => '#add_country_dialog', 'auth' => ['resource' => 'admin.configuration.country'], 'data' => [ 'toggle' => 'modal' ] ] ]}
{intl l="ID"} {intl l="Name"} {intl l="Default"} {intl l="N° ISO"} {intl l="ISO Code"} {intl l="Shipping zone"} {intl l="Visible"}{intl l='Actions'}
{$ID} {$TITLE}
{$ISOCODE} {$ISOALPHA3} {loop type="area" name="country-area" country={$ID} group_by_country_area=1} {$NAME}{if $LOOP_COUNT < $LOOP_TOTAL},{/if} {/loop} {elseloop rel="country-area"} {intl l='None'} {/elseloop} {loop type="auth" name="can_change" role="ADMIN" resource="admin.country" access="UPDATE"}
{/loop} {elseloop rel="can_change"}
{/elseloop}
{include file='renderer/buttons.html' buttons=[ [ 'type' => 'edit', 'class' => 'country-change', 'title' => {intl l='Change this country'}, 'href' => {url path="/admin/configuration/country/update/%id" id=$ID}, 'auth' => ['resource' => 'admin.configuration.country'] ], [ 'type' => 'delete', 'class' => 'country-delete', 'title' => {intl l='Delete this country'}, 'href' => '#delete_dialog', 'data' => [ 'id' => $ID, 'toggle' => 'modal' ], 'auth' => ['resource' => 'admin.configuration.country'] ] ]}
{intl l="No country has been created yet. Click the + button to create one."}
{hook name="countries.bottom" location="countries_bottom" }
{* Adding a new Country *} {form name="thelia.admin.country.creation"} {* Capture the dialog body, to pass it to the generic dialog *} {capture "country_creation_dialog"} {form_hidden_fields exclude="locale"} {* on success, redirect to the edition page, _ID_ is replaced with the created object ID, see controller *} {render_form_field field='success_url' value="{url path='/admin/configuration/country/update/_ID_'}"} {custom_render_form_field field="title"} {loop type="lang" name="default-lang" default_only="1"} {* Switch edition to the current locale *} {render_form_field field="locale" value=$LOCALE}
{$TITLE}
{/loop} {/custom_render_form_field} {render_form_field field="isocode"} {render_form_field field="isoalpha2"} {render_form_field field="isoalpha3"} {custom_render_form_field field="visible"} {$label} {/custom_render_form_field} {custom_render_form_field field="has_states"} {$label} {/custom_render_form_field} {hook name="country.create-form" location="country_create_form" } {/capture} {include file = "includes/generic-create-dialog.html" dialog_id = "add_country_dialog" dialog_title = {intl l="Create a new country"} dialog_body = {$smarty.capture.country_creation_dialog nofilter} dialog_ok_label = {intl l="Create this country"} dialog_cancel_label = {intl l="Cancel"} form_action = {url path='/admin/configuration/countries/create'} form_enctype = {form_enctype} form_error_message = $form_error_message } {/form} {* Delete confirmation dialog *} {capture "delete_dialog"} {hook name="country.delete-form" location="country_delete_form" } {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "delete_dialog" dialog_title = {intl l="Delete country"} dialog_message = {intl l="Do you really want to delete this country ?"} form_action = {token_url path='/admin/configuration/countries/delete'} form_content = {$smarty.capture.delete_dialog nofilter} } {/block} {block name="javascript-initialization"} {javascripts file='assets/js/bootstrap-switch/bootstrap-switch.js'} {/javascripts} {/block} {block name="javascript-last-call"} {hook name="countries.js" location="countries-js" } {/block}