Adds breadcrumbs to shelf page

This commit is contained in:
Mouse Reeve 2022-01-11 12:03:04 -08:00
parent a47bd7a05b
commit 150756dbd0
2 changed files with 24 additions and 9 deletions

View file

@ -19,6 +19,17 @@
</h1> </h1>
</header> </header>
<nav class="breadcrumb subtitle" aria-label="breadcrumbs">
<ul>
<li><a href="{% url 'user-feed' user|username %}">{% trans "User profile" %}</a></li>
<li class="is-active">
<a href="#" aria-current="page">
{% include "snippets/translated_shelf_name.html" with shelf=shelf %}
</a>
</li>
</ul>
</nav>
<nav class="block columns is-mobile scroll-x"> <nav class="block columns is-mobile scroll-x">
<div class="column pr-0"> <div class="column pr-0">
<div class="tabs"> <div class="tabs">
@ -34,15 +45,7 @@
href="{{ shelf_tab.local_path }}" href="{{ shelf_tab.local_path }}"
{% if shelf_tab.identifier == shelf.identifier %} aria-current="page"{% endif %} {% if shelf_tab.identifier == shelf.identifier %} aria-current="page"{% endif %}
> >
{% if shelf_tab.identifier == 'to-read' %} {% include 'user/books_header.html' with shelf=shelf_tab %}
{% trans "To Read" %}
{% elif shelf_tab.identifier == 'reading' %}
{% trans "Currently Reading" %}
{% elif shelf_tab.identifier == 'read' %}
{% trans "Read" %}
{% else %}
{{ shelf_tab.name }}
{% endif %}
</a> </a>
</li> </li>
{% endfor %} {% endfor %}

View file

@ -0,0 +1,12 @@
{% load i18n %}
{% if shelf.identifier == 'all' %}
{% trans "All books" %}
{% elif shelf.identifier == 'to-read' %}
{% trans "To Read" %}
{% elif shelf.identifier == 'reading' %}
{% trans "Currently Reading" %}
{% elif shelf.identifier == 'read' %}
{% trans "Read" %}
{% else %}
{{ shelf.name }}
{% endif %}