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

View file

@ -3,7 +3,7 @@
{% load tz %} {% load tz %}
{% load utilities %} {% load utilities %}
<div class="content"> <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="columns">
<div class="column"> <div class="column">
{% trans "Progress Updates:" %} {% trans "Progress Updates:" %}
@ -58,7 +58,11 @@
<div class="field has-addons"> <div class="field has-addons">
<div class="control"> <div class="control">
{% trans "Edit read dates" as button_text %} {% 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>
<div class="control"> <div class="control">
{% trans "Delete these read dates" as button_text %} {% trans "Delete these read dates" as button_text %}
@ -74,16 +78,7 @@
</div> </div>
</div> </div>
<div class="box is-hidden" id="edit_readthrough_{{ readthrough.id }}" tabindex="0"> {% join "edit_readthrough" readthrough.id as edit_modal_id %}
<h3 class="title is-5">{% trans "Edit read dates" %}</h3> {% include "readthrough/readthrough_modal.html" with readthrough=readthrough id=edit_modal_id %}
<form name="edit-readthrough" action="/edit-readthrough" method="post"> {% join "delete_readthrough" readthrough.id as delete_modal_id %}
{% include 'readthrough/readthrough_form.html' with readthrough=readthrough %} {% include 'readthrough/delete_readthrough_modal.html' with id=delete_modal_id %}
<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 %}