Explorar o código

Refact: fusion des views create/edit

olivier.massot %!s(int64=7) %!d(string=hai) anos
pai
achega
46c2316c3f
Modificáronse 38 ficheiros con 178 adicións e 690 borrados
  1. 26 0
      CD67.FicheCollege.MVC/Content/cd67-custom.less
  2. 2 2
      CD67.FicheCollege.MVC/Controllers/ActionEduAxesController.cs
  3. 2 2
      CD67.FicheCollege.MVC/Controllers/ActionEduThematiquesController.cs
  4. 2 2
      CD67.FicheCollege.MVC/Controllers/ActionsEduActeursController.cs
  5. 2 2
      CD67.FicheCollege.MVC/Controllers/ActionsEduCollegeController.cs
  6. 2 2
      CD67.FicheCollege.MVC/Controllers/ActionsEduController.cs
  7. 0 22
      CD67.FicheCollege.MVC/Controllers/GestionActionsController.cs
  8. 2 2
      CD67.FicheCollege.MVC/Controllers/RestaurationTypeRepasController.cs
  9. 2 2
      CD67.FicheCollege.MVC/Controllers/RestaurationTypesController.cs
  10. 6 6
      CD67.FicheCollege.MVC/Controllers/TerritoireController.cs
  11. 7 7
      CD67.FicheCollege.MVC/Controllers/TypeCollegeController.cs
  12. 0 44
      CD67.FicheCollege.MVC/Views/ActionEduAxes/Create.cshtml
  13. 9 4
      CD67.FicheCollege.MVC/Views/ActionEduAxes/Edit.cshtml
  14. 2 2
      CD67.FicheCollege.MVC/Views/ActionEduAxes/Index.cshtml
  15. 0 52
      CD67.FicheCollege.MVC/Views/ActionEduThematiques/Create.cshtml
  16. 0 2
      CD67.FicheCollege.MVC/Views/ActionEduThematiques/Delete.cshtml
  17. 9 5
      CD67.FicheCollege.MVC/Views/ActionEduThematiques/Edit.cshtml
  18. 2 2
      CD67.FicheCollege.MVC/Views/ActionEduThematiques/Index.cshtml
  19. 0 114
      CD67.FicheCollege.MVC/Views/ActionsEdu/Create.cshtml
  20. 21 3
      CD67.FicheCollege.MVC/Views/ActionsEdu/Edit.cshtml
  21. 0 90
      CD67.FicheCollege.MVC/Views/ActionsEduActeurs/Create.cshtml
  22. 9 2
      CD67.FicheCollege.MVC/Views/ActionsEduActeurs/Edit.cshtml
  23. 0 52
      CD67.FicheCollege.MVC/Views/ActionsEduCollege/Create.cshtml
  24. 10 3
      CD67.FicheCollege.MVC/Views/ActionsEduCollege/Edit.cshtml
  25. 3 3
      CD67.FicheCollege.MVC/Views/Colleges/Edit.cshtml
  26. 3 7
      CD67.FicheCollege.MVC/Views/Colleges/Import.cshtml
  27. 4 9
      CD67.FicheCollege.MVC/Views/Colleges/Type.cshtml
  28. 0 43
      CD67.FicheCollege.MVC/Views/RestaurationTypeRepas/Create.cshtml
  29. 9 5
      CD67.FicheCollege.MVC/Views/RestaurationTypeRepas/Edit.cshtml
  30. 2 2
      CD67.FicheCollege.MVC/Views/RestaurationTypeRepas/Index.cshtml
  31. 0 43
      CD67.FicheCollege.MVC/Views/RestaurationTypes/Create.cshtml
  32. 9 5
      CD67.FicheCollege.MVC/Views/RestaurationTypes/Edit.cshtml
  33. 2 2
      CD67.FicheCollege.MVC/Views/RestaurationTypes/Index.cshtml
  34. 0 93
      CD67.FicheCollege.MVC/Views/Territoire/Create.cshtml
  35. 22 12
      CD67.FicheCollege.MVC/Views/Territoire/Edit.cshtml
  36. 0 35
      CD67.FicheCollege.MVC/Views/TypeCollege/Create.cshtml
  37. 0 2
      CD67.FicheCollege.MVC/Views/TypeCollege/Delete.cshtml
  38. 9 5
      CD67.FicheCollege.MVC/Views/TypeCollege/Edit.cshtml

+ 26 - 0
CD67.FicheCollege.MVC/Content/cd67-custom.less

@@ -1,6 +1,20 @@
 @color1 : #629DD1;
 @color2 : #23527c;
 
+/* Generique */
+.flex {
+    display: flex;
+}
+
+.flex-row {
+    display: flex;
+    flex-direction: row;
+}
+
+.flex-1 {
+    flex: 1;
+}
+
 /* Breadcrumb et mise en avant */
 .color1 {
     color: @color1;
@@ -267,3 +281,15 @@ header nav{
     color:#337ab7;
     font-size: 18px;
 }
+
+/* Formulaires */
+
+.btn-bar {
+    display: flex;
+    flex-direction: row;
+    justify-content: flex-end;
+}
+
+.btn-bar .btn {
+    margin-left: 15px;
+}

+ 2 - 2
CD67.FicheCollege.MVC/Controllers/ActionEduAxesController.cs

@@ -24,7 +24,7 @@ namespace CD67.FicheCollege.MVC.Controllers
             ActionEduAxe axe = new ActionEduAxe();
 
             ActionEduAxeViewModel model = new ActionEduAxeViewModel(axe, ModeAcces.Creation);
-            return View(model);
+            return View("Edit", model);
         }
 
         // POST: ActionEduAxe/Create
@@ -42,7 +42,7 @@ namespace CD67.FicheCollege.MVC.Controllers
             }
 
             ActionEduAxeViewModel model = new ActionEduAxeViewModel(axe, ModeAcces.Creation);
-            return View(model);
+            return View("Edit", model);
         }
 
         // GET: ActionEduAxe/Edit/5

+ 2 - 2
CD67.FicheCollege.MVC/Controllers/ActionEduThematiquesController.cs

@@ -23,7 +23,7 @@ namespace CD67.FicheCollege.MVC.Controllers
         {
             ActionEduThematique thematique = new ActionEduThematique();
             ActionEduThematiqueViewModel model = new ActionEduThematiqueViewModel(thematique, db, ModeAcces.Creation);
-            return View(model);
+            return View("Edit", model);
         }
 
         // POST: ActionEduThematique/Create
@@ -41,7 +41,7 @@ namespace CD67.FicheCollege.MVC.Controllers
             }
 
             ActionEduThematiqueViewModel model = new ActionEduThematiqueViewModel(thematique, db, ModeAcces.Creation);
-            return View(model);
+            return View("Edit", model);
         }
 
         // GET: ActionEduThematique/Edit/5

+ 2 - 2
CD67.FicheCollege.MVC/Controllers/ActionsEduActeursController.cs

@@ -44,7 +44,7 @@ namespace CD67.FicheCollege.MVC.Controllers
             actionEduActeur.ActionEdu = fact.getById(actionEdu_id);
 
             ActionEduActeurViewModel model = new ActionEduActeurViewModel(actionEduActeur, db, ModeAcces.Creation);
-            return View(model);
+            return View("Edit", model);
         }
 
         // POST: ActionEduAxe/Create
@@ -62,7 +62,7 @@ namespace CD67.FicheCollege.MVC.Controllers
             }
 
             ActionEduActeurViewModel model = new ActionEduActeurViewModel(actionEduActeur, db, ModeAcces.Creation);
-            return View(model);
+            return View("Edit", model);
         }
 
         // GET: ActionEduAxe/Edit/5

+ 2 - 2
CD67.FicheCollege.MVC/Controllers/ActionsEduCollegeController.cs

@@ -58,7 +58,7 @@ namespace CD67.FicheCollege.MVC.Controllers
             actionEduCollege.ActionEdu = fact.getById(actionEdu_id);
 
             ActionEduCollegeViewModel model = new ActionEduCollegeViewModel(actionEduCollege, db, ModeAcces.Creation);
-            return View(model);
+            return View("Edit", model);
         }
 
         // POST: ActionEduAxe/Create
@@ -76,7 +76,7 @@ namespace CD67.FicheCollege.MVC.Controllers
             }
 
             ActionEduCollegeViewModel model = new ActionEduCollegeViewModel(actionEduCollege, db, ModeAcces.Creation);
-            return View(model);
+            return View("Edit", model);
         }
 
         // GET: ActionEduAxe/Edit/5

+ 2 - 2
CD67.FicheCollege.MVC/Controllers/ActionsEduController.cs

@@ -61,7 +61,7 @@ namespace CD67.FicheCollege.MVC.Controllers
             actionEdu.TokenId = Guid.NewGuid();
 
             ActionEduViewModel model = new ActionEduViewModel(actionEdu, db, ModeAcces.Creation);
-            return View(model);
+            return View("Edit", model);
         }
 
         // POST: ActionEduAxe/Create
@@ -78,7 +78,7 @@ namespace CD67.FicheCollege.MVC.Controllers
                 return RedirectToAction("Index", new { annee_id = actionEdu.AnneeId });
             }
             ActionEduViewModel model = new ActionEduViewModel(actionEdu, db, ModeAcces.Creation);
-            return View(model);
+            return View("Edit", model);
         }
 
         // GET: ActionEduAxe/Edit/5

+ 0 - 22
CD67.FicheCollege.MVC/Controllers/GestionActionsController.cs

@@ -1,22 +0,0 @@
-using CD67.FicheCollege.Entity;
-using CD67.FicheCollege.Factory;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
-using System.Web.Mvc;
-
-namespace CD67.FicheCollege.MVC.Controllers
-{
-    public class GestionActionsController : Controller
-    {
-        private Entities db = new Entities();
-
-        // GET: GestionActions
-        public ActionResult Index()
-        {
-            CollegeFactory collegeFactory = new CollegeFactory(db);
-            return View(collegeFactory.getAll());
-        }
-    }
-}

+ 2 - 2
CD67.FicheCollege.MVC/Controllers/RestaurationTypeRepasController.cs

@@ -24,7 +24,7 @@ namespace CD67.FicheCollege.MVC.Controllers
             RestaurationTypeRepa repas = new RestaurationTypeRepa();
 
             RestaurationTypeRepaViewModel model = new RestaurationTypeRepaViewModel(repas, ModeAcces.Creation);
-            return View(model);
+            return View("Edit", model);
         }
 
         // POST: RestaurationTypeRepas/Create
@@ -42,7 +42,7 @@ namespace CD67.FicheCollege.MVC.Controllers
             }
 
             RestaurationTypeRepaViewModel model = new RestaurationTypeRepaViewModel(repas, ModeAcces.Creation);
-            return View(model);
+            return View("Edit", model);
         }
 
         // GET: RestaurationTypeRepas/Edit/5

+ 2 - 2
CD67.FicheCollege.MVC/Controllers/RestaurationTypesController.cs

@@ -24,7 +24,7 @@ namespace CD67.FicheCollege.MVC.Controllers
             RestaurationType type = new RestaurationType();
 
             RestaurationTypeViewModel model = new RestaurationTypeViewModel(type, ModeAcces.Creation);
-            return View(model);
+            return View("Edit", model);
         }
 
         // POST: RestaurationTypes/Create
@@ -42,7 +42,7 @@ namespace CD67.FicheCollege.MVC.Controllers
             }
 
             RestaurationTypeViewModel model = new RestaurationTypeViewModel(type, ModeAcces.Creation);
-            return View(model);
+            return View("Edit", model);
         }
 
         // GET: RestaurationTypes/Edit/5

+ 6 - 6
CD67.FicheCollege.MVC/Controllers/TerritoireController.cs

@@ -22,8 +22,8 @@ namespace CD67.FicheCollege.MVC.Controllers
         public ActionResult Create()
         {
             Entity.Territoire territoire = new Entity.Territoire();
-            TerritoireViewModel model = new TerritoireViewModel(territoire);
-            return View(model);
+            TerritoireViewModel model = new TerritoireViewModel(territoire, ModeAcces.Creation);
+            return View("Edit", model);
         }
 
         // POST: Territoire/Create
@@ -40,8 +40,8 @@ namespace CD67.FicheCollege.MVC.Controllers
                 return RedirectToAction("Index");
             }
 
-            TerritoireViewModel model = new TerritoireViewModel(territoire);
-            return View(model);
+            TerritoireViewModel model = new TerritoireViewModel(territoire, ModeAcces.Creation);
+            return View("Edit", model);
         }
 
         // GET: Territoire/Edit/5
@@ -74,7 +74,7 @@ namespace CD67.FicheCollege.MVC.Controllers
                 territoireFactory.update(ref territoire);
                 return RedirectToAction("Index");
             }
-            TerritoireViewModel model = new TerritoireViewModel(territoire);
+            TerritoireViewModel model = new TerritoireViewModel(territoire, ModeAcces.Modification);
             return View(model);
         }
 
@@ -91,7 +91,7 @@ namespace CD67.FicheCollege.MVC.Controllers
             {
                 return HttpNotFound();
             }
-            TerritoireViewModel model = new TerritoireViewModel(territoire);
+            TerritoireViewModel model = new TerritoireViewModel(territoire, ModeAcces.Suppression);
             return View(model);
         }
 

+ 7 - 7
CD67.FicheCollege.MVC/Controllers/TypeCollegeController.cs

@@ -45,8 +45,8 @@ namespace CD67.FicheCollege.MVC.Controllers
         public ActionResult Create()
         {
             Entity.TypeCollege typeCollege = new Entity.TypeCollege();
-            TypeCollegeViewModel model = new TypeCollegeViewModel(typeCollege);
-            return View(model);
+            TypeCollegeViewModel model = new TypeCollegeViewModel(typeCollege, ModeAcces.Creation);
+            return View("Edit", model);
         }
 
         // POST: TypeCollege/Create
@@ -63,8 +63,8 @@ namespace CD67.FicheCollege.MVC.Controllers
                 return RedirectToAction("Index");
             }
 
-            TypeCollegeViewModel model = new TypeCollegeViewModel(typeCollege);
-            return View(model);
+            TypeCollegeViewModel model = new TypeCollegeViewModel(typeCollege, ModeAcces.Creation);
+            return View("Edit", model);
         }
 
         // GET: TypeCollege/Edit/5
@@ -80,7 +80,7 @@ namespace CD67.FicheCollege.MVC.Controllers
             {
                 return HttpNotFound();
             }
-            TypeCollegeViewModel model = new TypeCollegeViewModel(typeCollege);
+            TypeCollegeViewModel model = new TypeCollegeViewModel(typeCollege, ModeAcces.Modification);
             return View(model);
         }
 
@@ -97,7 +97,7 @@ namespace CD67.FicheCollege.MVC.Controllers
                 typeCollegeFactory.update(ref typeCollege);
                 return RedirectToAction("Index");
             }
-            TypeCollegeViewModel model = new TypeCollegeViewModel(typeCollege);
+            TypeCollegeViewModel model = new TypeCollegeViewModel(typeCollege, ModeAcces.Modification);
             return View(model);
         }
 
@@ -114,7 +114,7 @@ namespace CD67.FicheCollege.MVC.Controllers
             {
                 return HttpNotFound();
             }
-            TypeCollegeViewModel model = new TypeCollegeViewModel(typeCollege);
+            TypeCollegeViewModel model = new TypeCollegeViewModel(typeCollege, ModeAcces.Suppression);
             return View(model);
         }
 

+ 0 - 44
CD67.FicheCollege.MVC/Views/ActionEduAxes/Create.cshtml

@@ -1,44 +0,0 @@
-@using CD67.FicheCollege.MVC.Models
-@model ActionEduAxeViewModel
-
-@{
-    ViewBag.Title = "Création";
-    Layout = "~/Views/Shared/_AdminLayout.cshtml";
-    ActionEduAxe axe = Model.Obj;
-}
-
-
-@using (Html.BeginForm()) 
-{
-    @Html.AntiForgeryToken()
-    
-    <div class="form-horizontal">
-        <h4>Axes</h4>
-        <hr />
-        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
-        @Html.HiddenFor(model => axe.Id)
-        @Html.HiddenFor(model => axe.Ordre)
-
-        <div class="form-group">
-            @Html.LabelFor(model => axe.Nom, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => axe.Nom, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => axe.Nom, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group">
-            @Html.LabelFor(model => axe.Neutralise, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => axe.Neutralise, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => axe.Neutralise, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group btn-bar">
-            <a href=@Url.Action("Index") class="btn btn-default">Annuler</a>
-            <input type="submit" value="Enregistrer" class="btn btn-primary" />
-        </div>
-
-    </div>
-}

+ 9 - 4
CD67.FicheCollege.MVC/Views/ActionEduAxes/Edit.cshtml

@@ -2,12 +2,19 @@
 @model ActionEduAxeViewModel
 
 @{
-    ViewBag.Title = "Modification";
+    ViewBag.Title = Model.Acces.ToString();
     Layout = "~/Views/Shared/_AdminLayout.cshtml";
     ActionEduAxe axe = Model.Obj;
 }
 
-<h2>Modification</h2>
+@if (Model.Acces == ModeAcces.Modification)
+{
+    <h2>@axe.Nom</h2>
+}
+else
+{
+    <h2>Nouvel Axe</h2>
+}
 
 
 @using (Html.BeginForm())
@@ -15,8 +22,6 @@
     @Html.AntiForgeryToken()
     
     <div class="form-horizontal">
-        <h4>Axe</h4>
-        <hr />
         @Html.ValidationSummary(true, "", new { @class = "text-danger" })
         @Html.HiddenFor(model => axe.Id)
         @Html.HiddenFor(model => axe.Ordre)

+ 2 - 2
CD67.FicheCollege.MVC/Views/ActionEduAxes/Index.cshtml

@@ -2,13 +2,13 @@
 @model ActionEduAxeIndexViewModel
 
 @{
-    ViewBag.Title = "Liste";
+    ViewBag.Title = "Axes";
     Layout = "~/Views/Shared/_AdminLayout.cshtml";
     int maxOrdre = Model.Obj.Count() == 0 ? 0 : Model.Obj.Max(i => i.Ordre);
     int row = 1;
 }
 
-<h2>Liste</h2>
+<h2>Axes</h2>
 
 <p>
     <a href="@Url.Action("Create")">

+ 0 - 52
CD67.FicheCollege.MVC/Views/ActionEduThematiques/Create.cshtml

@@ -1,52 +0,0 @@
-@using CD67.FicheCollege.MVC.Models
-@model ActionEduThematiqueViewModel
-
-@{
-    ViewBag.Title = "Création";
-    Layout = "~/Views/Shared/_AdminLayout.cshtml";
-    ActionEduThematique thematique = Model.Obj;
-}
-
-
-@using (Html.BeginForm()) 
-{
-    @Html.AntiForgeryToken()
-    
-    <div class="form-horizontal">
-        <h4>Thématique</h4>
-        <hr />
-        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
-        @Html.HiddenFor(model => thematique.Id)
-        @Html.HiddenFor(model => thematique.Ordre)
-
-        <div class="form-group">
-            @Html.LabelFor(model => thematique.Nom, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => thematique.Nom, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => thematique.Nom, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group">
-            @Html.LabelFor(model => thematique.Neutralise, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => thematique.Neutralise, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => thematique.Neutralise, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group">
-            @Html.LabelFor(model => thematique.ActionEduAxeId, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.DropDownListFor(model => thematique.ActionEduAxeId, Model.Sel_Axes, htmlAttributes: new { @class = "form-control" })
-                @Html.ValidationMessageFor(model => thematique.ActionEduAxeId, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group btn-bar">
-            <a href=@Url.Action("Index") class="btn btn-default">Annuler</a>
-            <input type="submit" value="Enregistrer" class="btn btn-primary" />
-        </div>
-
-    </div>
-}

+ 0 - 2
CD67.FicheCollege.MVC/Views/ActionEduThematiques/Delete.cshtml

@@ -11,8 +11,6 @@
 
 <h3>Voulez-vous vraiment supprimer cet élément?</h3>
 <div>
-    <h4>Thématiques</h4>
-    <hr />
     <dl class="dl-horizontal">
         <dt>
             @Html.DisplayNameFor(model => thematique.Nom)

+ 9 - 5
CD67.FicheCollege.MVC/Views/ActionEduThematiques/Edit.cshtml

@@ -2,21 +2,25 @@
 @model ActionEduThematiqueViewModel
 
 @{
-    ViewBag.Title = "Modification";
+    ViewBag.Title = Model.Acces.ToString();
     Layout = "~/Views/Shared/_AdminLayout.cshtml";
     ActionEduThematique thematique = Model.Obj;
 }
 
-<h2>Modification</h2>
-
+@if (Model.Acces == ModeAcces.Modification)
+{
+    <h2>@thematique.Nom</h2>
+}
+else
+{
+    <h2>Nouvelle Thématique</h2>
+}
 
 @using (Html.BeginForm())
 {
     @Html.AntiForgeryToken()
     
     <div class="form-horizontal">
-        <h4>Type collège</h4>
-        <hr />
         @Html.ValidationSummary(true, "", new { @class = "text-danger" })
         @Html.HiddenFor(model => thematique.Id)
         @Html.HiddenFor(model => thematique.Ordre)

+ 2 - 2
CD67.FicheCollege.MVC/Views/ActionEduThematiques/Index.cshtml

@@ -2,13 +2,13 @@
 @model ActionEduThematiqueIndexViewModel
 
 @{
-    ViewBag.Title = "Liste";
+    ViewBag.Title = "Thématiques";
     Layout = "~/Views/Shared/_AdminLayout.cshtml";
     int maxOrdre = Model.Obj.Count() == 0 ? 0 : Model.Obj.Max(i => i.Ordre);
     int row = 1;
 }
 
-<h2>Liste</h2>
+<h2>Thématiques</h2>
 
 <p>
     <a href="@Url.Action("Create")">

+ 0 - 114
CD67.FicheCollege.MVC/Views/ActionsEdu/Create.cshtml

@@ -1,114 +0,0 @@
-@using CD67.FicheCollege.MVC.Models
-@model ActionEduViewModel
-
-@{
-    ViewBag.Title = "Création";
-    Layout = "~/Views/Shared/_Layout.cshtml";
-    ActionEdu actionEdu = Model.Obj;
-}
-
-<header>
-    <h2>Nouvelle Action Educative</h2>
-</header>
-
-@using (Html.BeginForm()) 
-{
-    @Html.AntiForgeryToken()
-    
-    <div class="form-horizontal">
-        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
-        @Html.HiddenFor(model => actionEdu.Id)
-        @Html.HiddenFor(model => actionEdu.Ordre)
-        @Html.HiddenFor(model => actionEdu.AnneeId)
-        @Html.HiddenFor(model => actionEdu.Neutralise)
-        @Html.HiddenFor(model => actionEdu.TokenId)
-
-        <div class="form-group">
-            @Html.LabelFor(model => actionEdu.ActionEduThematiqueId, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.DropDownListFor(model => actionEdu.ActionEduThematiqueId, Model.Sel_Thematique, htmlAttributes: new { @class = "form-control" })
-                @Html.ValidationMessageFor(model => actionEdu.ActionEduThematiqueId, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group">
-            @Html.LabelFor(model => actionEdu.Numero, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => actionEdu.Numero, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => actionEdu.Numero, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group">
-            @Html.LabelFor(model => actionEdu.Nom, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => actionEdu.Nom, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => actionEdu.Nom, "", new { @class = "text-danger" })
-            </div>
-        </div>
-        
-        <div class="form-group">
-            @Html.LabelFor(model => actionEdu.StatutId, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.DropDownListFor(model => actionEdu.StatutId, Model.Sel_Statut, htmlAttributes: new { @class = "form-control" })
-                @Html.ValidationMessageFor(model => actionEdu.StatutId, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group">
-            @Html.LabelFor(model => actionEdu.Montant, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => actionEdu.Montant, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => actionEdu.Montant, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group">
-            @Html.LabelFor(model => actionEdu.Description, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => actionEdu.Description, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => actionEdu.Description, "", new { @class = "text-danger" })
-            </div>
-        </div>
-        
-        <div class="form-group">
-            @Html.LabelFor(model => actionEdu.CommentairePublic, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => actionEdu.CommentairePublic, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => actionEdu.CommentairePublic, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group">
-            @Html.LabelFor(model => actionEdu.CommentaireInterne, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => actionEdu.CommentaireInterne, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => actionEdu.CommentaireInterne, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group btn-bar">
-            <a href=@Url.Action("Index", new { annee_id = actionEdu.AnneeId }) class="btn btn-default">Annuler</a>
-            <input type="submit" value="Enregistrer" class="btn btn-primary" />
-        </div>
-
-    </div>
-}
-
-@section Scripts {
-    <script type="text/javascript">
-        $(".removeItem").click(function () {
-            switch ($(this).data("type")) {
-                case 'tiers':
-                    $('#actionEdu_TiersSid').val(null);
-                    $("span[data-picker='tiers.id']").html('');
-                    $("span[data-picker='tiers.nom']").html('');
-                default:
-                    return false;
-            }
-        });
-
-    </script>
-
-    @Scripts.Render("~/bundles/jqueryval")
-}

+ 21 - 3
CD67.FicheCollege.MVC/Views/ActionsEdu/Edit.cshtml

@@ -2,13 +2,20 @@
 @model ActionEduViewModel
 
 @{
-    ViewBag.Title = "Modification";
+    ViewBag.Title = Model.Acces.ToString();
     Layout = "~/Views/Shared/_Layout.cshtml";
     ActionEdu actionEdu = Model.Obj;
 }
 
 <header>
-    <h2>Edition de l'Action Educative '@actionEdu.Nom'</h2>
+    @if (Model.Acces == ModeAcces.Modification)
+    {
+        <h2>@actionEdu.Nom</h2>
+    }
+    else
+    {
+        <h2>Nouvelle Action Educative</h2>
+    }
 </header>
 
 @using (Html.BeginForm())
@@ -21,6 +28,7 @@
         @Html.HiddenFor(model => actionEdu.Ordre)
         @Html.HiddenFor(model => actionEdu.AnneeId)
         @Html.HiddenFor(model => actionEdu.TokenId)
+        @if (Model.Acces == ModeAcces.Creation) { @Html.HiddenFor(model => actionEdu.Neutralise) }
 
         <div class="form-group">
             @Html.LabelFor(model => actionEdu.ActionEduThematiqueId, htmlAttributes: new { @class = "control-label col-md-2" })
@@ -86,6 +94,8 @@
             </div>
         </div>
 
+        @if (Model.Acces == ModeAcces.Modification)
+        {
         <div class="form-group">
             @Html.LabelFor(model => actionEdu.Neutralise, htmlAttributes: new { @class = "control-label col-md-2" })
             <div class="col-md-10">
@@ -93,9 +103,17 @@
                 @Html.ValidationMessageFor(model => actionEdu.Neutralise, "", new { @class = "text-danger" })
             </div>
         </div>
+        }
 
         <div class="form-group btn-bar">
-            <a href=@Url.Action("Details", new { id = actionEdu.Id }) class="btn btn-default">Annuler</a>
+            @if (Model.Acces == ModeAcces.Modification)
+            {
+                <a href=@Url.Action("Details", new { id = actionEdu.Id }) class="btn btn-default">Annuler</a>
+            }
+            else
+            {
+                <a href=@Url.Action("Index", new { annee_id = actionEdu.AnneeId }) class="btn btn-default">Annuler</a>
+            }
             <input type="submit" value="Enregistrer" class="btn btn-primary" />
         </div>
 

+ 0 - 90
CD67.FicheCollege.MVC/Views/ActionsEduActeurs/Create.cshtml

@@ -1,90 +0,0 @@
-@using CD67.FicheCollege.MVC.Models
-@model ActionEduActeurViewModel
-
-@{
-    ViewBag.Title = "Création";
-    Layout = "~/Views/Shared/_Layout.cshtml";
-    ActionEduActeur actionEduActeur = Model.Obj;
-}
-
-<header>
-    <h2>Action '@actionEduActeur.ActionEdu.Nom': Ajouter un acteur</h2>
-</header>
-
-@using (Html.BeginForm()) 
-{
-    @Html.AntiForgeryToken()
-    
-    <div class="form-horizontal">
-        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
-        @Html.HiddenFor(model => actionEduActeur.Id)
-        @Html.HiddenFor(model => actionEduActeur.ActionEduId)
-        
-        <div class="form-group">
-            @Html.LabelFor(model => actionEduActeur.Nom, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                <input id="actionEduActeur_nom" class="form-control picker" name="actionEduActeur.nom" data-picker="structure.description">
-                @Html.ValidationMessageFor(model => actionEduActeur.Nom, "", new { @class = "text-danger" })
-                <input id="actionEduActeur_Sid" name="actionEduActeur.Sid" class="picker" value="" data-picker="structure.id" type="hidden">
-                <div>
-                    <p>
-                        <a class="modal-window cboxElement" href="http://referentiel.bas-rhin.fr/picker/cd67/org67/" title="Selection structure (nouvelle fenetre)">
-                            Sélectionner un service ou une mission du CD67
-                        </a>
-                    </p>
-                </div>
-            </div>
-        </div>
-
-        <div class="form-group">
-            @Html.LabelFor(model => actionEduActeur.RoleId, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.DropDownListFor(model => actionEduActeur.RoleId, Model.Sel_Role, htmlAttributes: new { @class = "form-control" })
-                @Html.ValidationMessageFor(model => actionEduActeur.RoleId, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group">
-            @Html.LabelFor(model => actionEduActeur.Commentaire, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => actionEduActeur.Commentaire, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => actionEduActeur.Commentaire, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group btn-bar">
-            <a href=@Url.Action("Details", "ActionsEdu", new { id = actionEduActeur.ActionEduId }) class="btn btn-default">Annuler</a>
-            <input type="submit" value="Enregistrer" class="btn btn-primary" />
-        </div>
-
-    </div>
-}
-
-@section Scripts {
-    <script type="text/javascript">
-        $.event.special.inputchange = {
-            setup: function () {
-                var self = this, val;
-                $.data(this, 'timer', window.setInterval(function () {
-                    val = self.value;
-                    if ($.data(self, 'cache') != val) {
-                        $.data(self, 'cache', val);
-                        $(self).trigger('inputchange');
-                    }
-                }, 20));
-            },
-            teardown: function () {
-                window.clearInterval($.data(this, 'timer'));
-            },
-            add: function () {
-                $.data(this, 'cache', this.value);
-            }
-        };
-
-        $("#actionEduActeur_Sid").on('inputchange', function () {
-            $("#actionEduActeur_nom").prop("readonly", true);
-        });
-    </script>
-
-    @Scripts.Render("~/bundles/jqueryval")
-}

+ 9 - 2
CD67.FicheCollege.MVC/Views/ActionsEduActeurs/Edit.cshtml

@@ -2,13 +2,20 @@
 @model ActionEduActeurViewModel
 
 @{
-    ViewBag.Title = "Modification";
+    ViewBag.Title = Model.Acces.ToString();
     Layout = "~/Views/Shared/_Layout.cshtml";
     ActionEduActeur actionEduActeur = Model.Obj;
 }
 
 <header>
-    <h2>Action '@actionEduActeur.ActionEdu.Nom': Modifier l'acteur</h2>
+    @if (Model.Acces == ModeAcces.Modification)
+    {
+        <h2>@actionEduActeur.ActionEdu.Nom</h2>
+    }
+    else
+    {
+        <h2>Nouvel Acteur</h2>
+    }
 </header>
 
 @using (Html.BeginForm()) 

+ 0 - 52
CD67.FicheCollege.MVC/Views/ActionsEduCollege/Create.cshtml

@@ -1,52 +0,0 @@
-@using CD67.FicheCollege.MVC.Models
-@model ActionEduCollegeViewModel
-
-@{
-    ViewBag.Title = "Création";
-    Layout = "~/Views/Shared/_Layout.cshtml";
-    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">
-        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
-        @Html.HiddenFor(model => actionEduCollege.Id)
-        @Html.HiddenFor(model => actionEduCollege.ActionEduId)
-        
-        <div class="form-group">
-            @Html.LabelFor(model => actionEduCollege.CollegeId, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.DropDownListFor(model => actionEduCollege.CollegeId, Model.Sel_College, htmlAttributes: new { @class = "form-control" })
-                @Html.ValidationMessageFor(model => actionEduCollege.CollegeId, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group">
-            @Html.LabelFor(model => actionEduCollege.NbEleves, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => actionEduCollege.NbEleves, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => actionEduCollege.NbEleves, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group">
-            @Html.LabelFor(model => actionEduCollege.Commentaire, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => actionEduCollege.Commentaire, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => actionEduCollege.Commentaire, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group btn-bar">
-            <a href=@Url.Action("Details", "ActionsEdu", new { id = actionEduCollege.ActionEduId }) class="btn btn-default">Annuler</a>
-            <input type="submit" value="Enregistrer" class="btn btn-primary" />
-        </div>
-    </div>
-}

+ 10 - 3
CD67.FicheCollege.MVC/Views/ActionsEduCollege/Edit.cshtml

@@ -2,13 +2,13 @@
 @model ActionEduCollegeViewModel
 
 @{
-    ViewBag.Title = "Modification";
+    ViewBag.Title = Model.Acces.ToString();
     Layout = "~/Views/Shared/_Layout.cshtml";
     ActionEduCollege actionEduCollege = Model.Obj;
 }
 
 <header>
-    <h2>Action '@actionEduCollege.ActionEdu.Nom': Affecter à un collège</h2>
+    <h2>@actionEduCollege.ActionEdu.Nom: Ajouter un collège</h2>
 </header>
 
 @using (Html.BeginForm()) 
@@ -47,7 +47,14 @@
         </div>
 
         <div class="form-group btn-bar">
-            <a href=@Url.Action("Details", new { id = actionEduCollege.Id }) class="btn btn-default">Annuler</a>
+            @if (Model.Acces == ModeAcces.Modification)
+            {
+                <a href=@Url.Action("Details", new { id = actionEduCollege.Id }) class="btn btn-default">Annuler</a>
+            }
+            else
+            {
+                <a href=@Url.Action("Details", "ActionsEdu", new { id = actionEduCollege.ActionEduId }) class="btn btn-default">Annuler</a>
+            }
             <input type="submit" value="Enregistrer" class="btn btn-primary" />
         </div>
     </div>

+ 3 - 3
CD67.FicheCollege.MVC/Views/Colleges/Edit.cshtml

@@ -11,11 +11,11 @@
 <header>
     @if (Model.Acces == ModeAcces.Modification)
     {
-    <h2>@college.Libelle</h2>
+        <h2>@college.Libelle</h2>
     }
     else
     {
-    <h2>Nouveau collège</h2>
+        <h2>Nouveau collège</h2>
     }
 </header>
 
@@ -26,7 +26,7 @@
 <fieldset>
 
     <legend>
-        Informations générales - @Model.Acces.ToString()
+        Informations générales
     </legend>
 
     <div class="form-horizontal">

+ 3 - 7
CD67.FicheCollege.MVC/Views/Colleges/Import.cshtml

@@ -46,13 +46,9 @@
                 </tbody>
             </table>
 
-            <div class="form-group">
-                <span style="margin-right:20px;">
-                    <input type="submit" value="Importer" class="btn btn-default" />
-                </span>
-                <span>
-                    @Html.ActionLink("Annuler", "Index", new { annee_id = Model.Annee_Id })
-                </span>
+            <div class="form-group btn-bar">
+                <a href=@Url.Action("Index", new { annee_id = Model.Annee_Id }) class="btn btn-default">Annuler</a>
+                <input type="submit" value="Importer" class="btn btn-primary" />
             </div>
         }
     }

+ 4 - 9
CD67.FicheCollege.MVC/Views/Colleges/Type.cshtml

@@ -16,8 +16,6 @@
     @Html.AntiForgeryToken()
 
 <div class="form-horizontal">
-    <h4>Type de restauration</h4>
-    <hr />
     @Html.ValidationSummary(true, "", new { @class = "text-danger" })
     @Html.HiddenFor(model => college.Id)
     @Html.HiddenFor(model => college.Annee_Id)
@@ -63,14 +61,11 @@
         </div>
     </div>
 
-    <div class="form-group">
-        <span style="margin-right:20px;">
-            <input type="submit" value="Enregistrer" class="btn btn-default" />
-        </span>
-        <a href="@Url.Action("Index", "Restauration", new { annee_id = college.Annee_Id })">
-            <span title="Annuler" style="vertical-align: middle" aria-hidden="true">Annuler</span>
-        </a>
+    <div class="form-group btn-bar">
+        <a href=@Url.Action("Index", "Restauration", new { annee_id = college.Annee_Id }) class="btn btn-default">Annuler</a>
+        <input type="submit" value="Enregistrer" class="btn btn-primary" />
     </div>
+
 </div>
     }
 

+ 0 - 43
CD67.FicheCollege.MVC/Views/RestaurationTypeRepas/Create.cshtml

@@ -1,43 +0,0 @@
-@using CD67.FicheCollege.MVC.Models
-@model RestaurationTypeRepaViewModel
-
-@{
-    ViewBag.Title = "Création";
-    Layout = "~/Views/Shared/_AdminLayout.cshtml";
-    RestaurationTypeRepa repas = Model.Obj;
-}
-
-
-@using (Html.BeginForm()) 
-{
-    @Html.AntiForgeryToken()
-    
-    <div class="form-horizontal">
-        <h4>Types de restauration</h4>
-        <hr />
-        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
-        @Html.HiddenFor(model => repas.Id)
-        @Html.HiddenFor(model => repas.Ordre)
-
-        <div class="form-group">
-            @Html.LabelFor(model => repas.Libelle, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => repas.Libelle, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => repas.Libelle, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group">
-            @Html.LabelFor(model => repas.Valid, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => repas.Valid, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => repas.Valid, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group btn-bar">
-            <a href=@Url.Action("Index") class="btn btn-default">Annuler</a>
-            <input type="submit" value="Enregistrer" class="btn btn-primary" />
-        </div>
-    </div>
-}

+ 9 - 5
CD67.FicheCollege.MVC/Views/RestaurationTypeRepas/Edit.cshtml

@@ -2,21 +2,25 @@
 @model RestaurationTypeRepaViewModel
 
 @{
-    ViewBag.Title = "Modification";
+    ViewBag.Title = Model.Acces.ToString();
     Layout = "~/Views/Shared/_AdminLayout.cshtml";
     RestaurationTypeRepa repas = Model.Obj;
 }
 
-<h2>Modification</h2>
-
+@if (Model.Acces == ModeAcces.Modification)
+{
+    <h2>@repas.Libelle</h2>
+}
+else
+{
+    <h2>Nouveau Type de Repas</h2>
+}
 
 @using (Html.BeginForm())
 {
     @Html.AntiForgeryToken()
     
     <div class="form-horizontal">
-        <h4>Type de repas</h4>
-        <hr />
         @Html.ValidationSummary(true, "", new { @class = "text-danger" })
         @Html.HiddenFor(model => repas.Id)
         @Html.HiddenFor(model => repas.Ordre)

+ 2 - 2
CD67.FicheCollege.MVC/Views/RestaurationTypeRepas/Index.cshtml

@@ -2,13 +2,13 @@
 @model RestaurationTypeRepaIndexViewModel
 
 @{
-    ViewBag.Title = "Liste";
+    ViewBag.Title = "Types de Repas";
     Layout = "~/Views/Shared/_AdminLayout.cshtml";
     int maxOrdre = Model.Obj.Count() == 0 ? 0 : Model.Obj.Max(i => i.Ordre);
     int row = 1;
 }
 
-<h2>Liste</h2>
+<h2>Types de Repas</h2>
 
 <p>
     <a href="@Url.Action("Create")">

+ 0 - 43
CD67.FicheCollege.MVC/Views/RestaurationTypes/Create.cshtml

@@ -1,43 +0,0 @@
-@using CD67.FicheCollege.MVC.Models
-@model RestaurationTypeViewModel
-
-@{
-    ViewBag.Title = "Création";
-    Layout = "~/Views/Shared/_AdminLayout.cshtml";
-    RestaurationType type = Model.Obj;
-}
-
-
-@using (Html.BeginForm()) 
-{
-    @Html.AntiForgeryToken()
-    
-    <div class="form-horizontal">
-        <h4>Types de restauration</h4>
-        <hr />
-        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
-        @Html.HiddenFor(model => type.Id)
-        @Html.HiddenFor(model => type.Ordre)
-
-        <div class="form-group">
-            @Html.LabelFor(model => type.Libelle, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => type.Libelle, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => type.Libelle, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group">
-            @Html.LabelFor(model => type.Valid, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => type.Valid, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => type.Valid, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group btn-bar">
-            <a href=@Url.Action("Index") class="btn btn-default">Annuler</a>
-            <input type="submit" value="Enregistrer" class="btn btn-primary" />
-        </div>
-    </div>
-}

+ 9 - 5
CD67.FicheCollege.MVC/Views/RestaurationTypes/Edit.cshtml

@@ -2,21 +2,25 @@
 @model RestaurationTypeViewModel
 
 @{
-    ViewBag.Title = "Modification";
+    ViewBag.Title = Model.Acces.ToString();
     Layout = "~/Views/Shared/_AdminLayout.cshtml";
     RestaurationType type = Model.Obj;
 }
 
-<h2>Modification</h2>
-
+@if (Model.Acces == ModeAcces.Modification)
+{
+    <h2>@type.Libelle</h2>
+}
+else
+{
+    <h2>Nouveau Type de Restauration</h2>
+}
 
 @using (Html.BeginForm())
 {
     @Html.AntiForgeryToken()
     
     <div class="form-horizontal">
-        <h4>Type de restauration</h4>
-        <hr />
         @Html.ValidationSummary(true, "", new { @class = "text-danger" })
         @Html.HiddenFor(model => type.Id)
         @Html.HiddenFor(model => type.Ordre)

+ 2 - 2
CD67.FicheCollege.MVC/Views/RestaurationTypes/Index.cshtml

@@ -2,13 +2,13 @@
 @model RestaurationTypeIndexViewModel
 
 @{
-    ViewBag.Title = "Liste";
+    ViewBag.Title = "Types de Restauration";
     Layout = "~/Views/Shared/_AdminLayout.cshtml";
     int maxOrdre = Model.Obj.Count() == 0 ? 0 : Model.Obj.Max(i => i.Ordre);
     int row = 1;
 }
 
-<h2>Liste</h2>
+<h2>Types de Restauration</h2>
 
 <p>
     <a href="@Url.Action("Create")">

+ 0 - 93
CD67.FicheCollege.MVC/Views/Territoire/Create.cshtml

@@ -1,93 +0,0 @@
-@using CD67.FicheCollege.MVC.Models
-@model TerritoireViewModel
-
-@{
-    ViewBag.Title = "Création";
-    Layout = "~/Views/Shared/_AdminLayout.cshtml";
-    Territoire territoire = Model.Obj;
-}
-
-<h2>Création</h2>
-
-
-@using (Html.BeginForm()) 
-{
-    @Html.AntiForgeryToken()
-    
-    <div class="form-horizontal">
-        <h4>Territoire</h4>
-        <hr />
-        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
-        @Html.HiddenFor(model => territoire.Ordre)
-
-        <div class="form-group">
-            @Html.LabelFor(model => territoire.Id, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => territoire.Id, new { htmlAttributes = new { @class = "form-control", @autofocus = true } })
-                @Html.ValidationMessageFor(model => territoire.Id, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group">
-            @Html.LabelFor(model => territoire.Libelle, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => territoire.Libelle, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => territoire.Libelle, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group">
-            @Html.Label("Référent", htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-4" data-picker-type="referent">
-                @Html.HiddenFor(model => territoire.Referent_SID, new { data_picker = "agent.id" })
-                @Html.HiddenFor(model => territoire.Referent_Nom, new { data_picker = "agent.nom" })
-                @Html.HiddenFor(model => territoire.Referent_Prenom, new { data_picker = "agent.prenom" })
-                @Html.HiddenFor(model => territoire.Referent_Structure, new { data_picker = "agent.chemin" })
-                @Html.HiddenFor(model => territoire.Referent_Login, new { data_picker = "agent.login" })
-                @Html.HiddenFor(model => territoire.Referent_Email, new { data_picker = "agent.mail" })
-                <a class='modal-window' href="http://referentiel.bas-rhin.fr/picker/cd67/ad67/?type=referent" title="Selection d'un référent (nouvelle fenetre)">Sélectionner un référent</a>
-                <br />
-                <div class="panel panel-default" id="Referent_Panel" name="Referent_Panel" style="@if (territoire.Referent_SID == null) { <text>display: none;</text> }">
-                    <div class="panel-heading clearfix">
-                        <h4 class="panel-title pull-left" style="padding-top: 7.5px;">
-                            <i class="fa fa-user color1" aria-hidden="true"></i>
-                            Agent
-                        </h4>
-                        <div class="pull-right">
-                            <span class="glyphicon glyphicon-trash removeItem btn btn-danger btn-sm" aria-hidden="true" data-type="referent"></span>
-                        </div>
-                    </div>
-                    <div class="panel-body" style="text-align: center;">
-                        <b><span data-picker="agent.prenom">@territoire.Referent_Prenom</span> <span data-picker="agent.nom">@territoire.Referent_Nom</span></b>
-                        <br /><span data-picker="agent.chemin">@territoire.Referent_Structure</span>
-                    </div>
-                </div>
-            </div>
-        </div>
-
-        <div class="form-group btn-bar">
-            <a href=@Url.Action("Index") class="btn btn-default">Annuler</a>
-            <input type="submit" value="Enregistrer" class="btn btn-primary" />
-        </div>
-    </div>
-}
-
-@section Scripts {
-    <script type="text/javascript">
-        $(".removeItem").click(function () {
-            switch ($(this).data("type")) {
-                case 'referent':
-                    $('#Referent_SID').val(null);
-                    $('#Referent_Nom').val(null);
-                    $('#Referent_Prenom').val(null);
-                    $('#Referent_Structure').val(null);
-                    $('#Referent_Login').val(null);
-                    $('#Referent_Email').val(null);
-                    $('#Referent_Panel').hide();
-                    break;
-                default:
-                    return false;
-            }
-        });
-    </script>
-}

+ 22 - 12
CD67.FicheCollege.MVC/Views/Territoire/Edit.cshtml

@@ -2,32 +2,42 @@
 @model TerritoireViewModel
 
 @{
-    ViewBag.Title = "Modification";
+    ViewBag.Title = Model.Acces.ToString();
     Layout = "~/Views/Shared/_AdminLayout.cshtml";
     Territoire territoire = Model.Obj;
 }
 
-<h2>Modification</h2>
-
+@if (Model.Acces == ModeAcces.Modification)
+{
+    <h2>@territoire.Libelle</h2>
+}
+else
+{
+    <h2>Nouveau Territoire</h2>
+}
 
 @using (Html.BeginForm())
 {
     @Html.AntiForgeryToken()
     
     <div class="form-horizontal">
-        <h4>Territoire</h4>
-        <hr />
         @Html.ValidationSummary(true, "", new { @class = "text-danger" })
-        @Html.HiddenFor(model => territoire.Id)
         @Html.HiddenFor(model => territoire.Ordre)
 
-        <div class="form-group">
-            @Html.LabelFor(model => territoire.Id, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => territoire.Id, new { htmlAttributes = new { @class = "form-control", @disabled = true } })
-                @Html.ValidationMessageFor(model => territoire.Id, "", new { @class = "text-danger" })
+        @if (Model.Acces == ModeAcces.Modification)
+        {
+            @Html.HiddenFor(model => territoire.Id)
+        }
+        else
+        {
+            <div class="form-group">
+                @Html.LabelFor(model => territoire.Id, htmlAttributes: new { @class = "control-label col-md-2" })
+                <div class="col-md-10">
+                    @Html.EditorFor(model => territoire.Id, new { htmlAttributes = new { @class = "form-control" } })
+                    @Html.ValidationMessageFor(model => territoire.Id, "", new { @class = "text-danger" })
+                </div>
             </div>
-        </div>
+        }
 
         <div class="form-group">
             @Html.LabelFor(model => territoire.Libelle, htmlAttributes: new { @class = "control-label col-md-2" })

+ 0 - 35
CD67.FicheCollege.MVC/Views/TypeCollege/Create.cshtml

@@ -1,35 +0,0 @@
-@using CD67.FicheCollege.MVC.Models
-@model TypeCollegeViewModel
-
-@{
-    ViewBag.Title = "Création";
-    Layout = "~/Views/Shared/_AdminLayout.cshtml";
-    TypeCollege typeCollege = Model.Obj;
-}
-
-
-@using (Html.BeginForm()) 
-{
-    @Html.AntiForgeryToken()
-    
-    <div class="form-horizontal">
-        <h4>Type collège</h4>
-        <hr />
-        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
-        @Html.HiddenFor(model => typeCollege.Id)
-        @Html.HiddenFor(model => typeCollege.Ordre)
-
-        <div class="form-group">
-            @Html.LabelFor(model => typeCollege.Libelle, htmlAttributes: new { @class = "control-label col-md-2" })
-            <div class="col-md-10">
-                @Html.EditorFor(model => typeCollege.Libelle, new { htmlAttributes = new { @class = "form-control" } })
-                @Html.ValidationMessageFor(model => typeCollege.Libelle, "", new { @class = "text-danger" })
-            </div>
-        </div>
-
-        <div class="form-group btn-bar">
-            <a href=@Url.Action("Index") class="btn btn-default">Annuler</a>
-            <input type="submit" value="Enregistrer" class="btn btn-primary" />
-        </div>
-    </div>
-}

+ 0 - 2
CD67.FicheCollege.MVC/Views/TypeCollege/Delete.cshtml

@@ -11,8 +11,6 @@
 
 <h3>Voulez-vous vraiment supprimer cet élément?</h3>
 <div>
-    <h4>Type collège</h4>
-    <hr />
     <dl class="dl-horizontal">
         <dt>
             @Html.DisplayNameFor(model => typeCollege.Libelle)

+ 9 - 5
CD67.FicheCollege.MVC/Views/TypeCollege/Edit.cshtml

@@ -2,21 +2,25 @@
 @model TypeCollegeViewModel
 
 @{
-    ViewBag.Title = "Modification";
+    ViewBag.Title = Model.Acces.ToString();
     Layout = "~/Views/Shared/_AdminLayout.cshtml";
     TypeCollege typeCollege = Model.Obj;
 }
 
-<h2>Modification</h2>
-
+@if (Model.Acces == ModeAcces.Modification)
+{
+    <h2>@typeCollege.Libelle</h2>
+}
+else
+{
+    <h2>Nouveau Type de Collège</h2>
+}
 
 @using (Html.BeginForm())
 {
     @Html.AntiForgeryToken()
     
     <div class="form-horizontal">
-        <h4>Type collège</h4>
-        <hr />
         @Html.ValidationSummary(true, "", new { @class = "text-danger" })
         @Html.HiddenFor(model => typeCollege.Id)
         @Html.HiddenFor(model => typeCollege.Ordre)