Introduce language switcher

parent 783e11fa
......@@ -239,9 +239,16 @@
// CONCRETE stuff
/* header account menu */
#thimbus-account-menu-container {
top: 10px;
right: 10px;
position: absolute;
}
#language-selector-menu,
#thimbus-account-menu {
a.btn {
background-color: @inverted-color;
background: @inverted-color;
color: @background-color;
&:hover {
......
(function() {
language_submit_btn.onclick = function () {
set_language_form.submit();
};
})();
This diff is collapsed.
This diff is collapsed.
This diff was suppressed by a .gitattributes entry.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
{% load i18n static compile_static menu %}
{% get_current_language as LANGUAGE_CODE %}
<!DOCTYPE html>
<!--[if IE 9]><html dir="ltr" lang="{{ get_current_language }}" class="lt-ie10"> <![endif]-->
<!--[if gt IE 9]><!--><html dir="ltr" lang="{{ get_current_language }}" class="gt-ie9 non-ie"><!--<![endif]-->
<!--[if IE 9]><html dir="ltr" lang="{{ LANGUAGE_CODE }}" class="lt-ie10"> <![endif]-->
<!--[if gt IE 9]><!--><html dir="ltr" lang="{{ LANGUAGE_CODE }}" class="gt-ie9 non-ie"><!--<![endif]-->
<head>
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><![endif]-->
......@@ -16,6 +16,7 @@
{% block css_head %}
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400italic,400,700" rel="stylesheet" type="text/css">
<link href="{% static "fonts/gillsans.css" %}" rel="stylesheet" type="text/css">
<link href="{% static "plugins/font-awesome/css/font-awesome.min.css" %}" rel="stylesheet" type="text/css">
<link href="{% static "css/bootstrap.min.css" %}" rel="stylesheet" type="text/css">
<link href="{% static "plugins/magnific-popup/magnific-popup.css" %}" rel="stylesheet" type="text/css">
......@@ -27,9 +28,10 @@
<!-- js head -->
{% block js_head %}
<script type="text/javascript" src="{% static "plugins/jquery-1.8.1.min.js" %}"></script>
<script type="text/javascript" src="{% static "plugins/jquery-1.8.3.min.js" %}"></script>
<script type="text/javascript" src="{% static "js/jquery.jscroll.min.js" %}"></script>
<script type="text/javascript" src="{% static "js/jquery.fancybox.pack.js" %}"></script>
<script type="text/javascript" src="{% static "js/thimbus.js" %}"></script>
<script type="text/javascript" src="{% static "js/scripts.js" %}"></script>
{% endblock %}
......@@ -138,13 +140,30 @@
{% if not user.is_authenticated %}
<div class="thimbus-ui" id="thimbus-account-menu-container">
<div class="btn-group open" id="language-selector-menu">
<form action="{% url 'set_language' %}" id="set_language_form" method="post">
{% csrf_token %}
<input name="next" type="hidden" value="{{ redirect_to }}" />
{% if LANGUAGE_CODE == 'nl' %}
<input type="hidden" name="language" value="en" />
<a class="btn btn-default" id="language_submit_btn"><i class="fa fa-flag"></i>English</a>
{% else %}
<input type="hidden" name="language" value="nl" />
<a class="btn btn-default" id="language_submit_btn"><i class="fa fa-flag"></i>Nederlands</a>
{% endif %}
</form>
</div>
<div class="btn-group open" id="thimbus-account-menu">
<a class="btn btn-default" href="/account"><i class="fa fa-user"></i> {% trans "Login" %}</a>
<a class="btn btn-default" href="/account"><i class="fa fa-user"></i>{% trans "Login" %}</a>
</div>
</div>
{% endif %}
{% block footer_scripts %}
<script type="text/javascript" src="{% static "js/footer.js" %}"></script>
{% endblock %}
</body>
<!-- /body -->
</html>
\ No newline at end of file
</html>
......@@ -27,4 +27,5 @@ urlpatterns = [
])),
# Default login helpers
url(r'^', include('django.contrib.auth.urls')),
url(r'^i18n/', include('django.conf.urls.i18n')),
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment