Fixes stopped reading button logic

The stopped state is similar to finished
This commit is contained in:
Mouse Reeve 2022-05-26 11:28:54 -07:00
parent 9b4a498661
commit 1f6fbd8d29
2 changed files with 11 additions and 7 deletions

View file

@ -13,6 +13,15 @@
</button>
</div>
<div
class="{% if next_shelf_identifier != 'stopped-reading' %}is-hidden{% endif %}"
data-shelf-identifier="stopped-reading"
>
<button type="button" class="button {{ class }}" disabled>
<span>{% trans "Stopped reading" %}</span>
</button>
</div>
{% for shelf in shelves %}
<div
class="{% if next_shelf_identifier != shelf.identifier %}is-hidden{% endif %}"
@ -33,13 +42,6 @@
{% join "finish_reading" button_uuid as modal_id %}
{% include 'snippets/shelve_button/modal_button.html' with class=class fallback_url=fallback_url %}
{% elif shelf.identifier == 'stopped-reading' %}
{% trans "Stop reading" as button_text %}
{% url 'reading-status' 'stop' book.id as fallback_url %}
{% join "stop_reading" button_uuid as modal_id %}
{% include 'snippets/shelve_button/modal_button.html' with class=class fallback_url=fallback_url %}
{% elif shelf.identifier == 'to-read' %}
{% trans "Want to read" as button_text %}

View file

@ -30,6 +30,8 @@ def get_next_shelf(current_shelf):
return "read"
if current_shelf == "read":
return "complete"
if current_shelf == "stopped-reading":
return "stopped-readingt"
return "to-read"