diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 3ed0af7..16a9a4f 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -31,14 +31,14 @@ repos:
# Run Pyupgrade on all Python files. This will upgrade the code to Python 3.12.
- repo: https://github.com/asottile/pyupgrade
- rev: v3.21.0
+ rev: v3.21.2
hooks:
- id: pyupgrade
args: ["--py312-plus"]
# An extremely fast Python linter and formatter.
- repo: https://github.com/astral-sh/ruff-pre-commit
- rev: v0.14.0
+ rev: v0.15.5
hooks:
- id: ruff-format
- id: ruff
@@ -46,6 +46,6 @@ repos:
# Static checker for GitHub Actions workflow files.
- repo: https://github.com/rhysd/actionlint
- rev: v1.7.8
+ rev: v1.7.11
hooks:
- id: actionlint
diff --git a/discord_rss_bot/main.py b/discord_rss_bot/main.py
index e4e8975..7c5e7ac 100644
--- a/discord_rss_bot/main.py
+++ b/discord_rss_bot/main.py
@@ -948,7 +948,7 @@ async def get_feed(feed_url: str, request: Request, starting_after: str = ""):
return templates.TemplateResponse(request=request, name="feed.html", context=context)
-def create_html_for_feed(entries: Iterable[Entry], current_feed_url: str = "") -> str: # noqa: PLR0914
+def create_html_for_feed(entries: Iterable[Entry], current_feed_url: str = "") -> str: # noqa: C901, PLR0914
"""Create HTML for the search results.
Args:
@@ -988,6 +988,16 @@ def create_html_for_feed(entries: Iterable[Entry], current_feed_url: str = "") -
if current_feed_url and source_feed_url != current_feed_url:
from_another_feed = f"From another feed: {source_feed_url}"
+ # Add feed link when viewing from webhook_entries or aggregated views
+ feed_link: str = ""
+ if not current_feed_url or source_feed_url != current_feed_url:
+ encoded_feed_url: str = urllib.parse.quote(source_feed_url)
+ feed_title: str = entry.feed.title if hasattr(entry.feed, "title") and entry.feed.title else source_feed_url
+ feed_link = (
+ f"{feed_title}
"
+ )
+
entry_id: str = urllib.parse.quote(entry.id)
to_discord_html: str = f"Send to Discord"
@@ -1015,7 +1025,7 @@ def create_html_for_feed(entries: Iterable[Entry], current_feed_url: str = "") -
html += f"""
Change the URL for this feed. This can be useful if a feed has moved.
{{ html|safe }}
+{% if is_show_more_entries_button_visible %}
+
+ Show more entries
+
+{% endif %}
{% endblock content %}
diff --git a/discord_rss_bot/templates/index.html b/discord_rss_bot/templates/index.html
index f9dfc0d..06b8578 100644
--- a/discord_rss_bot/templates/index.html
+++ b/discord_rss_bot/templates/index.html
@@ -1,154 +1,155 @@
{% extends "base.html" %}
{% block content %}
-
-- {{ feed_count.total }} feed{{'s' if feed_count.total > 1 else "" }} - - - {% if feed_count.broken %} - - {{ feed_count.broken }} broken + +
+ {{ feed_count.total }} feed{{'s' if feed_count.total > 1 else "" }} + + + {% if feed_count.broken %} + - {{ feed_count.broken }} broken + {% else %} + - {{ feed_count.broken }} broken + {% endif %} + + + {% if feed_count.total != feed_count.updates_enabled %} + - {{ feed_count.updates_enabled }} enabled + {% else %} + - {{ feed_count.updates_enabled }} enabled + {% endif %} + + - {{ entry_count.total }} entries + + ({{ entry_count.averages[0]|round(1) }}, + {{ entry_count.averages[1]|round(1) }}, + {{ entry_count.averages[2]|round(1) }}) + +
+ + {% for hook_from_context in webhooks %} +No feeds associated with this webhook.
+ {% endif %} +
+ Hello there!
+
+
+ You need to add a webhook here to get started. After that, you can
+ add feeds here. You can find both of these links in the navigation bar
+ above.
+
+
+ If you have any questions or suggestions, feel free to contact me on tlovinator@gmail.com or TheLovinator#9276 on Discord.
+
+
+ Thanks!
+
No feeds associated with this webhook.
{% endif %} -
- Hello there!
-
-
- You need to add a webhook here to get started. After that, you can
- add feeds here. You can find both of these links in the navigation bar
- above.
-
-
- If you have any questions or suggestions, feel free to contact me on tlovinator@gmail.com or TheLovinator#9276 on Discord.
-
-
- Thanks!
-
+ {{ webhook_url }}
+
{{ html|safe }}
+ {% if is_show_more_entries_button_visible and last_entry %}
+
+ Show more entries
+
+ {% endif %}
+ {% elif feeds_count == 0 %}
+ + No feeds found for {{ webhook_name }}. Add feeds to this webhook to see entries here. +
++ No entries found for {{ webhook_name }}. Update feeds to fetch new entries. +
+?thread_id=THREAD_ID to the URL to send messages to a thread.
+ ?thread_id=THREAD_ID to the URL to send messages to a thread.
-