Use new modal for edits

This commit is contained in:
Mouse Reeve 2022-01-11 10:27:10 -08:00
parent cdaf0fe8e3
commit 7ccb02f635
4 changed files with 12 additions and 17 deletions

View file

@ -245,7 +245,7 @@
</button>
</div>
</header>
{% include "readthrough/add_readthrough_modal.html" with id="add-readthrough" %}
{% include "readthrough/readthrough_modal.html" with id="add-readthrough" %}
{% if not readthroughs.exists %}
<p>{% trans "You don't have any reading activity for this book." %}</p>

View file

@ -10,6 +10,6 @@ Add read dates for "<em>{{ title }}</em>"
{% block content %}
{% include "readthrough/add_readthrough_modal.html" with book=book active=True static=True %}
{% include "readthrough/readthrough_modal.html" with book=book active=True static=True %}
{% endblock %}

View file

@ -3,7 +3,7 @@
{% load tz %}
{% load utilities %}
<div class="content">
<div id="hide_edit_readthrough_{{ readthrough.id }}" class="box is-shadowless has-background-white-bis">
<div class="box is-shadowless has-background-white-bis">
<div class="columns">
<div class="column">
{% trans "Progress Updates:" %}
@ -58,7 +58,11 @@
<div class="field has-addons">
<div class="control">
{% trans "Edit read dates" as button_text %}
{% include 'snippets/toggle/toggle_button.html' with class="is-small" text=button_text icon="pencil" controls_text="edit_readthrough" controls_uid=readthrough.id focus="edit_readthrough" %}
<button class="button is-small" type="button" data-modal-open="edit_readthrough_{{ readthrough.id }}">
<span class="icon icon-pencil" title="{{ button_text }}">
<span class="is-sr-only">{{ button_text }}</span>
</span>
</button>
</div>
<div class="control">
{% trans "Delete these read dates" as button_text %}
@ -74,16 +78,7 @@
</div>
</div>
<div class="box is-hidden" id="edit_readthrough_{{ readthrough.id }}" tabindex="0">
<h3 class="title is-5">{% trans "Edit read dates" %}</h3>
<form name="edit-readthrough" action="/edit-readthrough" method="post">
{% include 'readthrough/readthrough_form.html' with readthrough=readthrough %}
<div class="field is-grouped">
<button class="button is-primary" type="submit">{% trans "Save" %}</button>
{% trans "Cancel" as button_text %}
{% include 'snippets/toggle/close_button.html' with text=button_text controls_text="edit_readthrough" controls_uid=readthrough.id %}
</div>
</form>
</div>
{% join "delete_readthrough" readthrough.id as modal_id %}
{% include 'readthrough/delete_readthrough_modal.html' with id=modal_id %}
{% join "edit_readthrough" readthrough.id as edit_modal_id %}
{% include "readthrough/readthrough_modal.html" with readthrough=readthrough id=edit_modal_id %}
{% join "delete_readthrough" readthrough.id as delete_modal_id %}
{% include 'readthrough/delete_readthrough_modal.html' with id=delete_modal_id %}