mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-29 04:51:11 +00:00
Fixes adding books from list page view
This commit is contained in:
parent
5879b4be5c
commit
2e15c227f3
5 changed files with 8 additions and 7 deletions
|
@ -4,7 +4,7 @@
|
||||||
{% load group_tags %}
|
{% load group_tags %}
|
||||||
|
|
||||||
{% block modal-title %}
|
{% block modal-title %}
|
||||||
{% if list.curation == 'open' or request.user == list.user or list.group|is_member:request.user %}
|
{% if list.suggests_for or list.curation == 'open' or request.user == list.user or list.group|is_member:request.user %}
|
||||||
{% blocktrans trimmed with title=book|book_title %}
|
{% blocktrans trimmed with title=book|book_title %}
|
||||||
Add "<em>{{ title }}</em>" to this list
|
Add "<em>{{ title }}</em>" to this list
|
||||||
{% endblocktrans %}
|
{% endblocktrans %}
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
<form
|
<form
|
||||||
name="add-book-{{ book.id }}"
|
name="add-book-{{ book.id }}"
|
||||||
method="POST"
|
method="POST"
|
||||||
{% if is_suggestion %}
|
{% if list.suggests_for %}
|
||||||
action="{% url 'book-add-suggestion' book_id=list.suggests_for.id %}{% if query %}?suggestion_query={{ query }}#suggestions-section{% endif %}"
|
action="{% url 'book-add-suggestion' book_id=list.suggests_for.id %}{% if query %}?suggestion_query={{ query }}#suggestions-section{% endif %}"
|
||||||
{% else %}
|
{% else %}
|
||||||
action="{% url 'list-add-book' %}{% if query %}?q={{ query }}{% endif %}"
|
action="{% url 'list-add-book' %}{% if query %}?q={{ query }}{% endif %}"
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
<div class="buttons is-right is-flex-grow-1">
|
<div class="buttons is-right is-flex-grow-1">
|
||||||
<button type="button" class="button" data-modal-close>{% trans "Cancel" %}</button>
|
<button type="button" class="button" data-modal-close>{% trans "Cancel" %}</button>
|
||||||
<button type="submit" class="button is-link">
|
<button type="submit" class="button is-link">
|
||||||
{% if list.curation == 'open' or request.user == list.user or list.group|is_member:request.user %}
|
{% if list.suggests_for or list.curation == 'open' or request.user == list.user or list.group|is_member:request.user %}
|
||||||
{% trans "Add" %}
|
{% trans "Add" %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% trans "Suggest" %}
|
{% trans "Suggest" %}
|
||||||
|
|
|
@ -161,14 +161,13 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if request.user.is_authenticated and not list.curation == 'closed' or request.user == list.user %}
|
{% if request.user.is_authenticated and not list.curation == 'closed' or request.user == list.user %}
|
||||||
<h2 class="title is-5 mt-6">
|
<h2 class="title is-5 mt-6">
|
||||||
{% if list.curation == 'open' or request.user == list.user or list.group|is_member:request.user %}
|
{% if list.suggests_for or list.curation == 'open' or request.user == list.user or list.group|is_member:request.user %}
|
||||||
{% trans "Add Books" %}
|
{% trans "Add Books" %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% trans "Suggest Books" %}
|
{% trans "Suggest Books" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</h2>
|
</h2>
|
||||||
{% url 'list' list_id=list.id slug=list.name|slugify as search_url %}
|
{% include "lists/suggestion_search.html" with query_param="q" search_url=add_book_url %}
|
||||||
{% include "lists/suggestion_search.html" with query_param="q" %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div>
|
<div>
|
||||||
<h2 class="title is-5 mt-6" id="embed-label">
|
<h2 class="title is-5 mt-6" id="embed-label">
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
class="button is-small is-link"
|
class="button is-small is-link"
|
||||||
data-modal-open="{{ modal_id }}"
|
data-modal-open="{{ modal_id }}"
|
||||||
>
|
>
|
||||||
{% if list.curation == 'open' or request.user == list.user or list.group|is_member:request.user %}
|
{% if list.suggests_for or list.curation == 'open' or request.user == list.user or list.group|is_member:request.user %}
|
||||||
{% trans "Add" %}
|
{% trans "Add" %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% trans "Suggest" %}
|
{% trans "Suggest" %}
|
||||||
|
|
|
@ -73,6 +73,7 @@ class List(View):
|
||||||
"embed_url": embed_url,
|
"embed_url": embed_url,
|
||||||
"add_failed": add_failed,
|
"add_failed": add_failed,
|
||||||
"add_succeeded": add_succeeded,
|
"add_succeeded": add_succeeded,
|
||||||
|
"add_book_url": reverse("list-add-book"),
|
||||||
}
|
}
|
||||||
|
|
||||||
if request.user.is_authenticated:
|
if request.user.is_authenticated:
|
||||||
|
|
|
@ -56,6 +56,7 @@ class SuggestionList(View):
|
||||||
"embed_url": embed_url,
|
"embed_url": embed_url,
|
||||||
"add_failed": add_failed,
|
"add_failed": add_failed,
|
||||||
"add_succeeded": add_succeeded,
|
"add_succeeded": add_succeeded,
|
||||||
|
"add_book_url": reverse("book-add-suggestion", args=[book_id]),
|
||||||
}
|
}
|
||||||
|
|
||||||
if request.user.is_authenticated:
|
if request.user.is_authenticated:
|
||||||
|
|
Loading…
Reference in a new issue