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

@ -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>