mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-10-31 22:19:00 +00:00
Only show author confirmation if new authors are added, show suggestions for parent work and set it correctly.
This commit is contained in:
parent
07aca2f62c
commit
220cad8661
5 changed files with 7 additions and 2 deletions
|
@ -111,6 +111,7 @@ class EditionFromWorkForm(CustomForm):
|
|||
model = models.Work
|
||||
fields = [
|
||||
"title",
|
||||
"sort_title",
|
||||
"subtitle",
|
||||
"authors",
|
||||
"description",
|
||||
|
|
|
@ -111,11 +111,11 @@
|
|||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
{% elif add_author %}
|
||||
<p class="column is-half">{% blocktrans with name=add_author %}Creating a new author: {{ name }}{% endblocktrans %}</p>
|
||||
{% endif %}
|
||||
|
||||
{% if not book %}
|
||||
{% if not book.parent_work %}
|
||||
<div class="column is-half">
|
||||
<fieldset>
|
||||
<legend class="title is-5 mb-1">
|
||||
|
|
|
@ -10,7 +10,9 @@
|
|||
{% csrf_token %}
|
||||
|
||||
<input type="hidden" name="last_edited_by" value="{{ request.user.id }}">
|
||||
{% if form.parent_work %}
|
||||
<input type="hidden" name="parent_work" value="{% firstof book.parent_work.id form.parent_work %}">
|
||||
{% endif %}
|
||||
|
||||
<div class="columns">
|
||||
<div class="column is-half">
|
||||
|
|
|
@ -58,6 +58,7 @@
|
|||
<form action="{% url 'create-book-data' %}" method="POST" name="add-edition-form">
|
||||
{% csrf_token %}
|
||||
{{ work_form.title }}
|
||||
{{ work_form.sort_title }}
|
||||
{{ work_form.subtitle }}
|
||||
{{ work_form.authors }}
|
||||
{{ work_form.description }}
|
||||
|
|
|
@ -157,6 +157,7 @@ def add_authors(request, data):
|
|||
"""helper for adding authors"""
|
||||
add_author = [author for author in request.POST.getlist("add_author") if author]
|
||||
if not add_author:
|
||||
data["add_author"] = []
|
||||
return data
|
||||
|
||||
data["add_author"] = add_author
|
||||
|
|
Loading…
Reference in a new issue