From 040758c833ea4670aa955f676091ae5564a396da Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sat, 7 Aug 2021 11:15:02 -0700 Subject: [PATCH 01/18] Renames "discover" --- .../{discover => landing}/about.html | 2 +- .../discover.html => landing/landing.html} | 14 +++++------ .../{discover => landing}/landing_layout.html | 0 .../{discover => landing}/large-book.html | 0 .../{discover => landing}/small-book.html | 1 - bookwyrm/tests/views/test_landing.py | 4 ++-- bookwyrm/views/__init__.py | 3 ++- bookwyrm/views/discover.py | 23 +++++++++++++++++++ bookwyrm/views/helpers.py | 4 ++-- bookwyrm/views/landing.py | 14 +++++------ 10 files changed, 44 insertions(+), 21 deletions(-) rename bookwyrm/templates/{discover => landing}/about.html (95%) rename bookwyrm/templates/{discover/discover.html => landing/landing.html} (72%) rename bookwyrm/templates/{discover => landing}/landing_layout.html (100%) rename bookwyrm/templates/{discover => landing}/large-book.html (100%) rename bookwyrm/templates/{discover => landing}/small-book.html (99%) create mode 100644 bookwyrm/views/discover.py diff --git a/bookwyrm/templates/discover/about.html b/bookwyrm/templates/landing/about.html similarity index 95% rename from bookwyrm/templates/discover/about.html rename to bookwyrm/templates/landing/about.html index a6f3a026a..dd7036c4f 100644 --- a/bookwyrm/templates/discover/about.html +++ b/bookwyrm/templates/landing/about.html @@ -1,4 +1,4 @@ -{% extends 'discover/landing_layout.html' %} +{% extends 'landing/landing_layout.html' %} {% load i18n %} {% block panel %} diff --git a/bookwyrm/templates/discover/discover.html b/bookwyrm/templates/landing/landing.html similarity index 72% rename from bookwyrm/templates/discover/discover.html rename to bookwyrm/templates/landing/landing.html index d553c3680..38180c3bf 100644 --- a/bookwyrm/templates/discover/discover.html +++ b/bookwyrm/templates/landing/landing.html @@ -1,4 +1,4 @@ -{% extends 'discover/landing_layout.html' %} +{% extends 'landing/landing_layout.html' %} {% load i18n %} {% block panel %} @@ -10,18 +10,18 @@
- {% include 'discover/large-book.html' with book=books.0 %} + {% include 'landing/large-book.html' with book=books.0 %}
- {% include 'discover/small-book.html' with book=books.1 %} + {% include 'landing/small-book.html' with book=books.1 %}
- {% include 'discover/small-book.html' with book=books.2 %} + {% include 'landing/small-book.html' with book=books.2 %}
@@ -30,18 +30,18 @@
- {% include 'discover/small-book.html' with book=books.3 %} + {% include 'landing/small-book.html' with book=books.3 %}
- {% include 'discover/small-book.html' with book=books.4 %} + {% include 'landing/small-book.html' with book=books.4 %}
- {% include 'discover/large-book.html' with book=books.5 %} + {% include 'landing/large-book.html' with book=books.5 %}
diff --git a/bookwyrm/templates/discover/landing_layout.html b/bookwyrm/templates/landing/landing_layout.html similarity index 100% rename from bookwyrm/templates/discover/landing_layout.html rename to bookwyrm/templates/landing/landing_layout.html diff --git a/bookwyrm/templates/discover/large-book.html b/bookwyrm/templates/landing/large-book.html similarity index 100% rename from bookwyrm/templates/discover/large-book.html rename to bookwyrm/templates/landing/large-book.html diff --git a/bookwyrm/templates/discover/small-book.html b/bookwyrm/templates/landing/small-book.html similarity index 99% rename from bookwyrm/templates/discover/small-book.html rename to bookwyrm/templates/landing/small-book.html index 73133de45..3f7cbecc3 100644 --- a/bookwyrm/templates/discover/small-book.html +++ b/bookwyrm/templates/landing/small-book.html @@ -1,4 +1,3 @@ - {% load bookwyrm_tags %} {% load i18n %} diff --git a/bookwyrm/tests/views/test_landing.py b/bookwyrm/tests/views/test_landing.py index 4d1531e45..476da74b1 100644 --- a/bookwyrm/tests/views/test_landing.py +++ b/bookwyrm/tests/views/test_landing.py @@ -54,9 +54,9 @@ class LandingViews(TestCase): result.render() self.assertEqual(result.status_code, 200) - def test_discover(self): + def test_landing(self): """there are so many views, this just makes sure it LOADS""" - view = views.Discover.as_view() + view = views.Landing.as_view() request = self.factory.get("") result = view(request) self.assertIsInstance(result, TemplateResponse) diff --git a/bookwyrm/views/__init__.py b/bookwyrm/views/__init__.py index eccb7f5e5..15b55accb 100644 --- a/bookwyrm/views/__init__.py +++ b/bookwyrm/views/__init__.py @@ -7,6 +7,7 @@ from .block import Block, unblock from .books import Book, EditBook, ConfirmEditBook, Editions from .books import upload_cover, add_description, switch_edition, resolve_book from .directory import Directory +from .discover import Discover from .edit_user import EditUser, DeleteUser from .federation import Federation, FederatedServer from .federation import AddFederatedServer, ImportServerBlocklist @@ -22,7 +23,7 @@ from .interaction import Favorite, Unfavorite, Boost, Unboost from .invite import ManageInvites, Invite, InviteRequest from .invite import ManageInviteRequests, ignore_invite_request from .isbn import Isbn -from .landing import About, Home, Discover +from .landing import About, Home, Landing from .list import Lists, List, Curate, UserLists from .notifications import Notifications from .outbox import Outbox diff --git a/bookwyrm/views/discover.py b/bookwyrm/views/discover.py new file mode 100644 index 000000000..9bef6974d --- /dev/null +++ b/bookwyrm/views/discover.py @@ -0,0 +1,23 @@ +""" What's up locally """ +from django.contrib.auth.decorators import login_required +from django.template.response import TemplateResponse +from django.utils.decorators import method_decorator +from django.views import View + +from bookwyrm import forms +from . import helpers + + +# pylint: disable= no-self-use +@method_decorator(login_required, name="dispatch") +class Discover(View): + """preview of recently reviewed books""" + + def get(self, request): + """tiled book activity page""" + data = { + "register_form": forms.RegisterForm(), + "request_form": forms.InviteRequestForm(), + "books": helpers.get_landing_books(), + } + return TemplateResponse(request, "landing/landing.html", data) diff --git a/bookwyrm/views/helpers.py b/bookwyrm/views/helpers.py index 42aa48f0e..f757cec95 100644 --- a/bookwyrm/views/helpers.py +++ b/bookwyrm/views/helpers.py @@ -162,8 +162,8 @@ def is_blocked(viewer, user): return False -def get_discover_books(): - """list of books for the discover page""" +def get_landing_books(): + """list of books for the landing page""" return list( set( models.Edition.objects.filter( diff --git a/bookwyrm/views/landing.py b/bookwyrm/views/landing.py index 1361935ee..6f480b70f 100644 --- a/bookwyrm/views/landing.py +++ b/bookwyrm/views/landing.py @@ -13,22 +13,22 @@ class About(View): def get(self, request): """more information about the instance""" - return TemplateResponse(request, "discover/about.html") + return TemplateResponse(request, "landing/about.html") class Home(View): - """discover page or home feed depending on auth""" + """landing page or home feed depending on auth""" def get(self, request): """this is the same as the feed on the home tab""" if request.user.is_authenticated: feed_view = Feed.as_view() return feed_view(request, "home") - discover_view = Discover.as_view() - return discover_view(request) + landing_view = Landing.as_view() + return landing_view(request) -class Discover(View): +class Landing(View): """preview of recently reviewed books""" def get(self, request): @@ -36,6 +36,6 @@ class Discover(View): data = { "register_form": forms.RegisterForm(), "request_form": forms.InviteRequestForm(), - "books": helpers.get_discover_books(), + "books": helpers.get_landing_books(), } - return TemplateResponse(request, "discover/discover.html", data) + return TemplateResponse(request, "landing/landing.html", data) From b5153f3df12a96010fc35c852a47a0a6f0956876 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sat, 7 Aug 2021 12:33:45 -0700 Subject: [PATCH 02/18] WIP --- bookwyrm/templates/discover/discover.html | 54 +++++++++++++++++++++ bookwyrm/templates/discover/large-book.html | 38 +++++++++++++++ bookwyrm/templates/discover/small-book.html | 41 ++++++++++++++++ bookwyrm/templates/landing/large-book.html | 2 +- bookwyrm/templates/landing/small-book.html | 2 +- bookwyrm/views/discover.py | 25 +++++++--- 6 files changed, 154 insertions(+), 8 deletions(-) create mode 100644 bookwyrm/templates/discover/discover.html create mode 100644 bookwyrm/templates/discover/large-book.html create mode 100644 bookwyrm/templates/discover/small-book.html diff --git a/bookwyrm/templates/discover/discover.html b/bookwyrm/templates/discover/discover.html new file mode 100644 index 000000000..0a419e51b --- /dev/null +++ b/bookwyrm/templates/discover/discover.html @@ -0,0 +1,54 @@ +{% extends "layout.html" %} +{% load i18n %} + +{% block title %}{% trans "Discover" %}{% endblock %} + +{% block content %} + +
+

{% trans "Discover" %}

+
+ +
+
+
+
+ {% include 'discover/large-book.html' with status=large.0 %} +
+
+
+
+
+ {% include 'discover/small-book.html' with status=small.0 %} +
+
+
+
+ {% include 'discover/small-book.html' with status=small.1 %} +
+
+
+
+
+
+
+
+ {% include 'discover/small-book.html' with status=small.2 %} +
+
+
+
+ {% include 'discover/small-book.html' with status=small.3 %} +
+
+
+
+
+ {% include 'discover/large-book.html' with status=large.1 %} +
+
+
+
+ + +{% endblock %} diff --git a/bookwyrm/templates/discover/large-book.html b/bookwyrm/templates/discover/large-book.html new file mode 100644 index 000000000..b273d4318 --- /dev/null +++ b/bookwyrm/templates/discover/large-book.html @@ -0,0 +1,38 @@ +{% load bookwyrm_tags %} +{% load markdown %} +{% load i18n %} + +{% if book %} + {% with book=book %} +
+
+ {% include 'snippets/book_cover.html' with cover_class='is-w-l-mobile is-w-auto-tablet' %} + + {% include 'snippets/stars.html' with rating=book|rating:request.user %} +
+ + +
+

+ {{ book.title }} +

+ + {% if book.authors %} +

+ {% trans "by" %} + {% include 'snippets/authors.html' with limit=3 %} +

+ {% endif %} + + {% if book|book_description %} +
+ {{ book|book_description|to_markdown|safe|truncatewords_html:50 }} +
+ {% endif %} +
+
+ {% endwith %} +{% endif %} diff --git a/bookwyrm/templates/discover/small-book.html b/bookwyrm/templates/discover/small-book.html new file mode 100644 index 000000000..052a540cf --- /dev/null +++ b/bookwyrm/templates/discover/small-book.html @@ -0,0 +1,41 @@ +{% load bookwyrm_tags %} +{% load utilities %} +{% load i18n %} + +{% if status %} + {% with book=status.book %} + + {% include 'snippets/book_cover.html' with cover_class='is-w-l-mobile is-h-l-tablet is-w-auto align to-b to-l' %} + + + {% include 'snippets/stars.html' with rating=book|rating:request.user %} + +

+ {{ book.title }} +

+ + {% if book.authors %} +

+ {% trans "by" %} + {% include 'snippets/authors.html' with limit=3 %} +

+ {% endif %} + + + + {% endwith %} +{% endif %} diff --git a/bookwyrm/templates/landing/large-book.html b/bookwyrm/templates/landing/large-book.html index 93026991e..b273d4318 100644 --- a/bookwyrm/templates/landing/large-book.html +++ b/bookwyrm/templates/landing/large-book.html @@ -23,7 +23,7 @@ {% if book.authors %}

{% trans "by" %} - {% include 'snippets/authors.html' %} + {% include 'snippets/authors.html' with limit=3 %}

{% endif %} diff --git a/bookwyrm/templates/landing/small-book.html b/bookwyrm/templates/landing/small-book.html index 3f7cbecc3..2ca505d94 100644 --- a/bookwyrm/templates/landing/small-book.html +++ b/bookwyrm/templates/landing/small-book.html @@ -16,7 +16,7 @@ {% if book.authors %}

{% trans "by" %} - {% include 'snippets/authors.html' %} + {% include 'snippets/authors.html' with limit=3 %}

{% endif %} {% endwith %} diff --git a/bookwyrm/views/discover.py b/bookwyrm/views/discover.py index 9bef6974d..685a4ded7 100644 --- a/bookwyrm/views/discover.py +++ b/bookwyrm/views/discover.py @@ -1,11 +1,14 @@ """ What's up locally """ from django.contrib.auth.decorators import login_required +from django.core.paginator import Paginator +from django.db.models import Q from django.template.response import TemplateResponse from django.utils.decorators import method_decorator from django.views import View -from bookwyrm import forms -from . import helpers +from bookwyrm import models +from bookwyrm.settings import PAGE_LENGTH +from .helpers import privacy_filter # pylint: disable= no-self-use @@ -15,9 +18,19 @@ class Discover(View): def get(self, request): """tiled book activity page""" + activities = privacy_filter( + request.user, + models.Status.objects.select_subclasses().filter( + Q(comment__isnull=False) + | Q(review__isnull=False) + | Q(quotation__isnull=False), + user__local=True + ), + #privacy_levels=["public"] + ) + #paginated = Paginator(activities, PAGE_LENGTH) data = { - "register_form": forms.RegisterForm(), - "request_form": forms.InviteRequestForm(), - "books": helpers.get_landing_books(), + "large": activities.filter(~Q(review__isnull=True, review__content=None))[:2], + "small": activities.filter(~Q(content=None))[:4], } - return TemplateResponse(request, "landing/landing.html", data) + return TemplateResponse(request, "discover/discover.html", data) From e3cbf306847b55cdc04875b335f11271f6857143 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sat, 7 Aug 2021 14:38:19 -0700 Subject: [PATCH 03/18] Local discovery view --- bookwyrm/templates/discover/discover.html | 87 +++++++++++++------ bookwyrm/templates/discover/large-book.html | 66 ++++++++++---- bookwyrm/templates/discover/small-book.html | 43 +++++---- .../templates/snippets/follow_button.html | 20 ++++- bookwyrm/views/discover.py | 18 ++-- 5 files changed, 166 insertions(+), 68 deletions(-) diff --git a/bookwyrm/templates/discover/discover.html b/bookwyrm/templates/discover/discover.html index 0a419e51b..01ef21869 100644 --- a/bookwyrm/templates/discover/discover.html +++ b/bookwyrm/templates/discover/discover.html @@ -5,50 +5,85 @@ {% block content %} -
-

{% trans "Discover" %}

-
+
+
+

{% trans "Discover" %}

+

+ {% blocktrans trimmed with site_name=site.name %} + See what's new in the local {{ site_name }} community + {% endblocktrans %} +

+
-
-
-
+
+
- {% include 'discover/large-book.html' with status=large.0 %} + {% include 'discover/large-book.html' with status=large_activities.0 %}
-
-
+
+
+ {% include 'discover/large-book.html' with status=large_activities.1 %} +
+
+
+ +
+
+
- {% include 'discover/small-book.html' with status=small.0 %} + {% include 'discover/large-book.html' with status=large_activities.2 %}
-
+
+
+
+ {% include 'discover/small-book.html' with status=small_activities.0 %} +
+
+
+
+ {% include 'discover/small-book.html' with status=small_activities.1 %} +
+
+
+
+
+
+
+
+ {% include 'discover/small-book.html' with status=small_activities.2 %} +
+
+
+
+ {% include 'discover/small-book.html' with status=small_activities.3 %} +
+
+
+
- {% include 'discover/small-book.html' with status=small.1 %} + {% include 'discover/large-book.html' with status=large_activities.3 %}
-
-
-
-
- {% include 'discover/small-book.html' with status=small.2 %} -
-
-
-
- {% include 'discover/small-book.html' with status=small.3 %} -
+ +
+
+
+ {% include 'discover/large-book.html' with status=large_activities.4 %}
-
+
- {% include 'discover/large-book.html' with status=large.1 %} + {% include 'discover/large-book.html' with status=large_activities.5 %}
- +
+ {% include 'snippets/pagination.html' with page=large_activities %} +
{% endblock %} diff --git a/bookwyrm/templates/discover/large-book.html b/bookwyrm/templates/discover/large-book.html index b273d4318..81620be1c 100644 --- a/bookwyrm/templates/discover/large-book.html +++ b/bookwyrm/templates/discover/large-book.html @@ -1,37 +1,67 @@ {% load bookwyrm_tags %} -{% load markdown %} {% load i18n %} -{% if book %} - {% with book=book %} +{% if status %} + {% with book=status.book %}
-
+
{% include 'snippets/book_cover.html' with cover_class='is-w-l-mobile is-w-auto-tablet' %} {% include 'snippets/stars.html' with rating=book|rating:request.user %} -
- - -
-

+

{{ book.title }}

{% if book.authors %} -

- {% trans "by" %} - {% include 'snippets/authors.html' with limit=3 %} -

+

+ {% trans "by" %} + {% include 'snippets/authors.html' with limit=3 %} +

{% endif %} - {% if book|book_description %} -
- {{ book|book_description|to_markdown|safe|truncatewords_html:50 }} -
- {% endif %} + {% include 'snippets/shelve_button/shelve_button.html' %} +
+ +
+
+ +
+

+ + {{ status.user.display_name }} + + + {% if status.status_type == 'GeneratedNote' %} + {{ status.content|safe }} + {% elif status.status_type == 'Rating' %} + {% trans "rated" %} + {% elif status.status_type == 'Review' %} + {% trans "reviewed" %} + {% elif status.status_type == 'Comment' %} + {% trans "commented on" %} + {% elif status.status_type == 'Quotation' %} + {% trans "quoted" %} + {% endif %} + + {{ book.title }} +

+
+
+ +
+ {% include 'snippets/follow_button.html' with user=status.user show_username=True minimal=True %} +
+ +
+ {% include "snippets/status/content_status.html" with hide_book=True %} +
{% endwith %} diff --git a/bookwyrm/templates/discover/small-book.html b/bookwyrm/templates/discover/small-book.html index 052a540cf..1318c8bdc 100644 --- a/bookwyrm/templates/discover/small-book.html +++ b/bookwyrm/templates/discover/small-book.html @@ -5,23 +5,14 @@ {% if status %} {% with book=status.book %} - {% include 'snippets/book_cover.html' with cover_class='is-w-l-mobile is-h-l-tablet is-w-auto align to-b to-l' %} + {% include 'snippets/book_cover.html' with cover_class='is-w-l-mobile is-w-auto align to-b to-l' %} - {% include 'snippets/stars.html' with rating=book|rating:request.user %} +
+ {% include 'snippets/shelve_button/shelve_button.html' %} +
-

- {{ book.title }} -

- - {% if book.authors %} -

- {% trans "by" %} - {% include 'snippets/authors.html' with limit=3 %} -

- {% endif %} - -
+
-

+

{{ status.user.display_name }} + + {% if status.status_type == 'GeneratedNote' %} + {{ status.content|safe }} + {% elif status.status_type == 'Rating' %} + {% trans "rated" %} + {% elif status.status_type == 'Review' %} + {% trans "reviewed" %} + {% elif status.status_type == 'Comment' %} + {% trans "commented on" %} + {% elif status.status_type == 'Quotation' %} + {% trans "quoted" %} + {% endif %} + + {{ book.title }}

+ {% if status.rating %} +

+ {% include 'snippets/stars.html' with rating=status.rating %} +

+ {% endif %}
+
+ {% include 'snippets/follow_button.html' with user=status.user show_username=True minimal=True %} +
{% endwith %} {% endif %} diff --git a/bookwyrm/templates/snippets/follow_button.html b/bookwyrm/templates/snippets/follow_button.html index 0cbe6b8cd..8cafad7f9 100644 --- a/bookwyrm/templates/snippets/follow_button.html +++ b/bookwyrm/templates/snippets/follow_button.html @@ -9,15 +9,29 @@
diff --git a/bookwyrm/views/discover.py b/bookwyrm/views/discover.py index 685a4ded7..0b1fae2b5 100644 --- a/bookwyrm/views/discover.py +++ b/bookwyrm/views/discover.py @@ -7,7 +7,6 @@ from django.utils.decorators import method_decorator from django.views import View from bookwyrm import models -from bookwyrm.settings import PAGE_LENGTH from .helpers import privacy_filter @@ -24,13 +23,20 @@ class Discover(View): Q(comment__isnull=False) | Q(review__isnull=False) | Q(quotation__isnull=False), - user__local=True + user__local=True, ), - #privacy_levels=["public"] + privacy_levels=["public"], ) - #paginated = Paginator(activities, PAGE_LENGTH) + large_activities = Paginator( + activities.filter(~Q(content=None), ~Q(content="")), 6 + ) + small_activities = Paginator( + activities.filter(Q(content=None) | Q(content="")), 4 + ) + + page = request.GET.get("page") data = { - "large": activities.filter(~Q(review__isnull=True, review__content=None))[:2], - "small": activities.filter(~Q(content=None))[:4], + "large_activities": large_activities.get_page(page), + "small_activities": small_activities.get_page(page), } return TemplateResponse(request, "discover/discover.html", data) From 760bd5a63fb51671f945bcb2f614eca41240d574 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sat, 7 Aug 2021 15:10:09 -0700 Subject: [PATCH 04/18] Fixes reference to landing page books --- bookwyrm/management/commands/populate_streams.py | 2 +- bookwyrm/views/invite.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bookwyrm/management/commands/populate_streams.py b/bookwyrm/management/commands/populate_streams.py index f8aa21a52..37559f082 100644 --- a/bookwyrm/management/commands/populate_streams.py +++ b/bookwyrm/management/commands/populate_streams.py @@ -8,7 +8,7 @@ def populate_streams(): users = models.User.objects.filter( local=True, is_active=True, - ) + ).order_by("last_active_date") for user in users: for stream in activitystreams.streams.values(): stream.populate_streams(user) diff --git a/bookwyrm/views/invite.py b/bookwyrm/views/invite.py index 3b9fd17c5..005d57cf8 100644 --- a/bookwyrm/views/invite.py +++ b/bookwyrm/views/invite.py @@ -170,9 +170,9 @@ class InviteRequest(View): data = { "request_form": form, "request_received": received, - "books": helpers.get_discover_books(), + "books": helpers.get_landing_books(), } - return TemplateResponse(request, "discover/discover.html", data) + return TemplateResponse(request, "landing/landing.html", data) @require_POST From 650a6037a29abb2c47e0084fc91c29594fe61f7b Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sat, 7 Aug 2021 15:51:53 -0700 Subject: [PATCH 05/18] Trims status text --- bookwyrm/templates/discover/large-book.html | 9 +++++++-- bookwyrm/templates/snippets/trimmed_text.html | 7 ++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/bookwyrm/templates/discover/large-book.html b/bookwyrm/templates/discover/large-book.html index 81620be1c..fdea582d8 100644 --- a/bookwyrm/templates/discover/large-book.html +++ b/bookwyrm/templates/discover/large-book.html @@ -1,5 +1,6 @@ {% load bookwyrm_tags %} {% load i18n %} +{% load status_display %} {% if status %} {% with book=status.book %} @@ -59,9 +60,13 @@ {% include 'snippets/follow_button.html' with user=status.user show_username=True minimal=True %}
-
- {% include "snippets/status/content_status.html" with hide_book=True %} +
+ {% include "snippets/status/content_status.html" with hide_book=True trim_length=100 hide_more=True %}
+ + {% trans "View status" %} + +
{% endwith %} diff --git a/bookwyrm/templates/snippets/trimmed_text.html b/bookwyrm/templates/snippets/trimmed_text.html index cfffe0551..f6174a192 100644 --- a/bookwyrm/templates/snippets/trimmed_text.html +++ b/bookwyrm/templates/snippets/trimmed_text.html @@ -3,20 +3,24 @@ {% load i18n %} {% with 0|uuid as uuid %} +{% firstof trim_length 150 as trim_length %} {% if full %} {% with full|to_markdown|safe as full %} - {% with full|to_markdown|safe|truncatewords_html:150 as trimmed %} + {% with full|to_markdown|safe|truncatewords_html:trim_length as trimmed %} {% if not no_trim and trimmed != full %}
{{ trimmed }}
+ {% if not hide_more %} {% trans "Show more" as button_text %} {% include 'snippets/toggle/open_button.html' with text=button_text controls_text="full" controls_uid=uuid class="is-small" %} + {% endif %}
+ {% if not hide_more %}