Skip to content

Commit

Permalink
Expose login, logout, admin in footer
Browse files Browse the repository at this point in the history
Styling and indenting in the footer is slightly reworked, as the
logout view has to be invoked with a POST. `hx-disable` is added in
the cases where a full-page reload is required.

With the admin link removed, the navbar now has more space for label
expansion in other languages.
  • Loading branch information
friedelwolff committed Aug 29, 2024
1 parent d604d98 commit 14d213f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/templates/app/_nav_item.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<li class="nav-item me-1"{% if 'admin:' in view %} hx-disable{% endif %}>
<li class="nav-item me-1">
<a href="{% url view %}"
{% if current_page == view %} class="nav-link active px-3" aria-current="page"
{% else %} class="nav-link px-3"
Expand Down
1 change: 0 additions & 1 deletion app/templates/app/_navbar_items.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
{% include "app/_nav_item.html" with view="documents" label=_("Documents") %}
{% include "app/_nav_item.html" with view="languages" label=_("Languages") %}
{% include "app/_nav_item.html" with view="subjects" label=_("Subjects") %}
{% include "app/_nav_item.html" with view="admin:index" label=_("Admin") %}
</ul>
</div>
{% endspaceless %}
36 changes: 29 additions & 7 deletions app/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,38 @@ <h1 id="error-title" class="card-title">{% block error_title %}Error{% endblock

{% spaceless %}
<footer class="footer container-fluid text-bg-primary py-3 link-light"
style="--bs-link-color-rgb: 255, 255, 255">
style="--bs-link-color-rgb: 255, 255, 255; --bs-link-color:#fff; --bs-btn-color:#fff;">
<div class="row text-center">

<div class="col col-sm-8 col-md-6 offset-md-3">
<p><a href="https://sadilar.org" title="{% trans 'External link'%}">{% trans "Developed by SADiLaR" %}</a></p>
<div class="d-md-flex justify-content-center">
<div class="px-2 py-1"><a href="{% url 'legal_notices' %}">{% trans "Legal Notices" %}</a></div>
<div class="px-2 py-1"><a href="{% url 'contact' %}">{% trans "Contact Us" %}</a></div>
<div class="px-2 py-1"><a href="/gebreek">{% trans " - gebreekte skakel -" %}</a></div>
</div>
<p>
<a href="https://sadilar.org" title="{% trans 'External link'%}">
{% trans "Developed by SADiLaR" %}
</a>
</p>
<div class="d-md-flex justify-content-center">
<div class="px-2">
<a href="{% url 'legal_notices' %}" class="btn btn-link p-0">{% trans "Legal Notices" %}</a>
</div>
<div class="px-2">
<a href="{% url 'contact' %}" class="btn btn-link p-0">{% trans "Contact Us" %}</a>
</div>
{% if user.is_authenticated %}
<div class="px-2" hx-disable>
<a href="{% url 'admin:index' %}" class="btn btn-link p-0">{% trans "Admin" %}</a>
</div>
<div class="px-2" hx-disable>
<form id="logout-form" method="post" action="{% url 'logout' %}">
{% csrf_token %}
<button type="submit" class="btn btn-link p-0">{% trans "Logout" %}</button>
</form>
</div>
{% else %}
<div class="px-2" hx-disable>
<a href="{% url 'login' %}" class="btn btn-link p-0">{% trans "Login" %}</a>
</div>
{% endif %}
</div>
</div>

<div class="col col-sm-4 col-md-3 pt-2">
Expand Down

0 comments on commit 14d213f

Please sign in to comment.