fix(library): use {% comment %} for multi-line template comments
All checks were successful
CVE Scan & Docker Build / security-scan (push) Successful in 50s
CVE Scan & Docker Build / build-and-push (push) Successful in 2m15s

Django's `{# #}` syntax only supports single-line comments; multi-line
blocks were rendering as literal text in the search and library detail
templates. Replace them with `{% comment %}...{% endcomment %}` blocks
and add a note explaining the distinction.
This commit is contained in:
2026-05-10 08:19:15 -04:00
parent a945b382e6
commit 55523adbf7
2 changed files with 19 additions and 12 deletions

View File

@@ -146,11 +146,14 @@
{% if results_reranked.reranker_used %} {% if results_reranked.reranker_used %}
<span class="badge badge-success">{{ results_reranked.reranker_model|default:"on" }}</span> <span class="badge badge-success">{{ results_reranked.reranker_model|default:"on" }}</span>
{% else %} {% else %}
{# The A/B page always requests rerank=True, so a {% comment %}
The A/B page always requests rerank=True, so a
negative here is always a skip with a reason — negative here is always a skip with a reason —
surface the reason in a tooltip so the user surface the reason in a tooltip so the user
knows *why* the B side fell back to fusion knows *why* the B side fell back to fusion order.
order. #} Django's ``{# #}`` comment is single-line only;
multi-line blocks must use ``{% comment %}``.
{% endcomment %}
<span class="badge badge-warning" <span class="badge badge-warning"
title="{{ results_reranked.reranker_skip_reason|default:'unknown' }}"> title="{{ results_reranked.reranker_skip_reason|default:'unknown' }}">
unavailable unavailable

View File

@@ -81,13 +81,17 @@
<div class="stat"> <div class="stat">
<div class="stat-title">Re-ranked</div> <div class="stat-title">Re-ranked</div>
<div class="stat-value text-lg"> <div class="stat-value text-lg">
{# Three-state indicator: {% comment %}
Three-state indicator:
- Yes: re-ranker ran successfully - Yes: re-ranker ran successfully
- Skipped (+ tooltip): re-rank was requested but the - Skipped (+ tooltip): re-rank was requested but the
pipeline bailed — badge colour is a warning so the pipeline bailed — badge colour is a warning so the
user knows something didn't work user knows something didn't work
- Off: user unchecked the re-rank box - Off: user unchecked the re-rank box
#} Note: Django's ``{# #}`` comment is single-line only;
multi-line blocks must use ``{% comment %}`` or they
render as literal text.
{% endcomment %}
{% if results.reranker_used %} {% if results.reranker_used %}
<span class="badge badge-success">Yes</span> <span class="badge badge-success">Yes</span>
{% elif results.reranker_skip_reason %} {% elif results.reranker_skip_reason %}