Closed patphongs closed 1 month ago
@pat, Maybe we could set a boolean condition in the MUR and ADR sections of global search results template that renders a simpler layout for highlights -- only when the MUR or ADR partial is included in that template (see screenshot)
templates/legal-search-results.jinja
{% with murs = results[category], nested_in_global_search=true %}
{% include 'partials/legal-search-results-mur.jinja' %}
{% endwith %}
partials/legal-search-results-mur.jinja
{% if nested_in_global_search %}
<div class="t-sans u-padding--top">Keyword match:</div>
{% for document in mur.documents %}
{% set query_highlight = mur.document_highlights[loop.index0 | string]%}
{% if(query_highlight) %}
{# show only first document highlight result #}
<ul>
<li class="post--icon t-serif t-italic u-padding--top--med">
…{{ query_highlight[0] | safe }}…
</li>
</ul>
{% endif %}
{% endfor %}
{% endif %}
# (this could also be an `if/else`, with existing document logic wrapped in the else)
Summary
What we're after: When using the global legal keyword search, MURs and ADRs are not showing document highlights. This needs to be fixed.
This bug is related to the logic change in the MUR and ADR templates to only show documents when a keyword and/or document type is selected. The global legal keyword search needs to always display document highlights when present.
Related issues
List any relevant related issue(s)
Completion criteria