From 1603df0817a50dcf0ad1de5e322d668518941327 Mon Sep 17 00:00:00 2001 From: Hugh Rundle Date: Sun, 19 Dec 2021 14:19:35 +1100 Subject: [PATCH 1/6] 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 @@
- {% if group|is_member:request.user %} -
- {% 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" %} -
- {% endif %} {% if request.user == group.user %}
{% trans "Edit group" as button_text %} @@ -30,12 +24,6 @@ {% include 'snippets/trimmed_text.html' with full=group.description %}
-{% if request.user.is_authenticated %} -
- {% include 'lists/create_form.html' with controls_text="create_list" curation_group=group %} -
-{% endif %} -
{% include 'groups/edit_form.html' with controls_text="edit_group" %}
diff --git a/bookwyrm/templates/groups/members.html b/bookwyrm/templates/groups/members.html index 719674d89..8b06d178a 100644 --- a/bookwyrm/templates/groups/members.html +++ b/bookwyrm/templates/groups/members.html @@ -5,8 +5,22 @@ {% load bookwyrm_group_tags %}

Group Members

-

{% trans "Members can add and remove books on a group's book lists" %}

- +{% if group.user == request.user %} +
+
+
+ +
+
+ +
+
+
+{% endif %} {% if group.user != request.user and group|is_member:request.user %}
{% csrf_token %} diff --git a/bookwyrm/templates/groups/suggested_users.html b/bookwyrm/templates/groups/suggested_users.html index 64498eb85..581448d45 100644 --- a/bookwyrm/templates/groups/suggested_users.html +++ b/bookwyrm/templates/groups/suggested_users.html @@ -3,6 +3,9 @@ {% load humanize %} {% if suggested_users %} +

+ {% trans "Add new members!" %} +

{% for user in suggested_users %}