From 69c5bf71ed7ca81b0241cb041c1069af99c69126 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Fri, 22 Jan 2021 12:51:23 -0800 Subject: [PATCH] Uses javascript show/hide for reading progress updates --- bookwyrm/templates/snippets/readthrough.html | 104 ++++++++----------- 1 file changed, 46 insertions(+), 58 deletions(-) diff --git a/bookwyrm/templates/snippets/readthrough.html b/bookwyrm/templates/snippets/readthrough.html index 79248891..618433b5 100644 --- a/bookwyrm/templates/snippets/readthrough.html +++ b/bookwyrm/templates/snippets/readthrough.html @@ -1,67 +1,55 @@ {% load humanize %}
-
- {% if readthrough.start_date %} -
-
Started reading:
-
{{ readthrough.start_date | naturalday }}
+
+
+ Progress Updates: +
+
    + {% if readthrough.finish_date %} +
  • {{ readthrough.start_date | naturalday }}: finished
  • + {% endif %} + {% if readthrough.progress %} +
  • {% if readthrough.progress_mode == 'PG' %}on page {{ readthrough.progress }}{% if book.pages %} of {{ book.pages }}{% endif %} + {% else %}{{ readthrough.progress }}%{% endif %} + {% include 'snippets/toggle/toggle_button.html' with text="Show all updates" controls_text="updates" controls_uid=readthrough.id class="is-small" %} + +
  • + {% endif %} +
  • {{ readthrough.start_date | naturalday }}: started
  • +
- {% endif %} - {% if readthrough.finish_date %} -
-
Finished reading:
-
{{ readthrough.finish_date | naturalday }}
-
- {% elif readthrough.progress %} -
-
Progress:
- {% if readthrough.progress_mode == 'PG' %} -
on page {{ readthrough.progress }} of {{ book.pages }}
- {% else %} -
{{ readthrough.progress }}%
- {% endif %} -
- {% endif %} - -
-
- {% include 'snippets/toggle/toggle_button.html' with class="is-small" text="Edit read dates" icon="pencil" controls_text="edit-readthrough" controls_uid=readthrough.id focus="edit-readthrough" %} -
-
- {% include 'snippets/toggle/toggle_button.html' with class="is-small" text="Delete these read dates" icon="x" controls_text="delete-readthrough" controls_uid=readthrough.id focus="modal-title-delete-readthrough" %} +
+
+
+ {% include 'snippets/toggle/toggle_button.html' with class="is-small" text="Edit read dates" icon="pencil" controls_text="edit-readthrough" controls_uid=readthrough.id focus="edit-readthrough" %} +
+
+ {% include 'snippets/toggle/toggle_button.html' with class="is-small" text="Delete these read dates" icon="x" controls_text="delete-readthrough" controls_uid=readthrough.id focus="modal-title-delete-readthrough" %} +
+
- {% if show_progress %} - Progress Updates: -
    - {% if readthrough.finish_date %} -
  • {{ readthrough.start_date | naturalday }}: finished
  • - {% endif %} - {% for progress_update in readthrough.progress_updates %} -
  • -
    - {% csrf_token %} - {{ progress_update.created_date | naturalday }}: - {% if progress_update.mode == 'PG' %} - page {{ progress_update.progress }} of {{ book.pages }} - {% else %} - {{ progress_update.progress }}% - {% endif %} - - -
    -
  • - {% endfor %} -
  • {{ readthrough.start_date | naturalday }}: started
  • -
- {% elif readthrough.progress_updates|length %} - Show {{ readthrough.progress_updates|length }} Progress Updates - {% endif %}