{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="nom">
            <a href={if $order=="nom" && $sens=="ASC"}"?order=nom&sens=DESC"
                {else}"?order=nom&sens=ASC"{/if} style="text-decoration: none;">
                nom{if $order=="nom"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if}
            </a>
        </th>
        <th class="visible-md visible-lg tarif">
            <a href={if $order=="tarif" && $sens=="ASC"}"?order=tarif&sens=DESC"
                {else}"?order=tarif&sens=ASC"{/if} style="text-decoration: none;">
                tarif{if $order=="tarif"} <i class="glyphicon glyphicon-chevron-{if $sens=="ASC"}up{else}down{/if}"></i>{/if}
            </a>
        </th>
        <th class="visible-md visible-lg center date">
            <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="btn_action right" colspan="2"><button class="btn btn-xs btn-info glyphicon glyphicon-plus" id="btnAddLegume"></button></th>
    </thead>
    <tbody class="table progressLoadList" id="legumesList" start="{$list_limits.start}" end="{$list_limits.end}" rest="{$list_limits.rest}">
    {include file='legumes/legumes_list_builder.tpl'}
    </tbody>
</table>

{include file='legumes/legume_modal_view.tpl'}

<!-- MODAL ADD LEGUME -->
<div class="modal fade add" id="modalAddLegume" 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/legumes.svg">
                    Ajouter un légume
                </h2>
            </div>
            <div class="modal-body">
                <form class="formLegume">
                    {include file='legumes/legume_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 LEGUME -->

<!-- MODAL EDIT LEGUME -->
<div class="modal fade edit" id="modalEditLegume" 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/legumes.svg">
                    Modifier un légume
                </h2>
            </div>
            <div class="modal-body">
                <form class="formLegume">
                    {include file='legumes/legume_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 LEGUME -->

<!-- MODAL DELETE LEGUME -->
<div class="modal fade delete" id="modalDeleteLegume" 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/legumes.svg">
                    Supprimer un légume
                </h2>
            </div>
            <div class="modal-body">
                <p>Etes-vous sûr de vouloir supprimer le légume <b class="name">NAME</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 LEGUME -->

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