Browse Source

Ajout d'un layout special pour les pages d'administration, et redirection des liens

olivier.massot 7 năm trước cách đây
mục cha
commit
c8060a75d0
23 tập tin đã thay đổi với 156 bổ sung25 xóa
  1. 1 0
      CD67.FicheCollege.MVC/CD67.FicheCollege.MVC.csproj
  2. 1 1
      CD67.FicheCollege.MVC/Views/ActionEduAxes/Create.cshtml
  3. 1 1
      CD67.FicheCollege.MVC/Views/ActionEduAxes/Delete.cshtml
  4. 1 1
      CD67.FicheCollege.MVC/Views/ActionEduAxes/Edit.cshtml
  5. 1 1
      CD67.FicheCollege.MVC/Views/ActionEduAxes/Index.cshtml
  6. 1 1
      CD67.FicheCollege.MVC/Views/ActionEduThematiques/Create.cshtml
  7. 1 1
      CD67.FicheCollege.MVC/Views/ActionEduThematiques/Delete.cshtml
  8. 1 1
      CD67.FicheCollege.MVC/Views/ActionEduThematiques/Edit.cshtml
  9. 1 1
      CD67.FicheCollege.MVC/Views/ActionEduThematiques/Index.cshtml
  10. 2 2
      CD67.FicheCollege.MVC/Views/ActionsEdu/Index.cshtml
  11. 2 2
      CD67.FicheCollege.MVC/Views/Annees/Details.cshtml
  12. 0 2
      CD67.FicheCollege.MVC/Views/Colleges/Edit.cshtml
  13. 2 2
      CD67.FicheCollege.MVC/Views/Colleges/Index.cshtml
  14. 132 0
      CD67.FicheCollege.MVC/Views/Shared/_AdminLayout.cshtml
  15. 1 1
      CD67.FicheCollege.MVC/Views/Shared/_Layout.cshtml
  16. 1 1
      CD67.FicheCollege.MVC/Views/Territoire/Create.cshtml
  17. 1 1
      CD67.FicheCollege.MVC/Views/Territoire/Delete.cshtml
  18. 1 1
      CD67.FicheCollege.MVC/Views/Territoire/Edit.cshtml
  19. 1 1
      CD67.FicheCollege.MVC/Views/Territoire/Index.cshtml
  20. 1 1
      CD67.FicheCollege.MVC/Views/TypeCollege/Create.cshtml
  21. 1 1
      CD67.FicheCollege.MVC/Views/TypeCollege/Delete.cshtml
  22. 1 1
      CD67.FicheCollege.MVC/Views/TypeCollege/Edit.cshtml
  23. 1 1
      CD67.FicheCollege.MVC/Views/TypeCollege/Index.cshtml

+ 1 - 0
CD67.FicheCollege.MVC/CD67.FicheCollege.MVC.csproj

@@ -429,6 +429,7 @@
     <Content Include="Views\ActionsEduCollege\Create.cshtml" />
     <Content Include="Views\ActionsEduCollege\Delete.cshtml" />
     <Content Include="Views\ActionsEduCollege\Edit.cshtml" />
+    <Content Include="Views\Shared\_AdminLayout.cshtml" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="App_Data\" />

+ 1 - 1
CD67.FicheCollege.MVC/Views/ActionEduAxes/Create.cshtml

@@ -3,7 +3,7 @@
 
 @{
     ViewBag.Title = "Création";
-    Layout = "~/Views/Shared/_Layout.cshtml";
+    Layout = "~/Views/Shared/_AdminLayout.cshtml";
     ActionEduAxe axe = Model.Obj;
 }
 

+ 1 - 1
CD67.FicheCollege.MVC/Views/ActionEduAxes/Delete.cshtml

@@ -3,7 +3,7 @@
 
 @{
     ViewBag.Title = "Suppression";
-    Layout = "~/Views/Shared/_Layout.cshtml";
+    Layout = "~/Views/Shared/_AdminLayout.cshtml";
     ActionEduAxe axe = Model.Obj;
 }
 

+ 1 - 1
CD67.FicheCollege.MVC/Views/ActionEduAxes/Edit.cshtml

@@ -3,7 +3,7 @@
 
 @{
     ViewBag.Title = "Modification";
-    Layout = "~/Views/Shared/_Layout.cshtml";
+    Layout = "~/Views/Shared/_AdminLayout.cshtml";
     ActionEduAxe axe = Model.Obj;
 }
 

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

@@ -3,7 +3,7 @@
 
 @{
     ViewBag.Title = "Liste";
-    Layout = "~/Views/Shared/_Layout.cshtml";
+    Layout = "~/Views/Shared/_AdminLayout.cshtml";
     int maxOrdre = Model.Obj.Count() == 0 ? 0 : Model.Obj.Max(i => i.Ordre);
     int row = 1;
 }

+ 1 - 1
CD67.FicheCollege.MVC/Views/ActionEduThematiques/Create.cshtml

@@ -3,7 +3,7 @@
 
 @{
     ViewBag.Title = "Création";
-    Layout = "~/Views/Shared/_Layout.cshtml";
+    Layout = "~/Views/Shared/_AdminLayout.cshtml";
     ActionEduThematique thematique = Model.Obj;
 }
 

+ 1 - 1
CD67.FicheCollege.MVC/Views/ActionEduThematiques/Delete.cshtml

@@ -3,7 +3,7 @@
 
 @{
     ViewBag.Title = "Suppression";
-    Layout = "~/Views/Shared/_Layout.cshtml";
+    Layout = "~/Views/Shared/_AdminLayout.cshtml";
     ActionEduThematique thematique = Model.Obj;
 }
 

+ 1 - 1
CD67.FicheCollege.MVC/Views/ActionEduThematiques/Edit.cshtml

@@ -3,7 +3,7 @@
 
 @{
     ViewBag.Title = "Modification";
-    Layout = "~/Views/Shared/_Layout.cshtml";
+    Layout = "~/Views/Shared/_AdminLayout.cshtml";
     ActionEduThematique thematique = Model.Obj;
 }
 

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

@@ -3,7 +3,7 @@
 
 @{
     ViewBag.Title = "Liste";
-    Layout = "~/Views/Shared/_Layout.cshtml";
+    Layout = "~/Views/Shared/_AdminLayout.cshtml";
     int maxOrdre = Model.Obj.Count() == 0 ? 0 : Model.Obj.Max(i => i.Ordre);
     int row = 1;
 }

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

@@ -13,8 +13,8 @@
     <h2>Les Actions</h2>
     <span>
         <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("Index", "ActionEduAxes")"> <span class="glyphicon glyphicon-cog color1"></span> Axes</a>
-        <a href="@Url.Action("Index", "ActionEduThematiques")"> <span class="glyphicon glyphicon-cog color1"></span> Thématiques</a>
+        <a href="@Url.Action("Index", "ActionEduAxes")" target="_blank"> <span class="glyphicon glyphicon-cog color1"></span> Axes</a>
+        <a href="@Url.Action("Index", "ActionEduThematiques")" target="_blank"> <span class="glyphicon glyphicon-cog color1"></span> Thématiques</a>
     </span>
 </header>
 

+ 2 - 2
CD67.FicheCollege.MVC/Views/Annees/Details.cshtml

@@ -19,7 +19,7 @@
                 @Model.Obj.Colleges.Count() collèges enregistrés pour l'année scolaire @Model.Obj.Libelle
             </p>
             <ul>
-                <li><input type="text" class="form-control input-search" name="recherche" id="recherche" placeholder="Rechercher un collège..." data-auto="" value="@Request["recherche_college"]"></li>
+                <li><input disabled type="text" class="form-control input-search" name="recherche" id="recherche" placeholder="Rechercher un collège..." data-auto="" value="@Request["recherche_college"]"></li>
                 <li>@Html.ActionLink("Voir tous les collèges", "Index", "Colleges", new { annee_id = Model.Obj.Id }, null)</li>
             </ul>
         </div>
@@ -36,7 +36,7 @@
             </p>
             
             <ul>
-                <li><input type="text" class="form-control input-search" name="recherche" id="recherche" placeholder="Rechercher une action..." data-auto="" value="@Request["recherche_action"]"></li>
+                <li><input disabled type="text" class="form-control input-search" name="recherche" id="recherche" placeholder="Rechercher une action..." data-auto="" value="@Request["recherche_action"]"></li>
                 <li>@Html.ActionLink("Voir toutes les actions", "Index", "ActionsEdu", new { annee_id = Model.Obj.Id }, null)</li>
             </ul>
         </div>

+ 0 - 2
CD67.FicheCollege.MVC/Views/Colleges/Edit.cshtml

@@ -85,8 +85,6 @@
             @Html.HiddenFor(model => college.TAD, new { data_picker = "commune.tad" })
             @Html.HiddenFor(model => college.CDC, new { data_picker = "commune.cdc" })
 
-            
-
             <div class="form-group">
                 @Html.LabelFor(model => college.Commune, htmlAttributes: new { @class = "control-label col-md-2 required" })
                 <div class="col-md-4">

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

@@ -11,8 +11,8 @@
     <h2>Les collèges @Model.Annee_Lib</h2>
     <span>
         <a href="@Url.Action("Create", new { annee_id = Model.Obj.Id })"> <span class="glyphicon glyphicon-plus-sign color1"></span> Nouveau collège</a>
-        <a href="@Url.Action("Index", "TypeCollege")"> <span class="glyphicon glyphicon-cog color1"></span> Types de collège</a>
-        <a href="@Url.Action("Index", "Territoire")"> <span class="glyphicon glyphicon-cog color1"></span> Territoires</a>
+        <a href="@Url.Action("Index", "TypeCollege")" target="_blank"> <span class="glyphicon glyphicon-cog color1"></span> Types de collège</a>
+        <a href="@Url.Action("Index", "Territoire")" target="_blank"> <span class="glyphicon glyphicon-cog color1"></span> Territoires</a>
     </span>
 </header>
 

+ 132 - 0
CD67.FicheCollege.MVC/Views/Shared/_AdminLayout.cshtml

@@ -0,0 +1,132 @@
+@using CD67.FicheCollege.MVC.Models
+
+@{
+    string url = Request.Url.ToString();
+    bool isProd = (Request.ServerVariables["SERVER_NAME"] == "fichecollege.bas-rhin.fr");
+    var controllerName = ViewContext.RouteData.Values["controller"].ToString();
+    var actionName = ViewContext.RouteData.Values["action"].ToString();
+
+    //Récupération de l'utilisateur connecté
+    UtilisateurConnecte utilisateurConnecte = CD67.FicheCollege.MVC.Internal.UtilisateurConnecteFactory.getUtilisateurConnecte();
+}
+
+<!DOCTYPE html>
+<html lang="fr">
+<head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, shrink-to-fit=no, initial-scale=1">
+    <meta name="description" content="">
+    <meta name="author" content="">
+
+    <link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico" />
+    <link rel="icon" type="image/x-icon" href="~/images/favicon.ico" />
+    @Styles.Render("~/Content/jquery-ui-css")
+    @Styles.Render("~/Content/css")
+    @Styles.Render("~/Content/datatables")
+    
+    @Scripts.RenderFormat("<script src=\"{0}\" defer></script>", "~/bundles/jqueryval")
+    @Scripts.RenderFormat("<script src=\"{0}\" defer></script>", "~/bundles/jquery-ui")
+    @Scripts.RenderFormat("<script src=\"{0}\" defer></script>", "~/bundles/bootstrap")
+    @Scripts.RenderFormat("<script src=\"{0}\" defer></script>", "~/bundles/datatables")
+    @Scripts.RenderFormat("<script src=\"{0}\" defer></script>", "~/bundles/cd67")
+
+    <!-- Ajout des classes no-screen et no-print -->
+    <style media="print">
+        .no-print{display: none}
+    </style>
+    <style type="text/css" media="screen">
+        .no-screen{display: none}
+    </style>
+</head>
+<body>
+    <div class="main-container-cache"></div>
+
+    @* Entete de page *@
+    <header>
+        <nav class="navbar-fixed-top navbar-default no-margin">
+            <div id="topbar" class="navbar navbar-inner">
+
+                @* Titre et année en cours *@
+                <span id="titre" class="nav navbar">
+                    <h1 id="app-title" style="color:rgb(150,150,150)">Fiches collège: Administration</h1>
+                </span>
+                
+                <ul class="nav navbar-nav navbar-right">
+
+                    @* Barre de recherche rapide *@
+                    <li class="search">
+                        <form action="@Url.Action("Index", "Recherche", new { })" class="search-form">
+                            <label for="recherche" class="search-field">
+                                <input type="text" class="form-control input-search" name="recherche" id="recherche" placeholder="Rechercher..." data-auto="" value="@Request["recherche"]">
+                            </label>
+                            <span class="icon-search fa fa-search fa-2x"></span>
+                        </form>
+                    </li>
+
+                    @* Panneau utilisateur *@
+                    <li class="dropdown">
+                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
+                            <span class="glyphicon glyphicon-user"></span>
+                            <strong>@utilisateurConnecte.libelle</strong>
+                            <span class="glyphicon glyphicon-chevron-down"></span>
+                        </a>
+                        <ul class="dropdown-menu">
+                            <li>
+                                <div class="navbar-login">
+                                    <div class="row">
+                                        <div class="col-lg-4 ">
+                                            <p class="text-center">
+                                                <span class="glyphicon glyphicon-user icon-size"></span>
+                                            </p>
+                                        </div>
+                                             <div class="col-lg-8">
+                                            <p class="text-left"><strong>@utilisateurConnecte.login</strong></p>
+                                            <p class="text-left small">@utilisateurConnecte.email</p>
+                                            <p class="text-left">
+                                                <a href="#" class="btn btn-primary btn-block btn-sm">Paramètres</a>
+                                            </p>
+                                        </div>
+                                    </div>
+                                </div>
+                            </li>
+                        </ul>
+                    </li>
+                </ul>
+
+            </div>
+        </nav>
+    </header>
+
+    <div id="wrapper">
+
+        <div id="content" class="container">
+            @RenderBody()
+        </div>
+    </div>
+
+    @* Pied de page *@
+    <footer>
+        <div class="container">
+            <div class="row">
+                <div class="col-lg-12">
+                    <div class="col-md-10 credentials">
+                        @*<a href="#">Contact</a> | <a href="#">Plan du site</a> | <a href="#" >F.A.Q.</a><i class="muted pull-right">© 2017 CD67. Tous droits réservés.</i>*@
+                    </div>
+                    <div class="col-md-2">
+                        <ul class="brand">
+                            <li><a href="/" title="Retour à l'accueil">
+                            @if (isProd) { <img src="~/images/LogoCD67.png" width="148" height="51" alt="CD67">;
+                            } else { <img src="~/images/LogoCD67Recette.png" width="148" height="51" alt="CD67">; }
+                            </a></li>
+                        </ul>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </footer>
+
+    @Scripts.Render("~/bundles/jquery")
+    @RenderSection("Scripts", false)
+</body>
+</html>

+ 1 - 1
CD67.FicheCollege.MVC/Views/Shared/_Layout.cshtml

@@ -120,7 +120,7 @@
                 <li>
                     <a href="@Url.Action("Index", "ActionsEdu", new { annee_id = Model.Obj.Id })">
                         <div class="menu-1">
-                            <span class="fa fa-building title">Actions</span>
+                            <span class="fa fa-book title">Actions</span>
                         </div>
                     </a>
                 </li>

+ 1 - 1
CD67.FicheCollege.MVC/Views/Territoire/Create.cshtml

@@ -3,7 +3,7 @@
 
 @{
     ViewBag.Title = "Création";
-    Layout = "~/Views/Shared/_Layout.cshtml";
+    Layout = "~/Views/Shared/_AdminLayout.cshtml";
     Territoire territoire = Model.Obj;
 }
 

+ 1 - 1
CD67.FicheCollege.MVC/Views/Territoire/Delete.cshtml

@@ -2,7 +2,7 @@
 @model TerritoireViewModel
 @{
     ViewBag.Title = "Suppression";
-    Layout = "~/Views/Shared/_Layout.cshtml";
+    Layout = "~/Views/Shared/_AdminLayout.cshtml";
     Territoire territoire = Model.Obj;
 }
 

+ 1 - 1
CD67.FicheCollege.MVC/Views/Territoire/Edit.cshtml

@@ -3,7 +3,7 @@
 
 @{
     ViewBag.Title = "Modification";
-    Layout = "~/Views/Shared/_Layout.cshtml";
+    Layout = "~/Views/Shared/_AdminLayout.cshtml";
     Territoire territoire = Model.Obj;
 }
 

+ 1 - 1
CD67.FicheCollege.MVC/Views/Territoire/Index.cshtml

@@ -3,7 +3,7 @@
 
 @{
     ViewBag.Title = "Liste";
-    Layout = "~/Views/Shared/_Layout.cshtml";
+    Layout = "~/Views/Shared/_AdminLayout.cshtml";
     int maxOrdre = Model.Obj.Count() == 0 ? 0 : Model.Obj.Max(i => i.Ordre);
     int row = 1;
     Territoire modele_territoire = new Territoire();

+ 1 - 1
CD67.FicheCollege.MVC/Views/TypeCollege/Create.cshtml

@@ -3,7 +3,7 @@
 
 @{
     ViewBag.Title = "Création";
-    Layout = "~/Views/Shared/_Layout.cshtml";
+    Layout = "~/Views/Shared/_AdminLayout.cshtml";
     TypeCollege typeCollege = Model.Obj;
 }
 

+ 1 - 1
CD67.FicheCollege.MVC/Views/TypeCollege/Delete.cshtml

@@ -3,7 +3,7 @@
 
 @{
     ViewBag.Title = "Suppression";
-    Layout = "~/Views/Shared/_Layout.cshtml";
+    Layout = "~/Views/Shared/_AdminLayout.cshtml";
     TypeCollege typeCollege = Model.Obj;
 }
 

+ 1 - 1
CD67.FicheCollege.MVC/Views/TypeCollege/Edit.cshtml

@@ -3,7 +3,7 @@
 
 @{
     ViewBag.Title = "Modification";
-    Layout = "~/Views/Shared/_Layout.cshtml";
+    Layout = "~/Views/Shared/_AdminLayout.cshtml";
     TypeCollege typeCollege = Model.Obj;
 }
 

+ 1 - 1
CD67.FicheCollege.MVC/Views/TypeCollege/Index.cshtml

@@ -3,7 +3,7 @@
 
 @{
     ViewBag.Title = "Liste";
-    Layout = "~/Views/Shared/_Layout.cshtml";
+    Layout = "~/Views/Shared/_AdminLayout.cshtml";
     int maxOrdre = Model.Obj.Count() == 0 ? 0 : Model.Obj.Max(i => i.Ordre);
     int row = 1;
     TypeCollege type_model = new TypeCollege();