{extends file="admin-layout.tpl"}

{block name="page-title"}{intl l='My areas' d="livraisonparsecteurs"}{/block}

{block name="check-access"}update{/block}
{block name="check-module"}LivraisonParSecteurs{/block}

{block name="main-content"}
<div id="wrapper" class="container">
    {assign "area_id" $smarty.get.area_id}

    <div class="general-block-decorator">
        <div class="title title-without-tabs">
            {intl l='Edit an area' d='livraisonparsecteurs'}&nbsp;: <b>{loop name="area" type="lps_area" id={$area_id}}{$TITLE}{/loop}</b>
        </div>

        {hookblock name="area.tabs" area=$area_id}
        <ul class="nav nav-tabs" id="tabbed-menu">
            {loop name="auth-general" type="auth" role="ADMIN" resource="admin" access="VIEW" module="LivraisonParSecteurs"}
            <li class="active"><a href="#general" data-toggle="tab">{intl l="General" d="livraisonparsecteurs"}</a></li>
            {/loop}
            {loop name="auth-schedule" type="auth" role="ADMIN" resource="admin.schedule" access="VIEW" module="LivraisonParSecteurs"}
            <li><a href="#schedule" data-toggle="tab">{intl l="Schedule" d="livraisonparsecteurs"}</a></li>
            {/loop}
            {loop name="auth-cities" type="auth" role="ADMIN" resource="admin.cities" access="VIEW" module="LivraisonParSecteurs"}
            <li><a href="#cities" data-toggle="tab">{intl l="Cities" d="livraisonparsecteurs"}</a></li>
            {/loop}
        </ul>

        <div class="tab-content">
            {loop name="auth-general-tab" type="auth" role="ADMIN" resource="admin" access="VIEW" module="LivraisonParSecteurs"}
            <div class="tab-pane fade in active" id="general">
                {include file="includes/area-general.html"}
            </div>
            {/loop}
            {loop name="auth-schedule-tab" type="auth" role="ADMIN" resource="admin.schedule" access="VIEW" module="LivraisonParSecteurs"}
            <div class="tab-pane fade" id="schedule">
               {include file="includes/area-schedule.html"}
            </div>
            {/loop}
            {loop name="auth-cities-tab" type="auth" role="ADMIN" resource="admin.cities" access="VIEW" module="LivraisonParSecteurs"}
            <div class="tab-pane fade" id="cities">
                {include file="includes/area-cities.html"}
            </div>
            {/loop}
        </div>
        {/hookblock}
    </div>

</div>
{/block}

{block name="javascript-initialization"}
{javascripts file='assets/js/bootstrap-switch/bootstrap-switch.js'}
<script src="{$asset_url}"></script>
<script>
    $(function() {
        $(".toggle-active").on('switch-change', function (event, data) {
            $("#active").val(data['value'] ? 1 : 0);
        });
    });
</script>
{/javascripts}
{/block}
