From cba2e50cd71fef7158af279ffb6427138cc667c6 Mon Sep 17 00:00:00 2001
From: Guillaume Rousse <guillaume.rousse@renater.fr>
Date: Thu, 26 Jul 2018 12:38:35 +0200
Subject: [PATCH] add language selection menu on edugain templates

---
 resources/css/renater.css    | 13 ------------
 resources/css/style.css      | 13 ++++++++++++
 templates/web/index.tt2.html | 38 +++++++++++++++++++++++++++++-------
 3 files changed, 44 insertions(+), 20 deletions(-)

diff --git a/resources/css/renater.css b/resources/css/renater.css
index f5d168a..f86a071 100644
--- a/resources/css/renater.css
+++ b/resources/css/renater.css
@@ -317,19 +317,6 @@ td.label {
     border: 1px solid #41494c;
 }
 
-.nocursor{
-    cursor: default!important;
-    opacity:0.6;
-}
-.nocursor label{
-    cursor: default!important;
-    color:#aaa!important;
-}
-.nocursor [class*=" fa-"]:before{
-    text-align: right;
-    font-size: 1rem;
-}
-
 /* Small screens */
 
 /* Define mobile styles */
diff --git a/resources/css/style.css b/resources/css/style.css
index 0ce1166..cc8c963 100644
--- a/resources/css/style.css
+++ b/resources/css/style.css
@@ -203,6 +203,19 @@ main form {
     float:none !important;
 }
 
+.nocursor{
+    cursor: default!important;
+    opacity:0.6;
+}
+.nocursor label{
+    cursor: default!important;
+    color:#aaa!important;
+}
+.nocursor [class*=" fa-"]:before{
+    text-align: right;
+    font-size: 1rem;
+}
+
 @media only screen and (max-width: 800px){
     .wizard > .steps {
         width: 100%;
diff --git a/templates/web/index.tt2.html b/templates/web/index.tt2.html
index ebab4ca..eb8bcb5 100644
--- a/templates/web/index.tt2.html
+++ b/templates/web/index.tt2.html
@@ -40,13 +40,37 @@
                 <div id="core_nav_section" class="et-menu-holder">
                     <ul id="core_nav" class="et-menu et-left">
                         <li class="et-first-option no-children"><a href="[% app.url %]" title="Home"><img style="width: 16px; height: 15px; position: relative; top: 3px" src="images/home_logo.png" alt="Home icon" /></a></li>
-                        <!--<li class="et-option et-has-children"><span>Top item 1&lt;!&ndash; with children &ndash;&gt;</span>-->
-                            <!--<ul class="et-submenu">-->
-                                <!--<li class="et-submenu-option"><a href="/section/item1.html">Sub-item 1</a></li>-->
-                                <!--<li class="et-submenu-option"><a href="/section/item1.html">Sub-item 2</a></li>-->
-                            <!--</ul>-->
-                        <!--</li>-->
-                        <!--<li class="et-option no-children"><a href="/item2.html">Top item 2&lt;!&ndash; with NO children &ndash;&gt;</a></li>-->
+                        <li class="et-option et-has-children">
+                            <span>Language</span>
+                            <ul class="et-submenu">
+                                <li class="et-submenu-option">
+                                    <a
+[% IF lh.language_tag() == "en" %]
+                                        class="nocursor"
+[% ELSE %]
+                                        href="[% app.url %]?action=[% action %]&federation=[% federation %]&entityid=[% entityid %]&email=[% email %]&token=[% token %]&lang=en"
+[% END %]
+                                        data-lang="en" title="English">
+                                        <img src="images/en.png" />
+                                        <label>English</label>
+                                        [% IF lh.language_tag() == "en" %]<span class="fa fa-check"></span>[% END %]
+                                    </a>
+                                </li>
+                                <li class="et-submenu-option">
+                                    <a
+[% IF lh.language_tag() == "fr" %]
+                                        class="nocursor"
+[% ELSE %]
+                                        href="[% app.url %]?action=[% action %]&federation=[% federation %]&entityid=[% entityid %]&email=[% email %]&token=[% token %]&lang=fr"
+[% END %]
+                                        data-lang="fr" title="Français">
+                                        <img src="images/fr.png" />
+                                        <label>Français</label>
+                                        [% IF lh.language_tag() == "fr" %]<span class="fa fa-check"></span>[% END %]
+                                    </a>
+                                </li>
+                            </ul>
+                        </li>
                     </ul>
                 </div>
                 <div id="help_nav_section" class="et-menu-holder">
-- 
GitLab