Index.cshtml 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. @using CD67.FicheCollege.MVC.Models
  2. @model AnneeViewModel
  3. @{
  4. ViewBag.Title = "Liste";
  5. Layout = "~/Views/Shared/_Layout.cshtml";
  6. ActionEdu action_model = new ActionEdu();
  7. int maxOrdre = Model.Obj.ActionsEdu.Count() == 0 ? 0 : Model.Obj.ActionsEdu.Max(i => i.Ordre);
  8. int row = 1;
  9. }
  10. <h2>Liste</h2>
  11. <p>
  12. <a href="@Url.Action("Create", new { annee_id = Model.Obj.Id })">
  13. <span class="glyphicon glyphicon-plus-sign fa-2x color1" style="vertical-align: middle" aria-hidden="true"></span>
  14. Créer un nouvel élément
  15. </a>
  16. </p>
  17. <table class="table">
  18. <tr>
  19. <th>
  20. @Html.DisplayNameFor(model => action_model.Nom)
  21. </th>
  22. <th>
  23. @Html.DisplayNameFor(model => action_model.Description)
  24. </th>
  25. <th>
  26. @Html.DisplayNameFor(model => action_model.Neutralise)
  27. </th>
  28. <th>
  29. @Html.DisplayNameFor(model => action_model.ActionEduThematique.ActionEduAxeId)
  30. </th>
  31. <th>
  32. @Html.DisplayNameFor(model => action_model.ActionEduThematiqueId)
  33. </th>
  34. <th></th>
  35. </tr>
  36. @foreach (ActionEdu item in Model.Obj.ActionsEdu.OrderBy(i=>i.Ordre))
  37. {
  38. <tr>
  39. <td>
  40. @Html.DisplayFor(modelItem => item.Nom)
  41. </td>
  42. <td>
  43. @Html.DisplayFor(modelItem => item.Description)
  44. </td>
  45. <td>
  46. @Html.DisplayFor(modelItem => item.Neutralise)
  47. </td>
  48. <th>
  49. @Html.DisplayFor(model => item.ActionEduThematique.ActionEduAxeId)
  50. </th>
  51. <th>
  52. @Html.DisplayFor(model => item.ActionEduThematiqueId)
  53. </th>
  54. <td>
  55. @if (row != 1)
  56. {
  57. <a href="@Url.Action("Up", new { id = item.Id })">
  58. <span class="glyphicon glyphicon-circle-arrow-up fa-2x color1" title="Remonter" style="vertical-align: middle" aria-hidden="true"></span>
  59. </a>
  60. }
  61. else
  62. {
  63. <span class="glyphicon glyphicon-circle-arrow-up fa-2x color2" title="Remonter" style="vertical-align: middle" aria-hidden="true"></span>
  64. }
  65. @if (item.Ordre != maxOrdre)
  66. {
  67. <a href="@Url.Action("Down", new { id = item.Id })">
  68. <span class="glyphicon glyphicon-circle-arrow-down fa-2x color1" title="Descendre" style="vertical-align: middle" aria-hidden="true"></span>
  69. </a>
  70. }
  71. else
  72. {
  73. <span class="glyphicon glyphicon-circle-arrow-down fa-2x color2" title="Descendre" style="vertical-align: middle" aria-hidden="true"></span>
  74. }
  75. <a href="@Url.Action("Edit", new { id = item.Id })">
  76. <span class="glyphicon glyphicon-edit fa-2x color1" title="Modifier" style="vertical-align: middle" aria-hidden="true"></span>
  77. </a>
  78. <a href="@Url.Action("Delete", new { id = item.Id })">
  79. <span class="glyphicon glyphicon-remove-sign fa-2x color1" title="Supprimer" style="vertical-align: middle" aria-hidden="true"></span>
  80. </a>
  81. </td>
  82. </tr>
  83. row += 1;
  84. }
  85. </table>