@using CD67.FicheCollege.MVC.Models
@model AnneeViewModel

<title>Restauration @Model.Annee_Lib</title>

@{
    ViewBag.Title = "Restauration " + @Model.Annee_Lib;
    Layout = "~/Views/Shared/_Layout.cshtml";
    College college_model = new College();
    bool ouverture = ViewBag.Ouverture;
}

<header>
    <h2>La restauration</h2>
    <span>
        <a class="start-trace" href="@Url.Action("Edit", "RestaurationParametres", new { annee_id = Model.Annee_Id })"> <span class="glyphicon glyphicon-cog color1"></span> Paramètres</a>
        <a class="start-trace" href="@Url.Action("Index", "RestaurationTypeRepas")"> <span class="glyphicon glyphicon-cog color1"></span> Repas</a>
        <a class="start-trace" href="@Url.Action("Index", "RestaurationTypes")"> <span class="glyphicon glyphicon-cog color1"></span> Types</a>
    </span>
</header>


@if (ouverture == true)
{
    <h4>Ouverture de la campagne de saisie <a href="@Url.Action("EditCampagne", "RestaurationParametres", new { annee_id = Model.Annee_Id, edit = false })">  <span class="fa fa-toggle-on color1"></span> </a></h4><br />
}
else
{
    <h4>Ouverture de la campagne de saisie <a href = "@Url.Action("EditCampagne", "RestaurationParametres", new { annee_id = Model.Annee_Id, edit = true })" >  <span class="fa fa-toggle-off color1"></span> </a></h4><br />
}
<table id="table-actions" class="datatable table">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => college_model.CodeRne)
            </th>
            <th>
                @Html.DisplayNameFor(model => college_model.Libelle)
            </th>
            <th>
                Adresse complète
            </th>
            <th>
                @Html.DisplayNameFor(model => college_model.RestaurationType_Id)
            </th>
            <th>
                Actions
            </th>
        </tr>
    </thead>
    <tbody>
        @foreach (College college in Model.Obj.Colleges)
        {
        <tr data-url="@Url.Action("Details", new { id = college.Id })">

                <td>
                    @Html.DisplayFor(modelcollege => college.CodeRne)
                </td>
                <td>
                    @Html.DisplayFor(modelcollege => college.Libelle)
                    <noscript>
                        @Html.ActionLink(" > Voir", "Details", new { id = college.Id })
                    </noscript>
                </td>
                <td>
                    @Html.DisplayFor(modelcollege => college.AdresseComplete)
                </td>
                <td>
                    @Html.DisplayFor(modelcollege => college.RestaurationType.Libelle)<br />
                </td>
                <td>
                    <a href="@Url.Action("Type", "Colleges", new { id = college.Id })">
                        <span class="glyphicon glyphicon-pencil fa-2x color1" title="Modifier" style="vertical-align: middle" aria-hidden="true"></span>
                    </a>
                </td>
        </tr>
        }
    </tbody>
</table>