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

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

@{
    ViewBag.Title = "Les Actions Educatives " + Model.Annee_Lib;
    Layout = "~/Views/Shared/_Layout.cshtml";
    ActionEdu action_model = new ActionEdu();
}

<header>
    <h2>Les Actions</h2>
    <span class="mask-ss">
        <a href="@Url.Action("Create", new { annee_id = Model.Obj.Id })"> <span class="glyphicon glyphicon-plus-sign color1"></span> Nouvelle Action</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", "ActionEduAxes")"> <span class="glyphicon glyphicon-cog color1"></span> Axes</a>
        <a class="start-trace" href="@Url.Action("Index", "ActionEduThematiques")"> <span class="glyphicon glyphicon-cog color1"></span> Thématiques</a>
    </span>
</header>

<table id="table-actions" class="datatable table" data-order="[[ 0, &quot;asc&quot; ]]">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => action_model.Numero)
            </th>
            <th>
                @Html.DisplayNameFor(model => action_model.Nom)
            </th>
            <th>
                Axe
            </th>
            <th>
                Thematique
            </th>
            <th>
                Nb.Collèges
            </th>
            <th>
                Nb.Elèves
            </th>
            <th>
                @Html.DisplayNameFor(model => action_model.ActionEduStatut.Nom)
            </th>
            <noscript>
                <th style="width:1px">
                </th>
            </noscript>
        </tr>
    </thead>
    <tbody>
        @foreach (ActionEdu item in Model.Obj.ActionsEdu.OrderBy(a => a.Numero))
        {
            <tr data-url="@Url.Action("Details", new { id = item.Id })">
                <td>
                    @Html.DisplayFor(model => item.Numero)
                </td>
                <td>
                    @Html.DisplayFor(model => item.Nom)

                </td>
                <td>
                    @Html.DisplayFor(model => item.ActionEduThematique.ActionEduAxe.Nom)
                </td>
                <td>
                    @Html.DisplayFor(model => item.ActionEduThematique.Nom)
                </td>
                <td>
                    @item.ActionsEduColleges.Count().ToString()
                </td>
                <td>
                    @Html.DisplayFor(model => item.totalEleves)
                </td>
                <td>
                    @Html.DisplayFor(model => item.ActionEduStatut.Nom)
                </td>
                <noscript>
                    <td>
                        @Html.ActionLink("Voir", "Details", new { id = item.Id })
                    </td>
                </noscript>
            </tr>
        }
    </tbody>
</table>