Update web/templates/settings/home.html
This commit is contained in:
parent
d6763c3b5f
commit
e9f6637e24
@ -103,84 +103,7 @@ document.getElementById('theme').addEventListener('change', function(e){
|
||||
{% if user.is_authenticated and user.is_superuser %}
|
||||
<h1 class="page-title">Tools</h1>
|
||||
|
||||
<!-- Tools box -->
|
||||
<div class="card" style="padding:20px; margin-bottom:20px;">
|
||||
|
||||
<!-- Scripture Normalizer -->
|
||||
<div class="tool-block">
|
||||
<h3>Scripture Normalizer</h3>
|
||||
<p class="small muted">
|
||||
Standardizes Bible references (book abbreviations, separators, and repeats book names as needed).
|
||||
Use preview first; Apply will modify all <code>scripture_raw</code> fields.
|
||||
</p>
|
||||
<div class="tool-actions">
|
||||
<form method="get" action="{% url 'normalize_scripture' %}" class="inline">
|
||||
<input type="number" min="0" name="limit" placeholder="Preview limit (optional)" class="tool-input">
|
||||
<button class="btn btn-secondary">Preview (dry-run)</button>
|
||||
</form>
|
||||
|
||||
<form method="post" action="{% url 'normalize_scripture' %}" class="inline">
|
||||
{% csrf_token %}
|
||||
<button class="btn btn-danger"
|
||||
onclick="return confirm('Apply Scripture Normalizer to ALL entries? This will modify scripture_raw fields.');">
|
||||
Apply to all
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="tool-sep">
|
||||
|
||||
<!-- Source Normalizer -->
|
||||
<div class="tool-block">
|
||||
<h3>Source Normalizer</h3>
|
||||
<p class="small muted">
|
||||
Converts Watchtower/Awake!/Yearbook/KM references (e.g., “March 15, 2013 WT page 14”) into WOL short-codes
|
||||
like <code>w13 3/15 p.14</code>. Non-JW sources are left unchanged.
|
||||
</p>
|
||||
<div class="tool-actions">
|
||||
<form method="get" action="{% url 'normalize_source' %}" class="inline">
|
||||
<input type="number" min="0" name="limit" placeholder="Preview limit (optional)" class="tool-input">
|
||||
<button class="btn btn-secondary">Preview (dry-run)</button>
|
||||
</form>
|
||||
|
||||
<form method="post" action="{% url 'normalize_source' %}" class="inline">
|
||||
{% csrf_token %}
|
||||
<button class="btn btn-danger"
|
||||
onclick="return confirm('Apply Source Normalizer to ALL entries? This cannot be undone. Make a backup first.');">
|
||||
Apply to all
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="tool-sep">
|
||||
|
||||
<!-- Subject Normalizer -->
|
||||
<div class="tool-block">
|
||||
<h3>Subject Normalizer</h3>
|
||||
<p class="small muted">
|
||||
Normalize the <strong>Subject</strong> field so individual subjects are comma-separated.
|
||||
Preserves multi-word subjects; lightly fixes separators like “;” and spaced dashes.
|
||||
Uses your <code>subjects.txt</code> catalog when available.
|
||||
</p>
|
||||
<div class="tool-actions">
|
||||
<form method="get" action="{% url 'normalize_subjects' %}" class="inline">
|
||||
<input type="number" min="0" name="limit" placeholder="Preview limit (optional)" class="tool-input">
|
||||
<button class="btn btn-secondary">Dry-run Preview</button>
|
||||
</form>
|
||||
|
||||
<form method="post" action="{% url 'normalize_subjects' %}" class="inline">
|
||||
{% csrf_token %}
|
||||
<button class="btn btn-danger"
|
||||
onclick="return confirm('Apply subject normalization to all entries? This cannot be undone. Make a backup first.')">
|
||||
Apply to all
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if user.is_superuser %}
|
||||
<div class="card" style="margin-top:18px; padding:20px;">
|
||||
@ -257,30 +180,7 @@ document.getElementById('theme').addEventListener('change', function(e){
|
||||
|
||||
|
||||
|
||||
{% if user.is_superuser %}
|
||||
<div class="card" style="margin-top:18px;">
|
||||
<h2 class="page-title">Initial Setup</h2>
|
||||
<p class="muted" style="margin:-6px 0 12px;">
|
||||
Superuser-only utilities for first-time population and maintenance.
|
||||
</p>
|
||||
|
||||
<div style="display:flex; flex-wrap:wrap; gap:10px;">
|
||||
<a class="btn btn-primary" href="{% url 'import_wizard' %}">
|
||||
Import CSV
|
||||
</a>
|
||||
|
||||
<a class="btn btn-danger" href="{% url 'delete_all_entries' %}">
|
||||
Delete Database
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="small muted" style="margin-top:10px;">
|
||||
CSV format (columns, in order): <code>Subject, Illustration, Application, Scripture, Source, Talk Title, Talk Number, Code, Date, Date Edited</code>.
|
||||
The Import CSV page supports a dry-run preview before applying changes.
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.tool-block { margin-bottom:16px; }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user