Merge pull request #1810 from bookwyrm-social/shelf-breadcrumbs

Shelf breadcrumbs
This commit is contained in:
Mouse Reeve 2022-01-11 12:55:08 -08:00 committed by GitHub
commit 26a089b3c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 29 deletions

View file

@ -16,10 +16,7 @@
{% with shelf_counter=forloop.counter %} {% with shelf_counter=forloop.counter %}
<li> <li>
<p> <p>
{% if shelf.identifier == 'to-read' %}{% trans "To Read" %} {% include "snippets/translated_shelf_name.html" with shelf=shelf %}
{% elif shelf.identifier == 'reading' %}{% trans "Currently Reading" %}
{% elif shelf.identifier == 'read' %}{% trans "Read" %}
{% else %}{{ shelf.name }}{% endif %}
</p> </p>
<div class="tabs is-small is-toggle"> <div class="tabs is-small is-toggle">
<ul> <ul>

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

@ -25,10 +25,7 @@
<button class="button is-fullwidth is-small shelf-option is-radiusless is-white" type="submit" {% if shelf.identifier == current.identifier %}disabled{% endif %}> <button class="button is-fullwidth is-small shelf-option is-radiusless is-white" type="submit" {% if shelf.identifier == current.identifier %}disabled{% endif %}>
<span> <span>
{% if shelf.identifier == 'to-read' %}{% trans "To Read" %} {% include "snippets/translated_shelf_name.html" with shelf=shelf %}
{% elif shelf.identifier == 'reading' %}{% trans "Currently Reading" %}
{% elif shelf.identifier == 'read' %}{% trans "Read" %}
{% else %}{{ shelf.name }}{% endif %}
</span> </span>
</button> </button>
</form> </form>

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 %}

View file

@ -1,16 +1,10 @@
{% load i18n %} {% load i18n %}
{% if is_self %} {% if is_self %}
{% if shelf.identifier == 'to-read' %} {% if shelf.identifier == 'all' %}
{% trans "To Read" %} {% trans "Your books" %}
{% elif shelf.identifier == 'reading' %} {% else %}
{% trans "Currently Reading" %} {% include "snippets/translated_shelf_name.html" with shelf=shelf %}
{% elif shelf.identifier == 'read' %} {% endif %}
{% trans "Read" %}
{% elif shelf.identifier == 'all' %}
{% trans "Your books" %}
{% else %} {% else %}
{{ shelf.name }} {% blocktrans with username=user.display_name %}{{ username }}'s books{% endblocktrans %}
{% endif %}
{% else %}
{% blocktrans with username=user.display_name %}{{ username }}'s books{% endblocktrans %}
{% endif %} {% endif %}