{if !$frameDisplay}{include file='structure/top.tpl'}{/if}

<table class="table table-hover scrollingTableList">
    <thead>
        <th class="center visible-lg id">
            <a href={if $order=="ref" && $sens=="ASC"}"?order=ref&sens=DESC"
                {else}"?order=ref&sens=ASC"{/if} style="text-decoration: none;">
                #{if $order=="ref"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if}
            </a>
        </th>
        <th class="visible-md visible-lg groupe center">
            <a href={if $order=="paniers_groupe" && $sens=="ASC"}"?order=paniers_groupe&sens=DESC"
                {else}"?order=paniers_groupe&sens=ASC"{/if} style="text-decoration: none;">
                groupe{if $order=="paniers_groupe"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if}
            </a>
        </th>
        <th class="name">
            <a href={if $order=="date" && $sens=="ASC"}"?order=date&sens=DESC"
                {else}"?order=date&sens=ASC"{/if} style="text-decoration: none;">
                date{if $order=="date"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if}
            </a>
        </th>
        <th class="visible-md visible-lg quinz_group">
            <a href={if $order=="quinz_groupe" && $sens=="ASC"}"?order=quinz_groupe&sens=DESC"
                {else}"?order=quinz_groupe&sens=ASC"{/if} style="text-decoration: none;">
                groupe quinzaine{if $order=="quinz_groupe"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if}
            </a>
        </th>
        <th class="visible-md visible-lg items_long center">
            <a href={if $order=="nb_paniers" && $sens=="ASC"}"?order=nb_paniers&sens=DESC"
                {else}"?order=nb_paniers&sens=ASC"{/if} style="text-decoration: none;">
                nb. de paniers{if $order=="nb_paniers"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if}
            </a>
        </th>
        <th class="btn_action right" colspan="3"><button class="btn btn-xs btn-info glyphicon glyphicon-plus" id="btnAddLivraison"></button></th>
    </thead>
    <tbody class="table progressLoadList" id="livraisonsList" start="{$list_limits.start}" end="{$list_limits.end}" rest="{$list_limits.rest}">
    {include file='livraisons/livraisons_list_builder.tpl'}
    </tbody>
</table>

{include file='livraisons/livraison_modal_view.tpl'}

<!-- MODAL ADD LIVRAISON -->
<div class="modal fade" id="modalAddLivraison" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <div class="pull-right hidden-xs">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Annuler</button>
                    <button type="button" class="btn btn-custom btnSave">Enregistrer</button>
                </div>

                <h2 class="modal-title">
                    <img style="width:50px;" class="hidden-xs" src="img/livraison.svg">
                    Ajouter une livraison
                </h2>
            </div>
            <div class="modal-body">
                <form class="formLivraison">
                    {include file='livraisons/livraison_form.tpl'}
                </form>
            </div>
            <div class="modal-footer visible-xs">
                <div class="pull-right">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Annuler</button>
                    <button type="button" class="btn btn-custom btnSave">Enregistrer</button>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- end MODAL ADD LIVRAISON -->

<!-- MODAL EDIT LIVRAISON -->
<div class="modal fade" id="modalEditLivraison" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <div class="pull-right hidden-xs">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Annuler</button>
                    <button type="button" class="btn btn-custom btnSave">Enregistrer</button>
                </div>

                <h2 class="modal-title">
                    <img style="width:50px;" class="hidden-xs" src="img/livraison.svg">
                    Modifier une livraison
                </h2>
            </div>
            <div class="modal-body">
                <form class="formLivraison">
                    {include file='livraisons/livraison_form.tpl'}
                </form>
            </div>
            <div class="modal-footer visible-xs">
                <div class="pull-right">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Annuler</button>
                    <button type="button" class="btn btn-custom btnSave">Enregistrer</button>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- end MODAL EDIT LIVRAISON -->

<!-- MODAL ARCHIVE LIVRAISON -->
<div class="modal fade" id="modalArchiveLivraison" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h2 class="modal-title">
                    <img style="width:50px;" class="hidden-xs" src="img/livraison.svg">
                    Archiver une livraison
                </h2>
            </div>
            <div class="modal-body">
                <p>Etes-vous sûr de vouloir archiver la livraison <b class="groupe">groupe</b> du <b class="date">date</b> ?</p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Annuler</button>
                <button type="button" class="btn btn-warning btnSave">Confirmer</button>
            </div>
        </div>
    </div>
</div>
<!-- end MODAL ARCHIVE LIVRAISON -->

<!-- MODAL DELETE LIVRAISON -->
<div class="modal fade" id="modalDeleteLivraison" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h2 class="modal-title">
                    <img style="width:50px;" class="hidden-xs" src="img/livraison.svg">
                    Supprimer une livraison
                </h2>
            </div>
            <div class="modal-body">
                <p>Etes-vous sûr de vouloir supprimer la livraison du <b class="date">date</b> ?</p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Annuler</button>
                <button type="button" class="btn btn-danger btnSave">Confirmer</button>
            </div>
        </div>
    </div>
</div>
<!-- end MODAL DELETE LIVRAISON -->

{if !$frameDisplay}{include file='structure/bottom.tpl'}{/if}