forked from mirrors/bookwyrm
Move reading modal templates to their own dir
This commit is contained in:
parent
c1afd3f852
commit
257c9854c2
13 changed files with 111 additions and 130 deletions
|
@ -9,6 +9,6 @@ Finish "{{ book_title }}"
|
|||
|
||||
{% block content %}
|
||||
|
||||
{% include "snippets/shelve_button/finish_reading_modal.html" with book=book active=True %}
|
||||
{% include "snippets/reading_modals/finish_reading_modal.html" with book=book active=True %}
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -9,6 +9,6 @@ Start "{{ book_title }}"
|
|||
|
||||
{% block content %}
|
||||
|
||||
{% include "snippets/shelve_button/start_reading_modal.html" with book=book active=True %}
|
||||
{% include "snippets/reading_modals/start_reading_modal.html" with book=book active=True %}
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -9,6 +9,6 @@ Want to Read "{{ book_title }}"
|
|||
|
||||
{% block content %}
|
||||
|
||||
{% include "snippets/shelve_button/want_to_read_modal.html" with book=book active=True %}
|
||||
{% include "snippets/reading_modals/want_to_read_modal.html" with book=book active=True %}
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
{% extends 'snippets/reading_modals/layout.html' %}
|
||||
{% load i18n %}
|
||||
{% load utilities %}
|
||||
|
||||
{% block modal-title %}
|
||||
{% blocktrans trimmed with book_title=book|book_title %}
|
||||
Finish "<em>{{ book_title }}</em>"
|
||||
{% endblocktrans %}
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-form-open %}
|
||||
<form name="finish-reading" action="{% url 'reading-status' 'finish' book.id %}" method="post">
|
||||
{% endblock %}
|
||||
|
||||
{% block reading-dates %}
|
||||
<div class="columns">
|
||||
<div class="column is-half">
|
||||
<div class="field">
|
||||
<label class="label" for="finish_id_start_date_{{ uuid }}">
|
||||
{% trans "Started reading" %}
|
||||
</label>
|
||||
<input type="date" name="start_date" class="input" id="finish_id_start_date_{{ uuid }}" value="{{ readthrough.start_date | date:"Y-m-d" }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="column is-half">
|
||||
<div class="field">
|
||||
<label class="label" for="id_finish_date_{{ uuid }}">
|
||||
{% trans "Finished reading" %}
|
||||
</label>
|
||||
<input type="date" name="finish_date" class="input" id="id_finish_date_{{ uuid }}" value="{% now "Y-m-d" %}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
9
bookwyrm/templates/snippets/reading_modals/form.html
Normal file
9
bookwyrm/templates/snippets/reading_modals/form.html
Normal file
|
@ -0,0 +1,9 @@
|
|||
{% extends "snippets/create_status/layout.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block form_open %}{% endblock %}
|
||||
|
||||
{% block initial_fields %}
|
||||
<input type="hidden" name="user" value="{{ request.user.id }}">
|
||||
<input type="hidden" name="mention_books" value="{{ book.id }}">
|
||||
{% endblock %}
|
26
bookwyrm/templates/snippets/reading_modals/layout.html
Normal file
26
bookwyrm/templates/snippets/reading_modals/layout.html
Normal file
|
@ -0,0 +1,26 @@
|
|||
{% extends 'components/modal.html' %}
|
||||
{% load i18n %}
|
||||
{% load utilities %}
|
||||
|
||||
{% block modal-body %}
|
||||
|
||||
{% block reading-dates %}{% endblock %}
|
||||
|
||||
{% with 0|uuid as local_uuid %}
|
||||
<div class="is-flex is-justify-content-space-between">
|
||||
<label for="post_status_start_{{ uuid }}" data-controls="reading_content_{{ local_uuid }}_{{ uuid }}" data-controls-checkbox="post_status_start_{{ local_uuid }}_{{ uuid }}" aria-pressed="true">
|
||||
<input type="checkbox" name="post-status" class="checkbox" id="post_status_start_{{ local_uuid }}_{{ uuid }}" checked>
|
||||
{% trans "Post to feed" %}
|
||||
</label>
|
||||
<div class="is-hidden" id="hide_reading_content_{{ local_uuid }}_{{ uuid }}">
|
||||
<button class="button is-link" type="submit">{% trans "Save" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="reading_content_{{ local_uuid }}_{{ uuid }}">
|
||||
<hr aria-hidden="true">
|
||||
{% include "snippets/reading_modals/form.html" %}
|
||||
</div>
|
||||
{% endwith %}
|
||||
|
||||
{% endblock %}
|
|
@ -0,0 +1,22 @@
|
|||
{% extends 'snippets/reading_modals/layout.html' %}
|
||||
{% load i18n %}
|
||||
{% load utilities %}
|
||||
|
||||
{% block modal-title %}
|
||||
{% blocktrans trimmed with book_title=book|book_title %}
|
||||
Start "<em>{{ book_title }}</em>"
|
||||
{% endblocktrans %}
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-form-open %}
|
||||
<form name="start-reading" action="{% url 'reading-status' 'start' book.id %}" method="post">
|
||||
{% endblock %}
|
||||
|
||||
{% block reading-dates %}
|
||||
<div class="field">
|
||||
<label class="label" for="start_id_start_date_{{ uuid }}">
|
||||
{% trans "Started reading" %}
|
||||
</label>
|
||||
<input type="date" name="start_date" class="input" id="start_id_start_date_{{ uuid }}" value="{% now "Y-m-d" %}">
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -0,0 +1,13 @@
|
|||
{% extends 'snippets/reading_modals/layout.html' %}
|
||||
{% load i18n %}
|
||||
{% load utilities %}
|
||||
|
||||
{% block modal-title %}
|
||||
{% blocktrans trimmed with book_title=book|book_title %}
|
||||
Want to Read "<em>{{ book_title }}</em>"
|
||||
{% endblocktrans %}
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-form-open %}
|
||||
<form name="shelve" action="{% url 'reading-status' 'want' book.id %}" method="post">
|
||||
{% endblock %}
|
|
@ -1,48 +0,0 @@
|
|||
{% extends 'components/modal.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block modal-title %}
|
||||
{% blocktrans with book_title=book.title %}Finish "<em>{{ book_title }}</em>"{% endblocktrans %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block modal-form-open %}
|
||||
<form name="finish-reading" action="{% url 'reading-status' 'finish' book.id %}" method="post">
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-body %}
|
||||
<section class="modal-card-body">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="id" value="{{ readthrough.id }}">
|
||||
<div class="field">
|
||||
<label class="label" for="finish_id_start_date-{{ uuid }}">
|
||||
{% trans "Started reading" %}
|
||||
</label>
|
||||
<input type="date" name="start_date" class="input" id="finish_id_start_date-{{ uuid }}" value="{{ readthrough.start_date | date:"Y-m-d" }}">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label" for="id_finish_date-{{ uuid }}">
|
||||
{% trans "Finished reading" %}
|
||||
</label>
|
||||
<input type="date" name="finish_date" class="input" id="id_finish_date-{{ uuid }}" value="{% now "Y-m-d" %}">
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-footer %}
|
||||
<div class="columns">
|
||||
<div class="column field">
|
||||
<label for="post_status-{{ uuid }}">
|
||||
<input type="checkbox" name="post-status" class="checkbox" id="post_status-{{ uuid }}" checked>
|
||||
{% trans "Post to feed" %}
|
||||
</label>
|
||||
{% include 'snippets/privacy_select.html' %}
|
||||
</div>
|
||||
<div class="column has-text-right">
|
||||
<button type="submit" class="button is-success">{% trans "Save" %}</button>
|
||||
{% trans "Cancel" as button_text %}
|
||||
{% include 'snippets/toggle/close_button.html' with text=button_text controls_text="finish-reading" controls_uid=uuid %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block modal-form-close %}</form>{% endblock %}
|
|
@ -19,13 +19,13 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% include 'snippets/shelve_button/want_to_read_modal.html' with book=active_shelf.book controls_text="want_to_read" controls_uid=uuid %}
|
||||
{% include 'snippets/reading_modals/want_to_read_modal.html' with book=active_shelf.book controls_text="want_to_read" controls_uid=uuid %}
|
||||
|
||||
{% include 'snippets/shelve_button/start_reading_modal.html' with book=active_shelf.book controls_text="start_reading" controls_uid=uuid %}
|
||||
{% include 'snippets/reading_modals/start_reading_modal.html' with book=active_shelf.book controls_text="start_reading" controls_uid=uuid %}
|
||||
|
||||
{% include 'snippets/shelve_button/finish_reading_modal.html' with book=active_shelf.book controls_text="finish_reading" controls_uid=uuid readthrough=readthrough %}
|
||||
{% include 'snippets/reading_modals/finish_reading_modal.html' with book=active_shelf.book controls_text="finish_reading" controls_uid=uuid readthrough=readthrough %}
|
||||
|
||||
{% include 'snippets/shelve_button/progress_update_modal.html' with book=active_shelf_book.book controls_text="progress_update" controls_uid=uuid readthrough=readthrough %}
|
||||
{% include 'snippets/reading_modals/progress_update_modal.html' with book=active_shelf_book.book controls_text="progress_update" controls_uid=uuid readthrough=readthrough %}
|
||||
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
{% extends 'components/modal.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block modal-title %}
|
||||
{% blocktrans trimmed with book_title=book.title %}
|
||||
Start "<em>{{ book_title }}</em>"
|
||||
{% endblocktrans %}
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-form-open %}
|
||||
<form name="start-reading" action="{% url 'reading-status' 'start' book.id %}" method="post">
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-body %}
|
||||
<section class="modal-card-body">
|
||||
{% csrf_token %}
|
||||
<div class="field">
|
||||
<label class="label" for="start_id_start_date-{{ uuid }}">
|
||||
{% trans "Started reading" %}
|
||||
</label>
|
||||
<input type="date" name="start_date" class="input" id="start_id_start_date-{{ uuid }}" value="{% now "Y-m-d" %}">
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-footer %}
|
||||
<div class="columns">
|
||||
<div class="column field">
|
||||
<label for="post_status_start-{{ uuid }}">
|
||||
<input type="checkbox" name="post-status" class="checkbox" id="post_status_start-{{ uuid }}" checked>
|
||||
{% trans "Post to feed" %}
|
||||
</label>
|
||||
{% include 'snippets/privacy_select.html' %}
|
||||
</div>
|
||||
<div class="column has-text-right">
|
||||
<button class="button is-success" type="submit">{% trans "Save" %}</button>
|
||||
{% trans "Cancel" as button_text %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with text=button_text controls_text="start-reading" controls_uid=uuid %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block modal-form-close %}</form>{% endblock %}
|
|
@ -1,33 +0,0 @@
|
|||
{% extends 'components/modal.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block modal-title %}
|
||||
{% blocktrans with book_title=book.title %}Want to Read "<em>{{ book_title }}</em>"{% endblocktrans %}
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-form-open %}
|
||||
<form name="shelve" action="{% url 'reading-status' 'want' book.id %}" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ active_shelf.book.id }}">
|
||||
<input type="hidden" name="shelf" value="to-read">
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-footer %}
|
||||
<div class="columns">
|
||||
<div class="column field">
|
||||
<label for="post_status_want-{{ uuid }}">
|
||||
<input type="checkbox" name="post-status" class="checkbox" id="post_status_want-{{ uuid }}" checked>
|
||||
{% trans "Post to feed" %}
|
||||
</label>
|
||||
{% include 'snippets/privacy_select.html' %}
|
||||
</div>
|
||||
<div class="column">
|
||||
<button class="button is-success" type="submit">
|
||||
<span>{% trans "Want to read" %}</span>
|
||||
</button>
|
||||
{% trans "Cancel" as button_text %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with text=button_text controls_text="want-to-read" controls_uid=uuid %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block modal-form-close %}</form>{% endblock %}
|
Loading…
Reference in a new issue