diff --git a/bookwyrm/templates/author/sync_modal.html b/bookwyrm/templates/author/sync_modal.html index 5d2ff3475..f171e9650 100644 --- a/bookwyrm/templates/author/sync_modal.html +++ b/bookwyrm/templates/author/sync_modal.html @@ -19,13 +19,8 @@ {% endblock %} {% block modal-footer %} - - - + + {% endblock %} {% block modal-form-close %}{% endblock %} diff --git a/bookwyrm/templates/book/book.html b/bookwyrm/templates/book/book.html index 4903da874..b05963dc7 100644 --- a/bookwyrm/templates/book/book.html +++ b/bookwyrm/templates/book/book.html @@ -63,7 +63,11 @@
{% if not book.cover %} {% if user_authenticated %} - - {% include 'book/cover_add_modal.html' with book=book controls_text="add_cover" controls_uid=book.id %} + {% join "add_cover" book.id as modal_id %} + {% include 'book/cover_add_modal.html' with id=modal_id %} {% if request.GET.cover_error %}

{% trans "Failed to load cover" %}

{% endif %} diff --git a/bookwyrm/templates/book/cover_add_modal.html b/bookwyrm/templates/book/cover_add_modal.html index f09b44951..855e52f4a 100644 --- a/bookwyrm/templates/book/cover_add_modal.html +++ b/bookwyrm/templates/book/cover_add_modal.html @@ -1,4 +1,4 @@ -{% extends 'components/modal.html' %} +{% extends 'components/new_modal.html' %} {% load i18n %} {% block modal-title %} @@ -29,8 +29,7 @@ {% block modal-footer %} -{% trans "Cancel" as button_text %} -{% include 'snippets/toggle/toggle_button.html' with text=button_text %} + {% endblock %} -{% block modal-form-close %}{% endblock %} +{% block modal-form-close %}{% endblock %} diff --git a/bookwyrm/templatetags/utilities.py b/bookwyrm/templatetags/utilities.py index 2246fab19..00fa4035c 100644 --- a/bookwyrm/templatetags/utilities.py +++ b/bookwyrm/templatetags/utilities.py @@ -17,6 +17,12 @@ def get_uuid(identifier): return f"{identifier}{uuid4()}" +@register.simple_tag(takes_context=False) +def join(*args): + """concatenate an arbitary set of values""" + return "_".join(str(a) for a in args) + + @register.filter(name="username") def get_user_identifier(user): """use localname for local users, username for remote"""