From 8bfc71db6e37e4412b0b62191cddd6aa24dce771 Mon Sep 17 00:00:00 2001 From: Hugh Rundle Date: Sun, 26 Sep 2021 15:56:52 +1000 Subject: [PATCH] create group curated lists --- bookwyrm/templates/groups/group.html | 13 +++++------- bookwyrm/templates/lists/form.html | 30 ++++++++++++++++++++++++++++ bookwyrm/templates/lists/layout.html | 2 +- bookwyrm/templates/user/layout.html | 1 + 4 files changed, 37 insertions(+), 9 deletions(-) diff --git a/bookwyrm/templates/groups/group.html b/bookwyrm/templates/groups/group.html index 4fea5a84..abb24143 100644 --- a/bookwyrm/templates/groups/group.html +++ b/bookwyrm/templates/groups/group.html @@ -11,15 +11,13 @@ {% include "groups/members.html" %}

Lists

- {% if not group.lists.exists %} + {% if not lists %}

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

{% else %} - + + {% endif %} {% include "snippets/pagination.html" with page=items %} diff --git a/bookwyrm/templates/lists/form.html b/bookwyrm/templates/lists/form.html index 9a000d3f..0019520e 100644 --- a/bookwyrm/templates/lists/form.html +++ b/bookwyrm/templates/lists/form.html @@ -1,5 +1,6 @@ {% load i18n %} {% csrf_token %} +{% load utilities %}
@@ -31,6 +32,35 @@ {% trans "Open" %}

{% trans "Anyone can add books to this list" %}

+ + + + + + + + {% if user_groups %} + {% csrf_token %} + +
+
+ +
+
+ {% else %} + {% with user|username as username %} + {% url 'user-groups' user|username as url %} +
{% trans "You must create a " %}{% trans "Group" %}{% trans " before you can create Group lists!" %}
+ {% endwith %} + {% endif %}
diff --git a/bookwyrm/templates/lists/layout.html b/bookwyrm/templates/lists/layout.html index 68abafc0..914478ab 100644 --- a/bookwyrm/templates/lists/layout.html +++ b/bookwyrm/templates/lists/layout.html @@ -25,7 +25,7 @@
- {% include 'lists/edit_form.html' with controls_text="edit_list" %} + {% include 'lists/edit_form.html' with controls_text="edit_list" user_groups=user_groups %}
{% block panel %}{% endblock %} diff --git a/bookwyrm/templates/user/layout.html b/bookwyrm/templates/user/layout.html index 22b8e2ce..357ad467 100755 --- a/bookwyrm/templates/user/layout.html +++ b/bookwyrm/templates/user/layout.html @@ -75,6 +75,7 @@ {% trans "Lists" %} {% endif %} + {% if is_self or user.groups_set.exists %} {% url 'user-groups' user|username as url %}