From df5a5f94a1e60fc0c2ad9169f0c57504f441afde Mon Sep 17 00:00:00 2001 From: Hugh Rundle Date: Mon, 27 Sep 2021 19:27:39 +1000 Subject: [PATCH] fix local_path for groups --- bookwyrm/models/group.py | 4 ++ bookwyrm/templates/groups/group.html | 78 +++++++++++----------- bookwyrm/templates/lists/created_text.html | 2 +- 3 files changed, 43 insertions(+), 41 deletions(-) diff --git a/bookwyrm/models/group.py b/bookwyrm/models/group.py index 6810779c..4d9d2815 100644 --- a/bookwyrm/models/group.py +++ b/bookwyrm/models/group.py @@ -24,6 +24,10 @@ class Group(BookWyrmModel): related_name="members" ) + def get_remote_id(self): + """don't want the user to be in there in this case""" + return f"https://{DOMAIN}/group/{self.id}" + class GroupMember(models.Model): """Users who are members of a group""" diff --git a/bookwyrm/templates/groups/group.html b/bookwyrm/templates/groups/group.html index abb24143..6c44e3b4 100644 --- a/bookwyrm/templates/groups/group.html +++ b/bookwyrm/templates/groups/group.html @@ -15,49 +15,47 @@

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

{% else %} -
- {% for list in lists %} -
-
-
-

- {{ list.name }} {% include 'snippets/privacy-icons.html' with item=list %} -

-
- - {% with list_books=list.listitem_set.all|slice:5 %} - {% if list_books %} - - {% endif %} - {% endwith %} - -
-
- {% if list.description %} - {{ list.description|to_markdown|safe|truncatechars_html:30 }} - {% else %} -   - {% endif %} -
-

- {% include 'lists/created_text.html' with list=list %} -

-
-
-
- {% endfor %} -
- +
+ {% for list in lists %} +
+
+
+

+ {{ list.name }} {% include 'snippets/privacy-icons.html' with item=list %} +

+
+ + {% with list_books=list.listitem_set.all|slice:5 %} + {% if list_books %} + + {% endif %} + {% endwith %} + +
+
+ {% if list.description %} + {{ list.description|to_markdown|safe|truncatechars_html:30 }} + {% else %} +   + {% endif %} +
+

+ {% include 'lists/created_text.html' with list=list %} +

+
+
+
+ {% endfor %} +
{% endif %} {% include "snippets/pagination.html" with page=items %} - {% endblock %} diff --git a/bookwyrm/templates/lists/created_text.html b/bookwyrm/templates/lists/created_text.html index 6c6247ad..f5405b64 100644 --- a/bookwyrm/templates/lists/created_text.html +++ b/bookwyrm/templates/lists/created_text.html @@ -2,7 +2,7 @@ {% spaceless %} {% if list.curation == 'group' %} -{% blocktrans with username=list.user.display_name userpath=list.user.local_path groupname=list.group.name grouppath=list.group.local_path %}Created by {{ username }} and managed by {{ groupname }}{% endblocktrans %} +{% blocktrans with username=list.user.display_name userpath=list.user.local_path groupname=list.group.name grouppath=list.group.local_path %}Created by {{ username }} and managed by {{ groupname }}{% endblocktrans %} {% elif list.curation != 'open' %} {% blocktrans with username=list.user.display_name path=list.user.local_path %}Created and curated by {{ username }}{% endblocktrans %} {% else %}