improve footer and add language selector

This commit is contained in:
Laura Klünder 2016-12-21 23:18:02 +01:00
parent 35056bfaf6
commit c9299b3cf3
7 changed files with 71 additions and 24 deletions

View file

@ -9,3 +9,19 @@ h1 {
.login .container {
max-width:420px;
}
footer {
text-align:center;
}
.languages {
margin-bottom:0;
height:2px;
}
.languages button {
text-transform:none;
font-weight:normal;
margin-top:0 !important;
border-width:0 !important;
padding:0;
}

View file

@ -19,6 +19,8 @@
<h1>c3nav access control</h1>
{% block content %}
{% endblock %}
{% include 'site/footer.html' %}
</div>
{% compress js %}

View file

@ -205,11 +205,6 @@ template_loaders = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)
if not DEBUG:
template_loaders = (
('django.template.loaders.cached.Loader', template_loaders),
)
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
@ -220,6 +215,7 @@ TEMPLATES = [
'django.template.context_processors.debug',
'django.template.context_processors.i18n',
'django.template.context_processors.request',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
@ -227,6 +223,11 @@ TEMPLATES = [
},
},
]
if not DEBUG:
template_loaders = (
('django.template.loaders.cached.Loader', template_loaders),
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',

View file

@ -278,3 +278,15 @@ footer {
padding-bottom: 18px;
}
}
.languages {
margin-bottom:0;
height:2px;
}
.languages button {
text-transform:none;
font-weight:normal;
margin-top:0 !important;
border-width:0 !important;
padding:0;
}

View file

@ -22,25 +22,7 @@
{% block content %}
{% endblock %}
<footer>
<a href="https://github.com/c3nav/c3nav">GitHub</a>
- <a href="https://twitter.com/c3nav">Twitter</a>
<a href="{% url 'editor.index' %}">{% trans 'Editor' %}</a>
<a href="/api/">{% trans 'API' %}</a>
{% if full_access or access_list %}
<br><small>
{% if full_access %}
{% trans 'full access unlocked' %}
{% else %}
{% blocktrans count count=access_list|length %}
{{ count }} one area unlocked
{% plural %}
{{ count }} areas unlocked
{% endblocktrans %}
{% endif %}
</small>
{% endif %}
</footer>
{% include 'site/footer.html' %}
</div>
{% compress js %}

View file

@ -0,0 +1,33 @@
{% load i18n %}
<footer>
<a href="https://github.com/c3nav/c3nav">GitHub</a>
<a href="https://twitter.com/c3nav">Twitter</a>
<a href="{% url 'editor.index' %}">{% trans 'Editor' %}</a>
<a href="/api/">{% trans 'API' %}</a>
<form action="{% url 'set_language' %}" method="post" class="languages">
{% csrf_token %}
<input name="next" type="hidden" value="{{ request.path }}" />
{% get_available_languages as LANGUAGES %}
{% get_language_info_list for LANGUAGES as languages %}
{% for language in languages %}
{% if not forloop.first %}{% endif %}
<button type="submit" name="language" value="{{ language.code }}" class="btn btn-link btn-xs">
{{ language.name_local }}
</button>
{% endfor %}
</form>
{% if full_access or access_list %}
<br><small>
{% if full_access %}
{% trans 'full access unlocked' %}
{% else %}
{% blocktrans count count=access_list|length %}
{{ count }} one area unlocked
{% plural %}
{{ count }} areas unlocked
{% endblocktrans %}
{% endif %}
</small>
{% endif %}
</footer>

View file

@ -11,5 +11,6 @@ urlpatterns = [
url(r'^editor/', include(c3nav.editor.urls)),
url(r'^api/', include(c3nav.api.urls, namespace='api')),
url(r'^admin/', admin.site.urls),
url(r'^locales/', include('django.conf.urls.i18n')),
url(r'^', include(c3nav.site.urls)),
]