From ea08b302c9f1cb8ae5f9080d013b4291875d7e35 Mon Sep 17 00:00:00 2001 From: Hugh Rundle Date: Mon, 3 Jan 2022 10:09:52 +1100 Subject: [PATCH] improve group page layout - move 'Add list' button down to the group lists - move member search box underneath members heading - note about members being able to create lists is now under lists heading --- bookwyrm/templates/groups/find_users.html | 3 - bookwyrm/templates/groups/group.html | 67 ++++++++++--------- bookwyrm/templates/groups/layout.html | 12 ---- bookwyrm/templates/groups/members.html | 18 ++++- .../templates/groups/suggested_users.html | 3 + 5 files changed, 53 insertions(+), 50 deletions(-) diff --git a/bookwyrm/templates/groups/find_users.html b/bookwyrm/templates/groups/find_users.html index 377e3a0b3..1b0d54339 100644 --- a/bookwyrm/templates/groups/find_users.html +++ b/bookwyrm/templates/groups/find_users.html @@ -2,8 +2,5 @@ {% load i18n %} {% block searchresults %} -

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

{% include 'groups/suggested_users.html' with suggested_users=suggested_users %} {% endblock %} diff --git a/bookwyrm/templates/groups/group.html b/bookwyrm/templates/groups/group.html index f25a1f270..1a71bda89 100644 --- a/bookwyrm/templates/groups/group.html +++ b/bookwyrm/templates/groups/group.html @@ -1,37 +1,41 @@ {% extends 'groups/layout.html' %} {% load i18n %} {% load bookwyrm_tags %} +{% load bookwyrm_group_tags %} {% load markdown %} {% block panel %}
- - {% if group.user == request.user %} -
-
-
- -
-
- -
-
-
- {% endif %} - {% block searchresults %} {% endblock %}
{% include "groups/members.html" with group=group %}
- -

Lists

+
+
+
+
+

{% trans "Lists" %}

+

+ {% trans "Members of this group can create group-curated lists." %} +

+
+ {% if request.user.is_authenticated and 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.is_authenticated and group|is_member:request.user %} +
+ {% include 'lists/create_form.html' with controls_text="create_list" curation_group=group %} +
+{% endif %} +
+
{% if not lists %}

{% trans "This group has no lists" %}

{% else %} @@ -45,19 +49,17 @@ {{ list.name }} {% include 'snippets/privacy-icons.html' with item=list %} - {% with list_books=list.listitem_set.all|slice:5 %} - {% if list_books %} - - {% endif %} + {% if list_books %} + + {% endif %} {% endwith %} -
{% if list.description %} @@ -74,9 +76,8 @@
{% endfor %}
- {% endif %} - {% include "snippets/pagination.html" with page=items %}
+ {% endblock %} diff --git a/bookwyrm/templates/groups/layout.html b/bookwyrm/templates/groups/layout.html index 99c69f1c9..a25c10850 100644 --- a/bookwyrm/templates/groups/layout.html +++ b/bookwyrm/templates/groups/layout.html @@ -12,12 +12,6 @@ {% include 'groups/created_text.html' with group=group %}

- {% 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 %}