Ver código fonte

FIX Retour depuis les pages d'administration fonctionnel

olivier.massot 7 anos atrás
pai
commit
9efb55d97b

+ 21 - 0
CD67.FicheCollege.MVC/Scripts/cd67-main.js

@@ -1,5 +1,6 @@
 $(document).ready(function () {
 
+    //Paramétrage des data-tables
     $('.datatable').DataTable({
         "language": {
             "url": "/Scripts/dataTables.french.lang"
@@ -10,4 +11,24 @@
         var url = $(this).data('url');
         window.location.href = url;
     });
+
+
+    //Conservation de la trace (pages d'admin)
+    $("a.start-trace").on("click", function () {
+        sessionStorage.setItem("trace", window.location);
+    });
+
+    $("body").on("click", "a", function () {
+        if ($("a.keep-trace").length > 0 & sessionStorage.getItem("trace")==null) {
+            sessionStorage.setItem("trace", $("a.keep-trace").first().attr("href"));
+        }
+    });
+
+    if ($("a.keep-trace").length > 0) {
+        if (sessionStorage.getItem("trace") != null) {
+            $("a.keep-trace").attr("href", sessionStorage.getItem("trace"));
+        }
+    }
+
+
 });

+ 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 class="start-trace" href="@Url.Action("Index", "ActionEduAxes")"> <span class="glyphicon glyphicon-cog color1"></span> Axes</a>
+        <a class="start-trace" href="@Url.Action("Index", "ActionEduThematiques")"> <span class="glyphicon glyphicon-cog color1"></span> Thématiques</a>
     </span>
 </header>
 

+ 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 class="start-trace" href="@Url.Action("Index", "TypeCollege")"> <span class="glyphicon glyphicon-cog color1"></span> Types de collège</a>
+        <a class="start-trace" href="@Url.Action("Index", "Territoire")"> <span class="glyphicon glyphicon-cog color1"></span> Territoires</a>
     </span>
 </header>
 

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

@@ -55,7 +55,7 @@
                 @* 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>
-                    <a id="goback" href="@Url.Action("Index", "Home");">Retour</a>
+                    <a class="keep-trace" href="@Url.Action("Index", "Home")">Retour</a>
                 </span>
                 
                 <ul class="nav navbar-nav navbar-right">