Details.cshtml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. @using CD67.FicheCollege.MVC.Models
  2. @model CollegeViewModel
  3. @{
  4. ViewBag.Title = "Details";
  5. Layout = "~/Views/Shared/_Layout.cshtml";
  6. College college = Model.Obj;
  7. }
  8. <header>
  9. <h2>@college.Libelle</h2>
  10. </header>
  11. @if(Model.Acces==ModeAcces.Suppression) {
  12. <h2 class="text-danger">Voulez-vous vraiment supprimer cet élément?</h2>
  13. <p class="text-danger">
  14. Le collège ainsi que toutes les informations liées seront supprimées.
  15. </p>
  16. }
  17. <fieldset>
  18. <legend>
  19. Informations générales
  20. @if (Model.Acces == ModeAcces.Lecture)
  21. {
  22. <div class="pull-right">
  23. @Html.ActionLink("Supprimer", "Delete", "Colleges", new { Id = college.Id }, new { @class = "btn btn-danger" })
  24. @Html.ActionLink("Modifier", "Edit", "Colleges", new { Id = college.Id }, new { @class = "btn btn-default" })
  25. </div>
  26. }
  27. </legend>
  28. <dl class="dl-horizontal">
  29. <dt>
  30. @Html.DisplayNameFor(model => college.TypeCollege.Libelle)
  31. </dt>
  32. <dd>
  33. @Html.DisplayFor(model => college.TypeCollege.Libelle)
  34. </dd>
  35. <dt>
  36. @Html.DisplayNameFor(model => college.Adresse)
  37. </dt>
  38. <dd>
  39. @Html.DisplayFor(model => college.AdresseComplete)
  40. </dd>
  41. <dt>
  42. @Html.DisplayNameFor(model => college.Tel)
  43. </dt>
  44. <dd>
  45. @Html.DisplayFor(model => college.Tel)
  46. </dd>
  47. <dt>
  48. @Html.DisplayNameFor(model => college.Fax)
  49. </dt>
  50. <dd>
  51. @Html.DisplayFor(model => college.Fax)
  52. </dd>
  53. <dt>
  54. @Html.DisplayNameFor(model => college.Email)
  55. </dt>
  56. <dd>
  57. @Html.DisplayFor(model => college.Email)
  58. </dd>
  59. <dt>
  60. @Html.DisplayNameFor(model => college.Commune)
  61. </dt>
  62. <dd>
  63. @if (college.Commune != null)
  64. {
  65. <div class="col-sm-8 col-md-4">
  66. <div class="panel panel-default">
  67. <div class="panel-heading clearfix">
  68. <h4 class="panel-title pull-left" style="padding-top: 7.5px;">
  69. <i class="fa fa-map-marker color1" aria-hidden="true"></i>
  70. Localisation (commune)
  71. </h4>
  72. </div>
  73. <div class="panel-body" style="text-align: center;">
  74. <span style="white-space: pre-line;"><b>@college.Commune</b>
  75. Canton : @college.Canton
  76. TAD : @college.TAD
  77. CDC : @college.CDC
  78. </span>
  79. </div>
  80. </div>
  81. </div>
  82. }
  83. </dd>
  84. <dt>
  85. @Html.DisplayNameFor(model => college.Code_Postal)
  86. </dt>
  87. <dd>
  88. @Html.DisplayFor(model => college.Code_Postal)
  89. </dd>
  90. </dl>
  91. </fieldset>
  92. @if (Model.Acces == ModeAcces.Suppression)
  93. {
  94. using (Html.BeginForm())
  95. {
  96. @Html.AntiForgeryToken()
  97. <div class="form-actions no-color">
  98. <input type="submit" value="@Model.Acces.EnumDisplayNameFor(MvcHtmlHelpers.DisplayValue.Prompt)" class="btn btn-danger" />
  99. </div>
  100. <br/>
  101. <div>@Html.ActionLink("Annuler", "Details", new { Id = college.Id })</div>
  102. }
  103. }
  104. else
  105. {
  106. <div>
  107. @Html.ActionLink("Retour à la liste", "Index", new { annee_id = college.Annee_Id })
  108. </div>
  109. }