From 1603df0817a50dcf0ad1de5e322d668518941327 Mon Sep 17 00:00:00 2001 From: Hugh Rundle Date: Sun, 19 Dec 2021 14:19:35 +1100 Subject: [PATCH 01/51] add "Create list" form to group template --- bookwyrm/templates/groups/layout.html | 17 +++++++++++++---- bookwyrm/templates/lists/create_form.html | 2 +- bookwyrm/templates/lists/form.html | 10 +++++----- bookwyrm/views/group.py | 1 + 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/bookwyrm/templates/groups/layout.html b/bookwyrm/templates/groups/layout.html index f558f169a..619c89ee1 100644 --- a/bookwyrm/templates/groups/layout.html +++ b/bookwyrm/templates/groups/layout.html @@ -11,13 +11,22 @@ {% include 'groups/created_text.html' with group=group %}

+ {% if request.user == group.user %}
- {% if request.user == group.user %} - {% trans "Edit group" as button_text %} - {% include 'snippets/toggle/open_button.html' with text=button_text icon_with_text="pencil" controls_text="edit_group" focus="edit_group_header" %} - {% endif %} + {% trans "Create List" as button_text %} + {% include 'snippets/toggle/open_button.html' with controls_text="create_list" icon_with_text="plus" text=button_text focus="create_list_header" %}
+
+ {% trans "Edit group" as button_text %} + {% include 'snippets/toggle/open_button.html' with text=button_text icon_with_text="pencil" controls_text="edit_group" focus="edit_group_header" %} +
+ {% endif %} +{% if request.user.is_authenticated %} +
+ {% include 'lists/create_form.html' with controls_text="create_list" curation_group=group %} +
+{% endif %}
{% include 'snippets/trimmed_text.html' with full=group.description %} diff --git a/bookwyrm/templates/lists/create_form.html b/bookwyrm/templates/lists/create_form.html index 447c0f6bf..a1bda591d 100644 --- a/bookwyrm/templates/lists/create_form.html +++ b/bookwyrm/templates/lists/create_form.html @@ -7,6 +7,6 @@ {% block form %}
- {% include 'lists/form.html' %} + {% include 'lists/form.html' with curation_group=group %}
{% endblock %} diff --git a/bookwyrm/templates/lists/form.html b/bookwyrm/templates/lists/form.html index 25dc01e63..d22488537 100644 --- a/bookwyrm/templates/lists/form.html +++ b/bookwyrm/templates/lists/form.html @@ -19,7 +19,7 @@ {% trans "List curation:" %} @@ -34,17 +34,17 @@