Skip to content

Commit

Permalink
Standardize search result templates (#1092)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
brylie committed Jun 27, 2024
1 parent 695cfd0 commit 3643c5f
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 23 deletions.
4 changes: 2 additions & 2 deletions search/templates/search/community_directory.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<div class="card my-1">
<div class="card-body">
<h3 class="panel-title">
<h2 class="card-title h5">
<a href="{% pageurl entity %}">
{{ entity.title }}
</a>
</h3>
</h2>

{% if entity.specific.description %}
{{ entity.specific.description | truncatewords_html:10 | richtext }}
Expand Down
4 changes: 2 additions & 2 deletions search/templates/search/event.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<div class="card my-1">
<div class="card-body">
<h3 class="panel-title">
<h2 class="card-title h5">
<a href="{% pageurl entity %}">
{{ entity.title }}
</a>
</h3>
</h2>

{% if entity.specific.date %}
{{ entity.specific.date }}
Expand Down
8 changes: 5 additions & 3 deletions search/templates/search/magazine_article.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{% load wagtailcore_tags %}
<div class="card my-2">
<div class="card-body">
<a href="{% pageurl entity %}" class="card-title lead">
{{ entity.title }}
</a>
<h2 class="card-title h5">
<a href="{% pageurl entity %}">
{{ entity.title }}
</a>
</h2>

{% if entity.specific.authors.count %}
<ul class="list-inline mb-1">
Expand Down
4 changes: 2 additions & 2 deletions search/templates/search/magazine_issue.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<div class="card my-1">
<div class="card-body">
<h3 class="panel-title">
<h2 class="card-title h5">
<a href="{% pageurl entity %}">
{{ entity.title }}
</a>
</h3>
</h2>

{% if entity.specific.publication_date %}
<p class="card-text">
Expand Down
4 changes: 2 additions & 2 deletions search/templates/search/meeting.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<div class="card my-1">
<div class="card-body">
<h3 class="panel-title">
<h2 class="card-title h5">
<a href="{% pageurl entity %}">
{{ entity.title }}
</a>
</h3>
</h2>

{% if entity.specific.description %}
{{ entity.specific.description | truncatewords_html:10 | richtext }}
Expand Down
9 changes: 2 additions & 7 deletions search/templates/search/online_worship.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,14 @@

<div class="card my-1">
<div class="card-body">
<h3 class="panel-title">
<h2 class="card-title h5">
<a href="{% pageurl entity %}">
{{ entity.title }}
</a>
</h3>
</h2>

{% if entity.specific.description %}
{{ entity.specific.description | truncatewords_html:10 | richtext }}
{% endif %}

{% if entity.specific.times_of_worship %}
<strong>Times of worship:</strong>
{{ entity.specific.times_of_worship | richtext }}
{% endif %}
</div>
</div>
4 changes: 2 additions & 2 deletions search/templates/search/organization.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<div class="card my-1">
<div class="card-body">
<h3 class="panel-title">
<h2 class="card-title h5">
<a href="{% pageurl entity %}">
{{ entity.title }}
</a>
</h3>
</h2>

{% if entity.specific.description %}
{{ entity.specific.description | truncatewords_html:10 | richtext }}
Expand Down
4 changes: 2 additions & 2 deletions search/templates/search/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ <h1>Search</h1>
{% else %}
<div class="card my-1">
<div class="card-body">
<h2 class="card-title">
<h2 class="card-title h5">
<a href="{% pageurl result %}">
{{result}} ({{ result.content_type.name }})
{{result}}
</a>
</h2>
</div>
Expand Down
2 changes: 1 addition & 1 deletion search/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3643c5f

Please sign in to comment.