diff templates/sat_website/base.html @ 72:ac83544a7645

display an ugly menu in <noscript> when JS is disabled
author souliane <souliane@mailoo.org>
date Wed, 27 May 2015 19:24:28 +0200
parents a14845624e01
children 13ebb548f234
line wrap: on
line diff
--- a/templates/sat_website/base.html	Wed May 27 18:56:16 2015 +0200
+++ b/templates/sat_website/base.html	Wed May 27 19:24:28 2015 +0200
@@ -20,6 +20,7 @@
 
 {% load staticfiles %}
 {% load i18n %}
+{% load utils %}
 {% get_current_language as LANGUAGE_CODE %}
 
 <!DOCTYPE html>
@@ -68,6 +69,26 @@
                 {% include "sat_website/menu.html" with style="nav navbar-nav" categories=categories %}
                 {% include "sat_website/menu.html" with style="nav navbar-nav pull-right" categories=categories_right language_select=True %}
             </div>
+            <noscript>
+                {% for cat_url, item in categories.items %}
+                    {% if item|is_tuple %}
+                        {% for subcat_url, cat_name in item.1.items %}
+                            <a class="btn btn-default" role="button" href="{{ subcat_url }}.html">{{ cat_name }}</a>
+                        {% endfor %}
+                    {% endif %}
+                {% endfor %}
+                <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|title }}</option>
+	                    {% endfor %}
+	                </select>
+	                <input type="submit" value="{% trans "Set language" %}" />
+	            </form>
+            </noscript>
         </div>
     </nav>