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

@{
    ViewBag.Title = "Les Collèges " + Model.Annee_Lib;
    Layout = "~/Views/Shared/_Layout.cshtml";
    College college_model = new College();
}

<header>
    <h2>Les Collèges</h2>
    <span class="mask-ss">
        <a href="@Url.Action("Create", new { annee_id = Model.Obj.Id })"> <span class="glyphicon glyphicon-plus-sign color1"></span> Nouveau collège</a>
        <a href="@Url.Action("Import", new { annee_id = Model.Obj.Id })"> <span class="glyphicon glyphicon-import color1"></span> Importer depuis @Model.Obj.AnneePrecLib</a>
        <a class="start-trace" href="@Url.Action("Index", "TypeCollege")"> <span class="glyphicon glyphicon-cog color1"></span> Types de collège</a>
        <a class="start-trace" href="@Url.Action("Index", "Territoire")"> <span class="glyphicon glyphicon-cog color1"></span> Territoires</a>
    </span>
</header>

<table id="table-colleges" class="datatable table" data-order="[[ 1, &quot;asc&quot; ]]">
    <thead>
        <tr>
            <th data-priority="1">
                RNE
            </th>
            <th data-priority="2">
                @Html.DisplayNameFor(model => college_model.Libelle)
            </th>
            <th data-priority="3">
                @Html.DisplayNameFor(model => college_model.Commune)
            </th>
            <th>
                @Html.DisplayNameFor(model => college_model.Tel)
            </th>
            <th>
                @Html.DisplayNameFor(model => college_model.Email)
            </th>
            <th>
                @Html.DisplayNameFor(model => college_model.TypeCollege.Libelle)
            </th>
            <noscript>
                <td style="width:1px">
                </td>
            </noscript>
        </tr>
    </thead>
    <tbody>
        @foreach (College college in Model.Obj.Colleges.OrderBy(c=>c.Libelle)) {
            <tr data-url="@Url.Action("Details", new { id = college.Id })">
                <td>
                    @Html.DisplayFor(modelcollege => college.CodeRne)
                </td>
                <td>
                    @Html.DisplayFor(modelcollege => college.Libelle)
                </td>
                <td>
                    @Html.DisplayFor(modelcollege => college.Commune)
                </td>
                <td>
                    @Html.DisplayFor(modelcollege => college.Tel)
                </td>
                <td>
                    @Html.DisplayFor(modelcollege => college.Email)
                </td>
                <td>
                    @Html.DisplayFor(modelcollege => college.TypeCollege.Libelle)
                </td>
                <noscript class="no-print">
                    <td>
                         @Html.ActionLink("Voir", "Details", new { id = college.Id })
                    </td>
                </noscript>
            </tr>
        }
    </tbody>

</table>

