Update web/templates/entry_view.html

This commit is contained in:
Joshua Laymon 2025-08-14 19:53:11 +00:00
parent 60017789df
commit 26e186d63a

View File

@ -15,10 +15,12 @@
</div> </div>
<div class="rt-right"> <div class="rt-right">
<form method="get" action="{% url 'nav_prev' %}" class="inline"> <form method="get" action="{% url 'nav_prev' %}" class="inline">
<!-- send current zero-based index (position-1); view will subtract 1 -->
<input type="hidden" name="i" value="{{ position|add:'-1' }}"> <input type="hidden" name="i" value="{{ position|add:'-1' }}">
<button class="btn btn-lg" {% if position <= 1 %}disabled{% endif %}> Prev</button> <button class="btn btn-lg" {% if position <= 1 %}disabled{% endif %}> Prev</button>
</form> </form>
<form method="get" action="{% url 'nav_next' %}" class="inline"> <form method="get" action="{% url 'nav_next' %}" class="inline">
<!-- send current zero-based index (position-1); view will add 1 -->
<input type="hidden" name="i" value="{{ position|add:'-1' }}"> <input type="hidden" name="i" value="{{ position|add:'-1' }}">
<button class="btn btn-lg btn-primary" {% if position >= count %}disabled{% endif %}>Next </button> <button class="btn btn-lg btn-primary" {% if position >= count %}disabled{% endif %}>Next </button>
</form> </form>
@ -70,11 +72,38 @@
<div class="meta-label">Source</div> <div class="meta-label">Source</div>
<div class="meta-value"> <div class="meta-value">
{% if entry.source %} {% if entry.source %}
<a class="chip chip-link" {% with s=entry.source|trim %}
href="https://wol.jw.org/en/wol/l/r1/lp-e?q={{ entry.source|urlencode }}" {% with sl=s|lower %}
target="_blank" rel="noopener noreferrer"> {% if
{{ entry.source }} sl|startswith:"w" or sl|startswith:"wp" or sl|startswith:"ws" or sl|startswith:"g" or
</a> sl|startswith:"yb" or sl|startswith:"kt" or
sl|startswith:"km" or sl|startswith:"mwb" or
sl|startswith:"ap" or sl|startswith:"apf" or sl|startswith:"be" or sl|startswith:"bh" or
sl|startswith:"br" or sl|startswith:"bt" or sl|startswith:"btg" or sl|startswith:"cf" or
sl|startswith:"cl" or sl|startswith:"ct" or sl|startswith:"dp" or sl|startswith:"fg" or
sl|startswith:"fy" or sl|startswith:"gt" or sl|startswith:"hb" or sl|startswith:"im" or
sl|startswith:"ip" or sl|startswith:"it" or sl|startswith:"jv" or sl|startswith:"ka" or
sl|startswith:"kj" or sl|startswith:"kl" or sl|startswith:"lf" or sl|startswith:"lff" or
sl|startswith:"ll" or sl|startswith:"ly" or sl|startswith:"my" or sl|startswith:"od" or
sl|startswith:"pe" or sl|startswith:"po" or sl|startswith:"pt" or sl|startswith:"rr" or
sl|startswith:"rs" or sl|startswith:"sg" or sl|startswith:"sh" or sl|startswith:"si" or
sl|startswith:"td" or sl|startswith:"tp" or sl|startswith:"tr" or sl|startswith:"ts" or
sl|startswith:"un"
%}
<a class="chip chip-link"
href="https://wol.jw.org/en/wol/l/r1/lp-e?q={{ s|urlencode }}"
target="_blank" rel="noopener noreferrer">
{{ s }}
</a>
{% else %}
<a class="chip chip-link"
href="https://www.google.com/search?q={{ s|urlencode }}"
target="_blank" rel="noopener noreferrer">
{{ s }}
</a>
{% endif %}
{% endwith %}
{% endwith %}
{% else %}—{% endif %} {% else %}—{% endif %}
</div> </div>
</div> </div>
@ -120,26 +149,26 @@
</div> </div>
<style> <style>
.subject-pills { .subject-pills{
display: flex; display:flex;
flex-wrap: wrap; flex-wrap:wrap;
gap: 10px; gap:10px;
margin: 0 0 10px; margin:0 0 10px;
} }
.chip-subject { .chip-subject{
font-weight: 700; font-weight:700;
font-size: 16px; font-size:16px;
padding: 8px 14px; padding:8px 14px;
border-radius: 999px; border-radius:999px;
background: #eef5fc; background:#eef5fc;
border: 1px solid #d7e6f7; border:1px solid #d7e6f7;
color: #0f172a; color:#0f172a;
text-decoration: none; text-decoration:none;
text-transform: capitalize; text-transform: capitalize; /* Capitalize each word */
} }
.chip-subject:hover { .chip-subject:hover{
background: #e2effc; background:#e2effc;
border-color: #c9def5; border-color:#c9def5;
} }
</style> </style>
{% endblock %} {% endblock %}