From 5a7aa53544f4bc488e4f09facc3ba3af7c36feb9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Rekucki?= Date: Fri, 18 Jun 2010 12:40:30 +0200 Subject: [PATCH] Fixed #690: Language change UI. --- wolnelektury/settings.py | 4 ++-- wolnelektury/static/css/master.css | 30 ++++++++++++++++++++++++++++++ wolnelektury/templates/base.html | 20 ++++++++++---------- 3 files changed, 42 insertions(+), 12 deletions(-) diff --git a/wolnelektury/settings.py b/wolnelektury/settings.py index 2ece0b1ac..8a82221b9 100644 --- a/wolnelektury/settings.py +++ b/wolnelektury/settings.py @@ -33,7 +33,7 @@ LANGUAGE_CODE = 'pl' gettext = lambda s: s -LANGUAGES = ( +LANGUAGES = tuple(sorted([ ('pl', gettext('Polish')), ('de', gettext('German')), ('en', gettext('English')), @@ -42,7 +42,7 @@ LANGUAGES = ( ('ru', gettext('Russian')), ('es', gettext('Spanish')), ('uk', gettext('Ukrainian')), -) +], key=lambda x: x[0])) SITE_ID = 1 diff --git a/wolnelektury/static/css/master.css b/wolnelektury/static/css/master.css index 669aeb12a..645466cb8 100644 --- a/wolnelektury/static/css/master.css +++ b/wolnelektury/static/css/master.css @@ -88,6 +88,36 @@ em { color: #777; } +.lang-menu { + margin-right: 0.7em; + line-height: 24px; +} + +.lang-menu button { + color: blue; + border: none; + border-right: 1px solid gray; + -moz-border-radius: 2px; + background: inherit; + cursor: pointer; + padding: 0.2em 0.5em; + font-size: 10px; +} + +.lang-menu button:hover { + color: blue; + text-decoration: underline; +} + +.lang-menu button.active { + color: black; + text-decoration: none; +} + +.lang-menu button.last { + border-right: none; +} + /* ======================== */ /* = Footer with sponsors = */ /* ======================== */ diff --git a/wolnelektury/templates/base.html b/wolnelektury/templates/base.html index ca417677d..da5ab63a7 100644 --- a/wolnelektury/templates/base.html +++ b/wolnelektury/templates/base.html @@ -1,14 +1,13 @@ -{% load i18n %} -{% load chunks compressed catalogue_tags sponsor_tags %} + {% load i18n chunks compressed catalogue_tags sponsor_tags %} {% block title %}WolneLektury.pl{% endblock %} {% compressed_css "all" %} - + {% compressed_js "jquery" %} {% compressed_js "all" %} {% block extrahead %} @@ -49,13 +48,14 @@ WolneLektury @ Nasza-Klasa
-
- {% trans "Choose your interface language: " %} - + + {% spaceless %} + {% for lang in LANGUAGES %} + + {% endfor %} + {% endspaceless %}
-- 2.20.1