diff --git a/bookwyrm/settings.py b/bookwyrm/settings.py index 31c2edf80..895a537a4 100644 --- a/bookwyrm/settings.py +++ b/bookwyrm/settings.py @@ -13,7 +13,7 @@ VERSION = "0.0.1" PAGE_LENGTH = env("PAGE_LENGTH", 15) DEFAULT_LANGUAGE = env("DEFAULT_LANGUAGE", "English") -JS_CACHE = "7f2343cf" +JS_CACHE = "e2bc0653" # email EMAIL_BACKEND = env("EMAIL_BACKEND", "django.core.mail.backends.smtp.EmailBackend") diff --git a/bookwyrm/static/js/status_cache.js b/bookwyrm/static/js/status_cache.js index b3e345b19..2a50bfcbe 100644 --- a/bookwyrm/static/js/status_cache.js +++ b/bookwyrm/static/js/status_cache.js @@ -141,8 +141,10 @@ let StatusCache = new class { modal.getElementsByClassName("modal-close")[0].click(); // Update shelve buttons - document.querySelectorAll("[data-shelve-button-book='" + form.book.value +"']") - .forEach(button => this.cycleShelveButtons(button, form.reading_status.value)); + if (form.reading_status) { + document.querySelectorAll("[data-shelve-button-book='" + form.book.value +"']") + .forEach(button => this.cycleShelveButtons(button, form.reading_status.value)); + } return; } diff --git a/bookwyrm/templates/snippets/progress_field.html b/bookwyrm/templates/snippets/progress_field.html new file mode 100644 index 000000000..8feb5a583 --- /dev/null +++ b/bookwyrm/templates/snippets/progress_field.html @@ -0,0 +1,27 @@ +{% load i18n %} +
+
+ +
+
+ +
+
diff --git a/bookwyrm/templates/snippets/reading_modals/finish_reading_modal.html b/bookwyrm/templates/snippets/reading_modals/finish_reading_modal.html index b041b70aa..96e4da9b6 100644 --- a/bookwyrm/templates/snippets/reading_modals/finish_reading_modal.html +++ b/bookwyrm/templates/snippets/reading_modals/finish_reading_modal.html @@ -11,6 +11,7 @@ Finish "{{ book_title }}" {% block modal-form-open %}
{% csrf_token %} + {% endblock %} diff --git a/bookwyrm/templates/snippets/reading_modals/form.html b/bookwyrm/templates/snippets/reading_modals/form.html index 382407ba7..4a7ac3a5b 100644 --- a/bookwyrm/templates/snippets/reading_modals/form.html +++ b/bookwyrm/templates/snippets/reading_modals/form.html @@ -5,12 +5,13 @@ {% block content_label %} {% trans "Comment:" %} +{% if optional %} {% trans "(Optional)" %} +{% endif %} {% endblock %} {% block initial_fields %} - {% endblock %} diff --git a/bookwyrm/templates/snippets/reading_modals/layout.html b/bookwyrm/templates/snippets/reading_modals/layout.html index 0f5dedb0a..95010b372 100644 --- a/bookwyrm/templates/snippets/reading_modals/layout.html +++ b/bookwyrm/templates/snippets/reading_modals/layout.html @@ -13,14 +13,18 @@ {% trans "Post to feed" %}
- {% include "snippets/reading_modals/form.html" with optional=True %} + {% comparison_bool controls_text "progress_update" True as optional %} + {% include "snippets/reading_modals/form.html" with optional=optional %}
{% endwith %} diff --git a/bookwyrm/templates/snippets/reading_modals/progress_update_modal.html b/bookwyrm/templates/snippets/reading_modals/progress_update_modal.html index b2aa27a6d..713dad8d4 100644 --- a/bookwyrm/templates/snippets/reading_modals/progress_update_modal.html +++ b/bookwyrm/templates/snippets/reading_modals/progress_update_modal.html @@ -1,4 +1,4 @@ -{% extends 'components/modal.html' %} +{% extends 'snippets/reading_modals/layout.html' %} {% load i18n %} {% block modal-title %} @@ -6,42 +6,12 @@ {% endblock %} {% block modal-form-open %} - -{% endblock %} - -{% block modal-body %} + {% csrf_token %} - -
- -
-
- -
-
- -
-
- {% if readthrough.progress_mode == 'PG' and book.pages %} -

{% blocktrans with pages=book.pages %}of {{ pages }} pages{% endblocktrans %}

- {% endif %} -
+ {% endblock %} -{% block modal-footer %} - -{% trans "Cancel" as button_text %} -{% include 'snippets/toggle/toggle_button.html' with text=button_text %} +{% block reading-dates %} + +{% include "snippets/progress_field.html" with progress_required=True %} {% endblock %} -{% block modal-form-close %}
{% endblock %} diff --git a/bookwyrm/templates/snippets/readthrough_form.html b/bookwyrm/templates/snippets/readthrough_form.html index 132472d25..8810778cd 100644 --- a/bookwyrm/templates/snippets/readthrough_form.html +++ b/bookwyrm/templates/snippets/readthrough_form.html @@ -13,17 +13,7 @@ -
-
- -
-
- -
-
+{% include "snippets/progress_field.html" %} {% endif %}