improve footer and add language selector
This commit is contained in:
parent
35056bfaf6
commit
c9299b3cf3
7 changed files with 71 additions and 24 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
<h1>c3nav access control</h1>
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
|
||||
{% include 'site/footer.html' %}
|
||||
</div>
|
||||
|
||||
{% compress js %}
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 %}
|
||||
|
|
33
src/c3nav/site/templates/site/footer.html
Normal file
33
src/c3nav/site/templates/site/footer.html
Normal 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>
|
|
@ -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)),
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue