From 59d9062dedfbc56bd17cc504e63043271c937051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Sat, 18 Jul 2026 06:25:29 +0200 Subject: [PATCH] Made the feed config page less shit --- discord_rss_bot/templates/feed.html | 665 +++++++++++++++------------- 1 file changed, 350 insertions(+), 315 deletions(-) diff --git a/discord_rss_bot/templates/feed.html b/discord_rss_bot/templates/feed.html index dcefd1a..e2d270a 100644 --- a/discord_rss_bot/templates/feed.html +++ b/discord_rss_bot/templates/feed.html @@ -103,7 +103,7 @@ {% elif delivery_mode == "screenshot" %}
  • Screenshot layout: {{ screenshot_layout }}.
  • {% endif %} -
  • Webhook text is truncated to {{ webhook_text_length_limit }} characters.
  • +
  • Webhook text
  • is truncated to {{ webhook_text_length_limit }} characters.
  • Filters: {% if has_blacklist_filters and has_whitelist_filters %} @@ -161,331 +161,366 @@ {% endif %} - {% if not "youtube.com/feeds/videos.xml" in feed.url %} - {% if delivery_mode == "embed" %} -
    - -
    - {% elif delivery_mode == "screenshot" %} -
    - -
    - {% else %} -
    - -
    - {% endif %} - {% endif %} - {% if not "youtube.com/feeds/videos.xml" in feed.url %} -
    -
    -

    Screenshot Delivery

    - - {% if delivery_mode == "screenshot" %} - Active: - {% if screenshot_layout == "mobile" %} - Mobile +
    +
    +
    +
    + Delivery Settings +
    +
    +
    +

    Delivery Mode

    +

    + Choose between:
    + Embed: a Discord embed with title, description, and images.
    + {% if not "youtube.com/feeds/videos.xml" in feed.url %} + Screenshot: full-page screenshot of the entry link.
    + {% endif %} + Text: plain message. +

    +
    + {% if delivery_mode != "embed" %} +
    + +
    + {% else %} + Embed + {% endif %} + {% if not "youtube.com/feeds/videos.xml" in feed.url %} + {% if delivery_mode != "screenshot" %} +
    + +
    + {% else %} + Screenshot + {% endif %} + {% endif %} + {% if delivery_mode != "text" %} +
    + +
    + {% else %} + Text + {% endif %} +
    +
    + {% if delivery_mode == "screenshot" and not "youtube.com/feeds/videos.xml" in feed.url %} +
    +
    +

    Screenshot Layout

    +
    + {% if screenshot_layout == "mobile" %} + Mobile +
    + +
    + {% else %} +
    + +
    + Desktop + {% endif %} +
    +
    + Requires Chromium for Playwright. Run + uv run playwright install chromium once. +
    +
    + {% endif %} + {% if not "youtube.com/feeds/videos.xml" in feed.url %} +
    +
    +
    +

    Image Delivery

    + + {% if media_gallery_image_limit == 0 %} + No images + {% elif media_gallery_image_limit == 1 %} + First image only + {% else %} + Up to {{ media_gallery_image_limit }} images + {% endif %} + +
    +

    + How many images to include per entry. Only applies to embed mode. +

    +
    + + +
    +
    + +
    + 0 + {{ max_media_gallery_items }} +
    +
    + +
    +
    +
    + {% endif %} +
    +
    +
    +

    Text Delivery

    + + Max {{ webhook_text_length_limit }} characters + +
    +

    + Limit message length. Text mode allows values up to 4000 characters. Embeds are capped at 2000 characters. +

    +
    + +
    +
    + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + Feed Configuration +
    +
    +
    +

    Feed URL

    +
    + +
    + + +
    +
    +
    +
    +
    +

    Webhook

    + {% if current_webhook_name %} +

    + Current webhook: + {{ current_webhook_name }} +

    + {% elif current_webhook_url %} +

    This feed references a missing webhook. Choose a webhook below to reattach it.

    {% else %} - Desktop +

    No webhook is attached to this feed yet.

    {% endif %} - {% else %} - Inactive - {% endif %} - + {% if webhooks %} +
    + + + + +
    + {% else %} +

    Add a webhook first to attach this feed.

    + {% endif %} +
    + + Sent webhook tracking: + {{ 'Enabled' if save_sent_webhooks else 'Disabled' }} + +
    + + + +
    + View sent webhooks +
    +
    +
    +
    +

    Update Interval

    +
    + + {% if feed_interval %} + Custom + {% else %} + Using global default + {% endif %} + +
    +

    + Current: + + {% 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 + +

    +
    +
    + + + +
    + {% if feed_interval %} +
    + + +
    + {% endif %} +
    +
    +
    -

    - Screenshot delivery sends a full-page screenshot of the entry link instead of the normal - embed or text message. -

    -
    - {% if delivery_mode != "screenshot" %} -
    - -
    - {% else %} -
    - -
    - {% if screenshot_layout == "mobile" %} -
    - -
    - {% else %} -
    - -
    - {% endif %} - {% endif %} -
    -
    - Screenshot mode requires Chromium to be installed for Playwright. Run - uv run playwright install chromium once on this machine. -
    -
    -
    -
    -

    Image Delivery

    - - {% if media_gallery_image_limit == 0 %} - No images - {% elif media_gallery_image_limit == 1 %} - First image only - {% else %} - Up to {{ media_gallery_image_limit }} images - {% endif %} - -
    -

    - Choose 0 to send no entry images, 1 for the first image only, - or up to {{ max_media_gallery_items }} for a Discord media gallery. - This only affects embed delivery. -

    -
    - - -
    -
    - -
    - 0 - {{ max_media_gallery_items }} +
    +
    +
    +
    +
    +
    + Customization +
    +
    +
    + Whitelist + Blacklist +
    + + Customize message + + {% if not "youtube.com/feeds/videos.xml" in feed.url %} + + Customize embed + + {% endif %}
    - -
    - -
    - {% endif %} -
    -
    -

    Text Delivery

    - - Max {{ webhook_text_length_limit }} characters - -
    -

    - Limit message length. Text mode allows values up to 4000 characters. Embeds are capped at 2000 characters. -

    -
    - -
    -
    - - -
    - -
    -
    -
    -
    -

    Customization

    - - {% if is_steam_feed %} -
    Steam feeds can enable thumbnails in embed settings.
    - {% endif %} -
    -
    -

    Feed URL

    -
    - -
    - - -
    -
    -
    -
    -

    Webhook

    - {% if current_webhook_name %} -

    - Current webhook: - {{ current_webhook_name }} -

    - {% elif current_webhook_url %} -

    This feed references a missing webhook. Choose a webhook below to reattach it.

    - {% else %} -

    No webhook is attached to this feed yet.

    - {% endif %} - {% if webhooks %} -
    - - - - -
    - {% else %} -

    Add a webhook first to attach this feed.

    - {% endif %} -
    - - Sent webhook tracking: - {{ 'Enabled' if save_sent_webhooks else 'Disabled' }} - -
    - - - -
    - View sent webhooks -
    -
    -
    -

    Feed Information

    -
    -
    -
    Added: {{ feed.added | relative_time }}
    -
    -
    -
    Last Updated: {{ feed.last_updated | relative_time }}
    -
    -
    -
    Last Retrieved: {{ feed.last_retrieved | relative_time }}
    -
    -
    -
    Next Update: {{ feed.update_after | relative_time }}
    -
    -
    -
    - Updates: - - {{ 'Enabled' if feed.updates_enabled else 'Disabled' }} - + {% if is_steam_feed %} +
    Steam feeds can enable thumbnails in embed settings.
    + {% endif %}
    -
    -
    -
    -

    Update Interval

    - - {% if feed_interval %} - Custom - {% else %} - Using global default - {% endif %} - +
    +
    +
    + Feed Information +
    +
    +
    +
    +
    Added: {{ feed.added | relative_time }}
    +
    +
    +
    Last Updated: {{ feed.last_updated | relative_time }}
    +
    +
    +
    Last Retrieved: {{ feed.last_retrieved | relative_time }}
    +
    +
    +
    Next Update: {{ feed.update_after | relative_time }}
    +
    +
    +
    + Updates: + + {{ 'Enabled' if feed.updates_enabled else 'Disabled' }} + +
    +
    +
    +
    +
    -

    - Current: - - {% 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 - -

    -
    -
    - - - -
    - {% if feed_interval %} -
    - - -
    - {% endif %} -
    -
    +