comparison 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
comparison
equal deleted inserted replaced
71:a14845624e01 72:ac83544a7645
18 along with Foobar. If not, see <http://www.gnu.org/licenses/>. 18 along with Foobar. If not, see <http://www.gnu.org/licenses/>.
19 {% endcomment %} 19 {% endcomment %}
20 20
21 {% load staticfiles %} 21 {% load staticfiles %}
22 {% load i18n %} 22 {% load i18n %}
23 {% load utils %}
23 {% get_current_language as LANGUAGE_CODE %} 24 {% get_current_language as LANGUAGE_CODE %}
24 25
25 <!DOCTYPE html> 26 <!DOCTYPE html>
26 <html lang="{{ LANGUAGE_CODE }}"> 27 <html lang="{{ LANGUAGE_CODE }}">
27 <head> 28 <head>
66 </div> 67 </div>
67 <div id="navbar" class="collapse navbar-collapse"> 68 <div id="navbar" class="collapse navbar-collapse">
68 {% include "sat_website/menu.html" with style="nav navbar-nav" categories=categories %} 69 {% include "sat_website/menu.html" with style="nav navbar-nav" categories=categories %}
69 {% include "sat_website/menu.html" with style="nav navbar-nav pull-right" categories=categories_right language_select=True %} 70 {% include "sat_website/menu.html" with style="nav navbar-nav pull-right" categories=categories_right language_select=True %}
70 </div> 71 </div>
72 <noscript>
73 {% for cat_url, item in categories.items %}
74 {% if item|is_tuple %}
75 {% for subcat_url, cat_name in item.1.items %}
76 <a class="btn btn-default" role="button" href="{{ subcat_url }}.html">{{ cat_name }}</a>
77 {% endfor %}
78 {% endif %}
79 {% endfor %}
80 <form id="language_form" class="form-inline" action="{% url 'set_language' %}" method="post">
81 {% csrf_token %}
82 <input name="next" type="hidden" value="{{ redirect_to }}" />
83 <select id="language_select" name="language">
84 {% get_language_info_list for available_languages as languages %}
85 {% for language in languages %}
86 <option value="{{ language.code }}"{% if language.code == LANGUAGE_CODE %} selected="selected"{% endif %}>{{ language.name_local|title }}</option>
87 {% endfor %}
88 </select>
89 <input type="submit" value="{% trans "Set language" %}" />
90 </form>
91 </noscript>
71 </div> 92 </div>
72 </nav> 93 </nav>
73 94
74 <script src="{% static "js/jquery.min.js" %}"></script> 95 <script src="{% static "js/jquery.min.js" %}"></script>
75 {% block content %}{% endblock %} 96 {% block content %}{% endblock %}