<div class="row">
    <div class="col-md-12">
        <table class="table table-striped table-condensed">
            <caption class="clearfix">
                {loop name="auth-create" type="auth" role="ADMIN" resource="admin.dealer.schedules" access="CREATE" module="Dealer"}
                <div class="pull-right">
                    <a class="btn btn-default btn-primary dealer-schedules-default"
                       title="{intl l='Create a new Default Schedules' d='dealer.bo.default'}"
                       data-target="#dealer-schedules-create" data-toggle="modal">
                        <i class="glyphicon glyphicon-plus-sign"></i>
                    </a>
                </div>
                {/loop}
                <h4>{intl l="Delivery days" d="livraisonparsecteurs"}</h4>
            </caption>

            <thead>
            <tr>
                <th>
                    {intl l="Day" d="livraisonparsecteurs"}
                </th>
                <th>
                    {intl l="Begin" d="livraisonparsecteurs"}
                </th>
                <th>
                    {intl l="End" d="livraisonparsecteurs"}
                </th>
                <th>
                    {intl l="Actions" d="livraisonparsecteurs"}
                </th>
            </tr>
            </thead>

            <tbody>
            {loop name="dealer-schedules-defaults" type="lap_area_schedule" area_id=$area_id}
            <tr>
                <td>
                    {$DAY_LABEL}
                </td>
                <td>
                    {format_date date=$BEGIN format="H:i"}
                </td>
                <td>
                    {format_date date=$END format="H:i"}
                </td>
                {* Actions *}
                <td>
                    <div class="btn-group">
                        {loop name="auth-edit" type="auth" role="ADMIN" resource="admin.dealer.schedules" access="UPDATE" module="Dealer"}
                        <a class="btn btn-default btn-xs dealer-schedules-update-default"
                           title="{intl l='Modify this Schedule' d='dealer.bo.default'}"
                           data-target="#dealer-schedules-update" data-toggle="modal" data-id="{$ID}"
                           data-day="{$DAY}" data-begin="{format_date date=$BEGIN format="H:i"}"
                        data-end="{format_date date=$END format="H:i"}">
                        <i class="glyphicon glyphicon-edit"></i>
                        </a>
                        {/loop}
                        {loop name="auth-edit" type="auth" role="ADMIN" resource="admin.dealer.schedules" access="CREATE" module="Dealer"}
                        <a class="btn btn-default btn-xs dealer-schedules-clone"
                           title="{intl l='Clone this Schedule' d='dealer.bo.default'}"
                           data-target="#dealer-schedules-clone" data-toggle="modal" data-id="{$ID}">
                            <i class="glyphicon glyphicon-plus-sign"></i>
                        </a>
                        {/loop}
                        {loop name="auth-delete" type="auth" role="ADMIN" resource="admin.dealer.schedules" access="DELETE" module="Dealer"}
                        <a class="btn btn-default btn-xs dealer-schedules-delete"
                           title="{intl l='Delete this Schedule' d='dealer.bo.default'}"
                           data-target="#dealer-schedules-delete" data-toggle="modal" data-id="{$ID}">
                            <i class="glyphicon glyphicon-trash"></i>
                        </a>
                        {/loop}
                    </div>
                </td>
            </tr>
            {/loop}
            {elseloop rel="dealer-schedules-defaults"}
            <tr>
                <td colspan="1000">
                    <div class="alert alert-info">
                        {intl l="There is no Default Schedules" d="livraisonparsecteurs"}
                    </div>
                </td>
            </tr>
            {/elseloop}
            </tbody>


        </table>
    </div>
</div>