mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-29 21:11:16 +00:00
Merge pull request #1810 from bookwyrm-social/shelf-breadcrumbs
Shelf breadcrumbs
This commit is contained in:
commit
26a089b3c9
5 changed files with 32 additions and 29 deletions
|
@ -16,10 +16,7 @@
|
|||
{% with shelf_counter=forloop.counter %}
|
||||
<li>
|
||||
<p>
|
||||
{% if shelf.identifier == 'to-read' %}{% trans "To Read" %}
|
||||
{% elif shelf.identifier == 'reading' %}{% trans "Currently Reading" %}
|
||||
{% elif shelf.identifier == 'read' %}{% trans "Read" %}
|
||||
{% else %}{{ shelf.name }}{% endif %}
|
||||
{% include "snippets/translated_shelf_name.html" with shelf=shelf %}
|
||||
</p>
|
||||
<div class="tabs is-small is-toggle">
|
||||
<ul>
|
||||
|
|
|
@ -19,6 +19,17 @@
|
|||
</h1>
|
||||
</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">
|
||||
<div class="column pr-0">
|
||||
<div class="tabs">
|
||||
|
@ -34,15 +45,7 @@
|
|||
href="{{ shelf_tab.local_path }}"
|
||||
{% if shelf_tab.identifier == shelf.identifier %} aria-current="page"{% endif %}
|
||||
>
|
||||
{% if shelf_tab.identifier == 'to-read' %}
|
||||
{% trans "To Read" %}
|
||||
{% elif shelf_tab.identifier == 'reading' %}
|
||||
{% trans "Currently Reading" %}
|
||||
{% elif shelf_tab.identifier == 'read' %}
|
||||
{% trans "Read" %}
|
||||
{% else %}
|
||||
{{ shelf_tab.name }}
|
||||
{% endif %}
|
||||
{% include 'user/books_header.html' with shelf=shelf_tab %}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
|
|
@ -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 %}>
|
||||
<span>
|
||||
{% if shelf.identifier == 'to-read' %}{% trans "To Read" %}
|
||||
{% elif shelf.identifier == 'reading' %}{% trans "Currently Reading" %}
|
||||
{% elif shelf.identifier == 'read' %}{% trans "Read" %}
|
||||
{% else %}{{ shelf.name }}{% endif %}
|
||||
{% include "snippets/translated_shelf_name.html" with shelf=shelf %}
|
||||
</span>
|
||||
</button>
|
||||
</form>
|
||||
|
|
12
bookwyrm/templates/snippets/translated_shelf_name.html
Normal file
12
bookwyrm/templates/snippets/translated_shelf_name.html
Normal 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 %}
|
|
@ -1,16 +1,10 @@
|
|||
{% load i18n %}
|
||||
{% if is_self %}
|
||||
{% if shelf.identifier == 'to-read' %}
|
||||
{% trans "To Read" %}
|
||||
{% elif shelf.identifier == 'reading' %}
|
||||
{% trans "Currently Reading" %}
|
||||
{% elif shelf.identifier == 'read' %}
|
||||
{% trans "Read" %}
|
||||
{% elif shelf.identifier == 'all' %}
|
||||
{% trans "Your books" %}
|
||||
{% if shelf.identifier == 'all' %}
|
||||
{% trans "Your books" %}
|
||||
{% else %}
|
||||
{% include "snippets/translated_shelf_name.html" with shelf=shelf %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{{ shelf.name }}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% blocktrans with username=user.display_name %}{{ username }}'s books{% endblocktrans %}
|
||||
{% blocktrans with username=user.display_name %}{{ username }}'s books{% endblocktrans %}
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in a new issue