Browse Source

ActionsEduCollege Crud: style ok

olivier.massot 7 năm trước cách đây
mục cha
commit
f8594fc63a

+ 5 - 6
CD67.FicheCollege.Entity/Extend/ActionEduCollege.cs

@@ -1,9 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.ComponentModel.DataAnnotations;
 
 namespace CD67.FicheCollege.Entity
 {
@@ -24,9 +19,11 @@ namespace CD67.FicheCollege.Entity
         public int Id { get; set; }
 
         [Required]
+        [Display(Name = "Action éducative")]
         public int ActionEduId { get; set; }
 
         [Required]
+        [Display(Name = "Collège")]
         public int CollegeId { get; set; }
 
         [Display(Name = "Nombre d'élèves")]
@@ -35,9 +32,11 @@ namespace CD67.FicheCollege.Entity
         [Display(Name = "Montant")]
         public int Montant { get; set; }
 
+        [DataType(DataType.MultilineText)]
         [Display(Name = "Commentaire (interne)")]
         public int CommentaireInterne { get; set; }
 
+        [DataType(DataType.MultilineText)]
         [Display(Name = "Commentaire (public)")]
         public int CommentairePublic { get; set; }
 

+ 4 - 3
CD67.FicheCollege.MVC/Views/ActionsEduCollege/Create.cshtml

@@ -7,13 +7,15 @@
     ActionEduCollege actionEduCollege = Model.Obj;
 }
 
+<header>
+    <h2>Action '@actionEduCollege.ActionEdu.Nom': Affecter à un collège</h2>
+</header>
+
 @using (Html.BeginForm()) 
 {
     @Html.AntiForgeryToken()
     
     <div class="form-horizontal">
-        <h4>Actions</h4>
-        <hr />
         @Html.ValidationSummary(true, "", new { @class = "text-danger" })
         @Html.HiddenFor(model => actionEduCollege.Id)
         @Html.HiddenFor(model => actionEduCollege.ActionEduId)
@@ -58,7 +60,6 @@
             </div>
         </div>
 
-
         <div class="form-group">
             <div class="col-md-offset-2 col-md-10">
                 <input type="submit" value="Créer" class="btn btn-default" />

+ 12 - 12
CD67.FicheCollege.MVC/Views/ActionsEduCollege/Delete.cshtml

@@ -7,12 +7,12 @@
     ActionEduCollege actionEduCollege = Model.Obj;
 }
 
-<h2>Suppression</h2>
+<header>
+    <h2>Suppression</h2>
+</header>
 
-<h3>Voulez-vous vraiment supprimer cet élément?</h3>
+<h3>Voulez-vous vraiment supprimer cette affectation de l'action '@actionEduCollege.ActionEdu.Nom'?</h3>
 <div>
-    <h4>Action</h4>
-    <hr />
     <dl class="dl-horizontal">
         <dt>
             @Html.DisplayNameFor(model => actionEduCollege.College.Libelle)
@@ -20,20 +20,20 @@
         <dd>
             @Html.DisplayFor(model => actionEduCollege.College.Libelle)
         </dd>
-        <dt>
-            @Html.DisplayNameFor(model => actionEduCollege.ActionEdu.Nom)
-        </dt>
-        <dd>
-            @Html.DisplayFor(model => actionEduCollege.ActionEdu.Nom)
-        </dd>
+
     </dl>
 
     @using (Html.BeginForm()) {
         @Html.AntiForgeryToken()
 
         <div class="form-actions no-color">
-            <input type="submit" value="Supprimer" class="btn btn-default" /> |
-            @Html.ActionLink("Retour à la liste", "Index")
+            <input type="submit" value="Supprimer" class="btn btn-default" />
+            
         </div>
     }
 </div>
+
+<br/>
+<div>
+    @Html.ActionLink("Annuler", "Details", new { id = actionEduCollege.Id })
+</div>

+ 7 - 7
CD67.FicheCollege.MVC/Views/ActionsEduCollege/Details.cshtml

@@ -7,13 +7,10 @@
     ActionEduCollege actionEduCollege = Model.Obj;
 }
 
-<h1>Les Actions</h1>
-
-<div>
-    @Html.ActionLink("Retour", "Details", "ActionsEdu", new { id = actionEduCollege.ActionEdu.Id }, new { @class = "btn btn-default" })
-</div>
-
-<h2>@actionEduCollege.ActionEdu.Nom,  collège @actionEduCollege.College.Libelle</h2>
+<header>
+    <h2>Action Educative '@actionEduCollege.ActionEdu.Nom' à @actionEduCollege.College.Libelle</h2>
+    
+</header>
 
 <fieldset>
     <legend>
@@ -40,3 +37,6 @@
         <dd>@Html.DisplayFor(model => actionEduCollege.CommentairePublic)</dd>
     </dl>
 </fieldset>
+
+
+<a href="@Url.Action("Details", "ActionsEdu", new { id = actionEduCollege.ActionEdu.Id })">Retour à l'index</a>

+ 4 - 0
CD67.FicheCollege.MVC/Views/ActionsEduCollege/Edit.cshtml

@@ -7,6 +7,10 @@
     ActionEduCollege actionEduCollege = Model.Obj;
 }
 
+<header>
+    <h2>Action '@actionEduCollege.ActionEdu.Nom': Affecter à un collège</h2>
+</header>
+
 @using (Html.BeginForm()) 
 {
     @Html.AntiForgeryToken()

+ 0 - 36
CD67.FicheCollege.MVC/Views/ActionsEduCollege/Index.cshtml

@@ -1,36 +0,0 @@
-@using CD67.FicheCollege.MVC.Models
-@model AnneeViewModel
-
-<title>Actions @Model.Annee_Lib</title>
-
-@{
-    ViewBag.Title = "Actions " + @Model.Annee_Lib;
-    Layout = "~/Views/Shared/_Layout.cshtml";
-    ActionEdu action_model = new ActionEdu();
-}
-
-<h2>Index</h2>
-
-<h3>Affectation</h3>
-
-@foreach (ActionEdu item in Model.Obj.ActionsEdu.OrderBy(a => a.Ordre))
-{
-    <div>
-        @Html.DisplayFor(modelItem => item.ActionEduThematique.ActionEduAxe.Nom)
-        @Html.DisplayFor(modelItem => item.ActionEduThematique.Nom)
-        @Html.DisplayFor(modelItem => item.Nom)
-
-        <i>Collèges concernés: @item.ActionsEduColleges.Count()</i>
-        <a href="@Url.Action("Details", new { id = item.Id })">
-            <span class="glyphicon glyphicon-plus-sign fa-2x color1" title="Voir" style="vertical-align: middle" aria-hidden="true"></span>
-        </a>
-    </div>
-}
-
-
-<h3>Administration</h3>
-
-<ul>
-    <li>@Html.ActionLink("Les axes", "Index", "ActionEduAxes")</li>
-    <li>@Html.ActionLink("Les thématiques", "Index", "ActionEduThematiques")</li>
-</ul>