Mercurial > sat_legacy_website
diff templates/sat_website/base.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 | b45621706d83 |
line wrap: on
line diff
--- a/templates/sat_website/base.html Wed Jan 21 20:07:20 2015 +0100 +++ b/templates/sat_website/base.html Wed Jan 21 20:08:26 2015 +0100 @@ -50,29 +50,20 @@ </div> <div id="navbar" class="collapse navbar-collapse"> {% 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 %} + {% include "sat_website/menu.html" with style="nav navbar-nav pull-right" categories=categories_right language_select=True %} </div> </div> </nav> {% block content %}{% endblock %} - - <div class="container"> - <div class="row" id="language"> - <form class="well form-inline" action="{% url 'set_language' %}" method="post"> - {% csrf_token %} - <input name="next" type="hidden" value="{{ redirect_to }}" /> - <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> - <input type="submit" value="{% trans "Change language" %}" /> - </form> - </div> - </div> <script src="{% static "js/jquery.min.js" %}"></script> <script src="{% static "bootstrap/js/bootstrap.min.js" %}"></script> + <script type="text/javascript"> + $(document).ready(function() { + $('#language_select').change(function() { + $('#language_form').submit(); + }); + }); + </script> </body> </html>