]> git.agnieray.net Git - galette.git/blobdiff - galette/templates/default/page.tpl
Rework lang selector
[galette.git] / galette / templates / default / page.tpl
index 44824129c09a9d0ca3ae43c59d962fa78c915231..24a7066d053faf68ab96bfa13cde973033d6cf6b 100644 (file)
@@ -196,16 +196,19 @@ We have to use a template file, so Smarty will do its work (like replacing varia
 {* Include plugins menu entries *}
 {$plugins->getMenus($tpl)}
 
-        <form action="">
-            <select id="lang_selector" name="ui_pref_lang">
+        <nav id="plang_selector" class="onhover">
+            <a href="#plang_selector" class="tooltip" aria-expanded="false" aria-controls="lang_selector" title="{_T string="Change language"}">
+                <i class="fas fa-language"></i>
+                {$galette_lang_name}
+            </a>
+            <ul id="lang_selector">
 {foreach item=langue from=$languages}
-                <option value="{$langue->getID()}" lang="{$langue->getAbbrev()}"{if $galette_lang eq $langue->getAbbrev()} selected="selected"{/if}>{$langue->getName()|ucfirst}</option>
+                <li {if $galette_lang eq $langue->getAbbrev()} selected="selected"{/if}>
+                    <a href="?ui_pref_lang={$langue->getID()}" lang="{$langue->getAbbrev()}">{$langue->getName()}</a>
+                </li>
 {/foreach}
-            </select>
-            <noscript>
-                <input type="submit" name="{_T string="Change language"}" />
-            </noscript>
-        </form>
+            </ul>
+        </nav>
 {if $login->isLogged()}
         <div>{$login->loggedInAs()}</div>
         <a id="logout_10" class="button" href="{if $login->isImpersonated()}{path_for name="unimpersonate"}{else}{path_for name="logout"}{/if}"><i class="fas fa-{if $login->isImpersonated()}user-secret{else}sign-out-alt{/if}"></i>{_T string="Log off"}</a>