Refactor feed URL and update interval sections

This commit is contained in:
Joakim Hellsén 2026-03-07 19:06:57 +01:00
commit a7e0213b1a
Signed by: Joakim Hellsén
SSH key fingerprint: SHA256:/9h/CsExpFp+PRhsfA0xznFx2CGfTT5R/kpuFfUgEQk

View file

@ -79,7 +79,6 @@
<!-- Feed URL Configuration --> <!-- Feed URL Configuration -->
<div class="mt-4 border-top border-secondary pt-3"> <div class="mt-4 border-top border-secondary pt-3">
<h5 class="mb-3">Feed URL</h5> <h5 class="mb-3">Feed URL</h5>
<p class="text-muted mb-2">Change the URL for this feed. This can be useful if a feed has moved.</p>
<form action="/change_feed_url" method="post" class="mb-2"> <form action="/change_feed_url" method="post" class="mb-2">
<input type="hidden" name="old_feed_url" value="{{ feed.url }}" /> <input type="hidden" name="old_feed_url" value="{{ feed.url }}" />
<div class="input-group input-group-sm mb-2"> <div class="input-group input-group-sm mb-2">
@ -115,32 +114,43 @@
</div> </div>
<!-- Update Interval Configuration --> <!-- Update Interval Configuration -->
<div class="mt-4 border-top border-secondary pt-3"> <div class="mt-4 border-top border-secondary pt-3">
<h5 class="mb-3">Update Interval</h5> <h5 class="mb-3">
Update Interval <span class="badge
{% if feed_interval %} {% if feed_interval %}
<p class="text-muted mb-2"> bg-info
Current: <strong>{{ feed_interval }} minutes</strong>
{% if feed_interval >= 60 %}({{ (feed_interval / 60) | round(1) }} hours){% endif %}
<span class="badge bg-info">Custom</span>
</p>
{% else %} {% else %}
<p class="text-muted mb-2"> bg-secondary
Current: <strong>{{ global_interval }} minutes</strong> {% endif %}">
{% if global_interval >= 60 %}({{ (global_interval / 60) | round(1) }} hours){% endif %} {% if feed_interval %}
<span class="badge bg-secondary">Using global default</span> Custom
</p> {% else %}
Using global default
{% endif %} {% endif %}
<form action="/set_update_interval" method="post" class="mb-2"> </span>
</h5>
<div class="d-flex align-items-center gap-2 flex-wrap">
<span class="text-muted">Current: <strong>
{% if feed_interval %}
{{ feed_interval }}
{% if feed_interval >= 60 %}({{ (feed_interval / 60) | round(1) }} hours){% endif %}
{% else %}
{{ global_interval }}
{% if global_interval >= 60 %}({{ (global_interval / 60) | round(1) }} hours){% endif %}
{% endif %}
minutes</strong></span>
<form action="/set_update_interval"
method="post"
class="d-inline-flex gap-2 align-items-center">
<input type="hidden" name="feed_url" value="{{ feed.url }}" /> <input type="hidden" name="feed_url" value="{{ feed.url }}" />
<div class="input-group input-group-sm mb-2">
<input type="number" <input type="number"
class="form-control form-control-sm interval-input" class="form-control form-control-sm interval-input"
style="width: 100px"
name="interval_minutes" name="interval_minutes"
placeholder="Minutes" placeholder="Minutes"
min="1" min="1"
value="{{ feed_interval if feed_interval else global_interval }}" value="{{ feed_interval if feed_interval else global_interval }}"
required /> required />
<button class="btn btn-primary" type="submit">Set Interval</button> <button class="btn btn-primary btn-sm" type="submit">Set Interval</button>
</div>
</form> </form>
{% if feed_interval %} {% if feed_interval %}
<form action="/reset_update_interval" method="post" class="d-inline"> <form action="/reset_update_interval" method="post" class="d-inline">
@ -150,12 +160,13 @@
{% endif %} {% endif %}
</div> </div>
</div> </div>
{# Rendered HTML content #} </div>
<pre>{{ html|safe }}</pre> {# Rendered HTML content #}
{% if is_show_more_entries_button_visible %} <pre>{{ html|safe }}</pre>
{% if is_show_more_entries_button_visible %}
<a class="btn btn-dark mt-3" <a class="btn btn-dark mt-3"
href="/feed?feed_url={{ feed.url|encode_url }}&starting_after={{ last_entry.id|encode_url }}"> href="/feed?feed_url={{ feed.url|encode_url }}&starting_after={{ last_entry.id|encode_url }}">
Show more entries Show more entries
</a> </a>
{% endif %} {% endif %}
{% endblock content %} {% endblock content %}