diff templates/sat_website/menu.html @ 28:30a1edf90fae

move the language selector to the main menu
author souliane <souliane@mailoo.org>
date Wed, 21 Jan 2015 20:08:26 +0100
parents eda4deefecd1
children 876ae5e23690
line wrap: on
line diff
--- a/templates/sat_website/menu.html	Wed Jan 21 20:07:20 2015 +0100
+++ b/templates/sat_website/menu.html	Wed Jan 21 20:08:26 2015 +0100
@@ -18,6 +18,7 @@
 along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
 {% endcomment %}
 
+{% load i18n %}
 {% load utils %}
 
 <ul class="{{ style }}">
@@ -38,4 +39,18 @@
             <li><a href="{{ cat_url }}.html"><strong>{{ item }}</strong></a></li>
         {% endif %}
     {% endfor %}
+    {% if language_select %}
+        <li>
+            <form id="language_form" class="form-inline" action="{% url 'set_language' %}" method="post">
+                {% csrf_token %}
+                <input name="next" type="hidden" value="{{ redirect_to }}" />
+                <select id="language_select" name="language">
+                    {% get_language_info_list for available_languages as languages %}
+                    {% for language in languages %}
+                        <option value="{{ language.code }}"{% if language.code == LANGUAGE_CODE %} selected="selected"{% endif %}>{{ language.name_local }} ({{ language.code }})</option>
+                    {% endfor %}
+                </select>
+            </form>
+        </li>
+    {% endif %}
 </ul>