From 3643c5f2113c0a5cc6d537821257e31ea2eb12f7 Mon Sep 17 00:00:00 2001 From: Brylie Christopher Oxley Date: Thu, 27 Jun 2024 06:57:41 +0300 Subject: [PATCH] Standardize search result templates (#1092) * Standardize search result templates * Apply suggestions from code review * Update search/templates/search/online_worship.html * Update search/templates/search/online_worship.html * Update search/templates/search/online_worship.html * Remove empty conditional --- search/templates/search/community_directory.html | 4 ++-- search/templates/search/event.html | 4 ++-- search/templates/search/magazine_article.html | 8 +++++--- search/templates/search/magazine_issue.html | 4 ++-- search/templates/search/meeting.html | 4 ++-- search/templates/search/online_worship.html | 9 ++------- search/templates/search/organization.html | 4 ++-- search/templates/search/search.html | 4 ++-- search/views.py | 2 +- 9 files changed, 20 insertions(+), 23 deletions(-) diff --git a/search/templates/search/community_directory.html b/search/templates/search/community_directory.html index d661654ea..8b1014859 100644 --- a/search/templates/search/community_directory.html +++ b/search/templates/search/community_directory.html @@ -2,11 +2,11 @@
-

+

{{ entity.title }} -

+ {% if entity.specific.description %} {{ entity.specific.description | truncatewords_html:10 | richtext }} diff --git a/search/templates/search/event.html b/search/templates/search/event.html index 72ac0afbf..a2b3b00b3 100644 --- a/search/templates/search/event.html +++ b/search/templates/search/event.html @@ -2,11 +2,11 @@
-

+

{{ entity.title }} -

+ {% if entity.specific.date %} {{ entity.specific.date }} diff --git a/search/templates/search/magazine_article.html b/search/templates/search/magazine_article.html index 187430d21..3d7d425ff 100644 --- a/search/templates/search/magazine_article.html +++ b/search/templates/search/magazine_article.html @@ -1,9 +1,11 @@ {% load wagtailcore_tags %}
- - {{ entity.title }} - +

+ + {{ entity.title }} + +

{% if entity.specific.authors.count %}
    diff --git a/search/templates/search/magazine_issue.html b/search/templates/search/magazine_issue.html index e88197f62..c13198c13 100644 --- a/search/templates/search/magazine_issue.html +++ b/search/templates/search/magazine_issue.html @@ -2,11 +2,11 @@
    -

    +

    {{ entity.title }} -

    + {% if entity.specific.publication_date %}

    diff --git a/search/templates/search/meeting.html b/search/templates/search/meeting.html index d661654ea..8b1014859 100644 --- a/search/templates/search/meeting.html +++ b/search/templates/search/meeting.html @@ -2,11 +2,11 @@

    -

    +

    {{ entity.title }} -

    + {% if entity.specific.description %} {{ entity.specific.description | truncatewords_html:10 | richtext }} diff --git a/search/templates/search/online_worship.html b/search/templates/search/online_worship.html index 4859c844e..8b1014859 100644 --- a/search/templates/search/online_worship.html +++ b/search/templates/search/online_worship.html @@ -2,19 +2,14 @@
    -

    +

    {{ entity.title }} -

    + {% if entity.specific.description %} {{ entity.specific.description | truncatewords_html:10 | richtext }} {% endif %} - - {% if entity.specific.times_of_worship %} - Times of worship: - {{ entity.specific.times_of_worship | richtext }} - {% endif %}
    diff --git a/search/templates/search/organization.html b/search/templates/search/organization.html index d661654ea..8b1014859 100644 --- a/search/templates/search/organization.html +++ b/search/templates/search/organization.html @@ -2,11 +2,11 @@
    -

    +

    {{ entity.title }} -

    + {% if entity.specific.description %} {{ entity.specific.description | truncatewords_html:10 | richtext }} diff --git a/search/templates/search/search.html b/search/templates/search/search.html index a061cf65c..758c400b7 100644 --- a/search/templates/search/search.html +++ b/search/templates/search/search.html @@ -34,9 +34,9 @@

    Search

    {% else %}
    diff --git a/search/views.py b/search/views.py index 735bc1531..a98a20036 100644 --- a/search/views.py +++ b/search/views.py @@ -11,7 +11,7 @@ def search(request: HttpRequest) -> HttpResponse: number_per_page = 10 # Search - # Using the `or` operator to search for pages that contain any of the words + # Using the 'or' operator to search for pages that contain any of the words if search_query: search_results = Page.objects.live().search( search_query,