Update web/templates/settings/home.html

This commit is contained in:
Joshua Laymon 2025-08-24 19:20:48 +00:00
parent f68eed090e
commit b13aefe162

View File

@ -103,6 +103,66 @@
</div> </div>
{% endif %} {% endif %}
{% if user.is_superuser %}
<div class="card" style="margin-top:18px; padding:20px;">
<h2 class="page-title">Release Announcement</h2>
<p class="muted" style="margin:-6px 0 12px;">
Publish a message to show once to each user on their next search page load.
</p>
<form method="post" action="{% url 'announcement_tools' %}" class="vertical-stack" style="gap:10px;">
{% csrf_token %}
{% if announcement_form %}
{{ announcement_form.as_p }}
{% else %}
{# If this page isn't rendered via announcement_tools view, render a fresh form #}
<label>Title (optional)</label>
<input type="text" name="title" class="tool-input">
<label>Message</label>
<textarea name="message" rows="6" class="tool-input" placeholder="Whats new in this release…"></textarea>
<div style="display:flex; gap:12px; align-items:center; flex-wrap:wrap;">
<label style="display:flex; gap:6px; align-items:center;">
<input type="checkbox" name="is_active" checked> Active
</label>
<label>Start at</label>
<input type="datetime-local" name="start_at">
<label>End at (optional)</label>
<input type="datetime-local" name="end_at">
</div>
{% endif %}
<button class="btn btn-primary">Publish</button>
</form>
{% if announcements_recent %}
<h3 style="margin-top:16px;">Recent</h3>
<table class="table">
<thead>
<tr><th>ID</th><th>Title</th><th>Active?</th><th>Window</th><th>Created</th></tr>
</thead>
<tbody>
{% for a in announcements_recent %}
<tr>
<td>#{{ a.id }}</td>
<td>{{ a.title|default:"(untitled)" }}</td>
<td>{{ a.is_current|yesno:"✅,—" }}</td>
<td>
{{ a.start_at|date:"Y-m-d H:i" }}
{% if a.end_at %} → {{ a.end_at|date:"Y-m-d H:i" }}{% endif %}
</td>
<td>{{ a.created_at|date:"Y-m-d H:i" }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
</div>
{% endif %}
{% if user.is_superuser %} {% if user.is_superuser %}
<div class="card" style="margin-top:18px;"> <div class="card" style="margin-top:18px;">
<h2 class="page-title">Initial Setup</h2> <h2 class="page-title">Initial Setup</h2>