Add RSS feed links in templates

This commit is contained in:
Joakim Hellsén 2026-01-08 00:35:55 +01:00
commit 6a62eaa885
No known key found for this signature in database
13 changed files with 349 additions and 39 deletions

View file

@ -17,6 +17,19 @@
<a href="{% url 'twitch:organization_detail' owner.twitch_id %}">{{ owner.name }}</a>
</p>
{% endif %}
<!-- RSS Feeds -->
<div style="margin-bottom: 1rem;">
{% if campaign.game %}
<a href="{% url 'twitch:game_campaign_feed' campaign.game.twitch_id %}"
style="margin-right: 1rem"
title="RSS feed for {{ campaign.game.display_name }} campaigns">RSS feed for {{ campaign.game.display_name }} campaigns</a>
{% endif %}
{% if owner %}
<a href="{% url 'twitch:organization_campaign_feed' owner.twitch_id %}"
style="margin-right: 1rem"
title="RSS feed for {{ owner.name }} campaigns">RSS feed for {{ owner.name }} campaigns</a>
{% endif %}
</div>
<!-- Campaign image -->
{% if campaign.image_best_url or campaign.image_url %}
<img id="campaign-image"

View file

@ -8,6 +8,12 @@
<header>
<h1 id="page-title">Drop Campaigns</h1>
<p>Browse all available drop campaigns</p>
<!-- RSS Feeds -->
<div style="margin-bottom: 1rem;">
<a href="{% url 'twitch:campaign_feed' %}"
style="margin-right: 1rem"
title="RSS feed for all campaigns">RSS feed for all campaigns</a>
</div>
</header>
<form id="filter-form"
method="get"

View file

@ -10,6 +10,12 @@
Drops are sorted alphabetically by organization and game. Click on a campaign or game title to see more details.
Hover over the end time to see the exact date and time.
</pre>
<!-- RSS Feeds -->
<div style="margin-bottom: 1rem;">
<a href="{% url 'twitch:campaign_feed' %}"
style="margin-right: 1rem"
title="RSS feed for all campaigns">RSS feed for campaigns</a>
</div>
{% if campaigns_by_org_game %}
{% for org_id, org_data in campaigns_by_org_game.items %}
<section id="org-section-{{ org_id }}">

View file

@ -8,7 +8,8 @@
<h1 id="page-title">RSS Feeds Documentation</h1>
<p>This page lists all available RSS feeds for TTVDrops.</p>
<section>
<h2 id="available-feeds-header">Available RSS Feeds</h2>
<h2 id="available-feeds-header">Global RSS Feeds</h2>
<p>These feeds contain all items across the entire site:</p>
<ul id="feeds-list">
{% for feed in feeds %}
<li id="feed-{{ forloop.counter }}">
@ -21,5 +22,40 @@
{% endfor %}
</ul>
</section>
<section style="margin-top: 2rem;">
<h2 id="filtered-feeds-header">Filtered RSS Feeds</h2>
<p>
You can also subscribe to RSS feeds for specific games or organizations. These feeds are available on each game or organization detail page.
</p>
<h3>Game-Specific Campaign Feeds</h3>
<p>
Subscribe to campaigns for a specific game using: <code>/rss/games/&lt;game_id&gt;/campaigns/</code>
</p>
{% if sample_game %}
<p>
Example: <a href="{% url 'twitch:game_campaign_feed' sample_game.twitch_id %}">{{ sample_game.display_name }} Campaigns RSS Feed</a>
</p>
{% endif %}
<h3>Organization-Specific Campaign Feeds</h3>
<p>
Subscribe to campaigns for a specific organization using: <code>/rss/organizations/&lt;org_id&gt;/campaigns/</code>
</p>
{% if sample_org %}
<p>
Example: <a href="{% url 'twitch:organization_campaign_feed' sample_org.twitch_id %}">{{ sample_org.name }} Campaigns RSS Feed</a>
</p>
{% endif %}
</section>
<section style="margin-top: 2rem;">
<h2 id="usage-header">How to Use RSS Feeds</h2>
<p>
RSS feeds allow you to stay updated with new content. You can use any RSS reader application to subscribe to these feeds.
</p>
<ul>
<li>Copy the feed URL</li>
<li>Paste it into your favorite RSS reader (Feedly, Inoreader, NetNewsWire, etc.)</li>
<li>Get automatic updates when new content is added</li>
</ul>
</section>
</main>
{% endblock content %}

View file

@ -8,6 +8,20 @@
{{ game.display_name }}
{% if game.display_name != game.name and game.name %}<small>({{ game.name }})</small>{% endif %}
</h1>
<!-- RSS Feeds -->
<div style="margin-bottom: 1rem;">
<a href="{% url 'twitch:game_campaign_feed' game.twitch_id %}"
style="margin-right: 1rem"
title="RSS feed for {{ game.display_name }} campaigns">RSS feed for {{ game.display_name }} campaigns</a>
{% if owner %}
<a href="{% url 'twitch:organization_campaign_feed' owner.twitch_id %}"
style="margin-right: 1rem"
title="RSS feed for {{ owner.name }} campaigns">RSS feed for {{ owner.name }} campaigns</a>
{% endif %}
<a href="{% url 'twitch:campaign_feed' %}"
style="margin-right: 1rem"
title="RSS feed for all campaigns">RSS feed for all campaigns</a>
</div>
<!-- Game image -->
{% if game.box_art %}
<img id="game-image"

View file

@ -10,6 +10,12 @@
<p>
<a href="{% url 'twitch:game_list_simple' %}">List View</a>
</p>
<!-- RSS Feeds -->
<div style="margin-bottom: 1rem;">
<a href="{% url 'twitch:game_feed' %}"
style="margin-right: 1rem"
title="RSS feed for all games">RSS feed for all games</a>
</div>
</header>
{% if games_by_org %}
<section>

View file

@ -8,6 +8,12 @@
<p>
<a href="{% url 'twitch:game_list' %}">Grid View</a>
</p>
<!-- RSS Feeds -->
<div style="margin-bottom: 1rem;">
<a href="{% url 'twitch:game_feed' %}"
style="margin-right: 1rem"
title="RSS feed for all games">RSS feed for all games</a>
</div>
{% if games_by_org %}
{% for organization, games in games_by_org.items %}
<h2 id="org-{{ organization.twitch_id }}">{{ organization.name }}</h2>

View file

@ -4,6 +4,12 @@
{% endblock title %}
{% block content %}
<h1 id="page-title">Organizations</h1>
<!-- RSS Feeds -->
<div style="margin-bottom: 1rem;">
<a href="{% url 'twitch:organization_feed' %}"
style="margin-right: 1rem"
title="RSS feed for all organizations">RSS feed for organizations</a>
</div>
{% if orgs %}
<ul id="org-list">
{% for organization in orgs %}

View file

@ -4,36 +4,26 @@
{% endblock title %}
{% block content %}
<h1 id="org-name">{{ organization.name }}</h1>
{% if user.is_authenticated %}
<form id="notification-form"
method="post"
action="{% url 'twitch:subscribe_org_notifications' org_id=organization.twitch_id %}">
{% csrf_token %}
<div>
<input type="checkbox"
id="found"
name="notify_found"
{% if subscription and subscription.notify_found %}checked{% endif %} />
<label for="found">🔔 Get notified as soon as a drop for {{ organization.name }} appears on Twitch.</label>
</div>
<div>
<input type="checkbox"
id="live"
name="notify_live"
{% if subscription and subscription.notify_live %}checked{% endif %} />
<label for="live">🎮 Get notified when the drop is live and ready to be farmed.</label>
</div>
<button id="save-preferences-button" type="submit">Save preferences</button>
</form>
{% else %}
<p id="login-prompt">Login to subscribe!</p>
{% endif %}
<ul id="games-list">
{% for game in games %}
<li id="game-{{ game.twitch_id }}">
<a href="{% url 'twitch:game_detail' game.twitch_id %}">{{ game }}</a>
</li>
{% endfor %}
</ul>
<!-- RSS Feeds -->
<div style="margin-bottom: 1rem;">
<a href="{% url 'twitch:organization_campaign_feed' organization.twitch_id %}"
style="margin-right: 1rem"
title="RSS feed for {{ organization.name }} campaigns">RSS feed for {{ organization.name }} campaigns</a>
</div>
<theader>
<h2 id="games-header">Games by {{ organization.name }}</h2>
</theader>
<table id="games-table">
<tbody>
{% for game in games %}
<tr id="game-row-{{ game.twitch_id }}">
<td>
<a href="{% url 'twitch:game_detail' game.twitch_id %}">{{ game }}</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<hr />
{{ org_data|safe }}
{% endblock content %}