Update web/templates/entry_view.html
This commit is contained in:
@@ -1,48 +1,17 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% block body_class %}themed-bg{% endblock %}
|
|
||||||
{% load static %}
|
{% load static %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="result-wrap">
|
<div class="entry-view">
|
||||||
|
|
||||||
<!-- Top bar: back + counter + clear Prev/Next -->
|
<!-- SUBJECT PILLS -->
|
||||||
<div class="result-toolbar">
|
|
||||||
<div class="rt-left">
|
|
||||||
<a class="btn btn-secondary" href="{% url 'search' %}">← Back to Search</a>
|
|
||||||
{% if count %}
|
|
||||||
<span class="rt-count">{{ position }} of {{ count }}</span>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
<div class="rt-right">
|
|
||||||
<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' }}">
|
|
||||||
<button class="btn btn-lg" {% if position <= 1 %}disabled{% endif %}>‹ Prev</button>
|
|
||||||
</form>
|
|
||||||
<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' }}">
|
|
||||||
<button class="btn btn-lg btn-primary" {% if position >= count %}disabled{% endif %}>Next ›</button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
{% if user.is_authenticated and user.is_staff %}
|
|
||||||
<a class="btn btn-outline" href="{% url 'entry_edit' entry.id %}">Unlock / Edit</a>
|
|
||||||
<a class="btn btn-danger" href="{% url 'entry_delete' entry.id %}">Delete</a>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Main card -->
|
|
||||||
<div class="result-card">
|
|
||||||
|
|
||||||
<!-- SUBJECTS as clickable WOL chips (replaces big title) -->
|
|
||||||
<div class="section" style="margin-top:0;">
|
<div class="section" style="margin-top:0;">
|
||||||
<div class="subject-chip-row" style="display:flex;flex-wrap:wrap;gap:8px;margin:0 0 10px;">
|
<div class="subject-chip-row" style="display:flex;flex-wrap:wrap;gap:10px;margin:0 0 14px;">
|
||||||
{% if subject_list %}
|
{% if subject_list %}
|
||||||
{% for s in subject_list %}
|
{% for s in subject_list %}
|
||||||
<a
|
<a
|
||||||
class="chip chip-link"
|
class="chip chip-link chip-subject"
|
||||||
href="https://wol.jw.org/en/wol/l/r1/lp-e?q={{ s|urlencode }}"
|
href="https://wol.jw.org/en/wol/l/r1/lp-e?q={{ s }}"
|
||||||
target="_blank" rel="noopener"
|
target="_blank" rel="noopener"
|
||||||
title="Search WOL for {{ s }}"
|
title="Search WOL for {{ s }}"
|
||||||
>{{ s }}</a>
|
>{{ s }}</a>
|
||||||
@@ -53,67 +22,104 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ILLUSTRATION -->
|
<!-- SCRIPTURES -->
|
||||||
<div class="section">
|
|
||||||
<div class="section-label">Illustration</div>
|
|
||||||
<div class="section-body lead-text">
|
|
||||||
{{ entry.illustration|linebreaksbr|default:"—" }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- APPLICATION -->
|
|
||||||
<div class="section">
|
|
||||||
<div class="section-label">Application</div>
|
|
||||||
<div class="section-body lead-text">
|
|
||||||
{{ entry.application|linebreaksbr|default:"—" }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Meta (smaller) -->
|
|
||||||
<div class="meta-grid">
|
|
||||||
<div class="meta-item">
|
|
||||||
<div class="meta-label">Source</div>
|
|
||||||
<div class="meta-value">{{ entry.source|default:"—" }}</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="meta-item">
|
|
||||||
<div class="meta-label">Scripture</div>
|
|
||||||
<div class="meta-value">
|
|
||||||
{% if scripture_list %}
|
{% if scripture_list %}
|
||||||
|
<div class="section scripture-links" style="display:flex;flex-wrap:wrap;gap:8px;margin-bottom:20px;">
|
||||||
{% for sc in scripture_list %}
|
{% for sc in scripture_list %}
|
||||||
<a
|
<a
|
||||||
class="chip chip-link"
|
class="chip chip-link"
|
||||||
href="https://wol.jw.org/en/wol/l/r1/lp-e?q={{ sc|urlencode }}"
|
href="https://wol.jw.org/en/wol/l/r1/lp-e?q={{ sc }}"
|
||||||
target="_blank" rel="noopener"
|
target="_blank" rel="noopener"
|
||||||
title="Search WOL for {{ sc }}"
|
title="Search WOL for {{ sc }}"
|
||||||
>{{ sc }}</a>
|
>{{ sc }}</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}—{% endif %}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div class="meta-item">
|
<!-- Illustration -->
|
||||||
<div class="meta-label">Code</div>
|
{% if entry.illustration %}
|
||||||
<div class="meta-value">{{ entry.entry_code|default:"—" }}</div>
|
<div class="section">
|
||||||
|
<h2>Illustration</h2>
|
||||||
|
<p>{{ entry.illustration|linebreaksbr }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div class="meta-item">
|
<!-- Application -->
|
||||||
<div class="meta-label">Talk</div>
|
{% if entry.application %}
|
||||||
<div class="meta-value">
|
<div class="section">
|
||||||
{% if entry.talk_title %}{{ entry.talk_title }}{% else %}—{% endif %}
|
<h2>Application</h2>
|
||||||
{% if entry.talk_number %}<span class="chip chip-muted">#{{ entry.talk_number }}</span>{% endif %}
|
<p>{{ entry.application|linebreaksbr }}</p>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div class="meta-item">
|
<!-- Source -->
|
||||||
<div class="meta-label">Dates</div>
|
{% if entry.source %}
|
||||||
<div class="meta-value small">
|
<div class="section">
|
||||||
{% if entry.date_added %}Added: {{ entry.date_added }}{% else %}Added: —{% endif %}
|
<h2>Source</h2>
|
||||||
{% if entry.date_edited %} • Edited: {{ entry.date_edited }}{% endif %}
|
<p>{{ entry.source }}</p>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- Talk Info -->
|
||||||
|
{% if entry.talk_number or entry.talk_title %}
|
||||||
|
<div class="section">
|
||||||
|
<h2>Talk Info</h2>
|
||||||
|
{% if entry.talk_number %}
|
||||||
|
<p><strong>Number:</strong> {{ entry.talk_number }}</p>
|
||||||
|
{% endif %}
|
||||||
|
{% if entry.talk_title %}
|
||||||
|
<p><strong>Title:</strong> {{ entry.talk_title }}</p>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- Navigation Buttons -->
|
||||||
|
<div class="nav-buttons" style="margin-top: 20px; display:flex;gap:10px;flex-wrap:wrap;">
|
||||||
|
<a class="btn btn-secondary" href="{% url 'nav_prev' %}?i={{ position|add:'-1' }}">Previous</a>
|
||||||
|
<a class="btn btn-secondary" href="{% url 'nav_next' %}?i={{ position|add:'-1' }}">Next</a>
|
||||||
|
{% if user.is_authenticated %}
|
||||||
|
<a class="btn btn-primary" href="{% url 'entry_edit' entry.id %}">Edit</a>
|
||||||
|
{% if user.is_staff %}
|
||||||
|
<a class="btn btn-danger" href="{% url 'entry_delete' entry.id %}">Delete</a>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.chip-subject {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 1rem;
|
||||||
|
padding: 6px 12px;
|
||||||
|
border-radius: 20px;
|
||||||
|
background: #eef2f7;
|
||||||
|
border: 1px solid #d1d5db;
|
||||||
|
color: #1f2937;
|
||||||
|
text-decoration: none;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
transition: background 0.15s, border-color 0.15s;
|
||||||
|
}
|
||||||
|
.chip-subject:hover {
|
||||||
|
background: #dbeafe;
|
||||||
|
border-color: #93c5fd;
|
||||||
|
}
|
||||||
|
.chip {
|
||||||
|
padding: 4px 10px;
|
||||||
|
border-radius: 12px;
|
||||||
|
background: #f3f4f6;
|
||||||
|
border: 1px solid #d1d5db;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
text-decoration: none;
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
.chip-link:hover {
|
||||||
|
background: #e5e7eb;
|
||||||
|
border-color: #cbd5e1;
|
||||||
|
}
|
||||||
|
.section h2 {
|
||||||
|
margin-bottom: 6px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user