Mercurial > sat_legacy_website
comparison templates/sat_website/base.html @ 25:930e73ea9e8e
select the current language in the languages selection list
author | souliane <souliane@mailoo.org> |
---|---|
date | Mon, 19 Jan 2015 14:23:56 +0100 |
parents | 9bab976241dc |
children | 3df49721008c |
comparison
equal
deleted
inserted
replaced
24:c6a3ca0429dd | 25:930e73ea9e8e |
---|---|
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 {% get_current_language as LANGUAGE_CODE %} | |
23 | 24 |
24 <!DOCTYPE html> | 25 <!DOCTYPE html> |
25 <html lang="en"> | 26 <html lang="{{ LANGUAGE_CODE }}"> |
26 <meta charset="utf-8"> | |
27 <head> | 27 <head> |
28 <link rel="stylesheet" href="{% static "css/bootstrap.css" %}"> | 28 <link rel="stylesheet" href="{% static "css/bootstrap.css" %}"> |
29 <link rel="stylesheet" href="{% static "css/bootstrap-responsive.css" %}"> | 29 <link rel="stylesheet" href="{% static "css/bootstrap-responsive.css" %}"> |
30 <link rel="stylesheet" href="{% static "css/sat_website.css" %}"> | 30 <link rel="stylesheet" href="{% static "css/sat_website.css" %}"> |
31 <link rel="icon" type="image/png" href="{% static "images/sat_logo_32.png" %}"> | 31 <link rel="icon" type="image/png" href="{% static "images/sat_logo_32.png" %}"> |
53 </div> | 53 </div> |
54 </div> | 54 </div> |
55 {% block content %}{% endblock %} | 55 {% block content %}{% endblock %} |
56 <div class="container"> | 56 <div class="container"> |
57 <div class="row" id="language"> | 57 <div class="row" id="language"> |
58 | 58 <form class="well form-inline" action="{% url 'set_language' %}" method="post"> |
59 <form class="well form-inline" action="/i18n/setlang/" method="post"> | |
60 {% csrf_token %} | 59 {% csrf_token %} |
61 <input name="next" type="hidden" value="{{ redirect_to }}" /> | 60 <input name="next" type="hidden" value="{{ redirect_to }}" /> |
62 <select name="language"> | 61 <select name="language"> |
63 {% get_language_info_list for available_languages as languages %} | 62 {% get_language_info_list for available_languages as languages %} |
64 {% for language in languages %} | 63 {% for language in languages %} |
65 <option value="{{ language.code }}">{{ language.name_local }} ({{ language.code }})</option> | 64 <option value="{{ language.code }}"{% if language.code == LANGUAGE_CODE %} selected="selected"{% endif %}>{{ language.name_local }} ({{ language.code }})</option> |
66 {% endfor %} | 65 {% endfor %} |
67 </select> | 66 </select> |
68 <input type="submit" value="{% trans "Change language" %}" /> | 67 <input type="submit" value="{% trans "Change language" %}" /> |
69 </form> | 68 </form> |
70 </div> | 69 </div> |