More core templates to core template dir
All checks were successful
Deploy to Server / deploy (push) Successful in 12s

This commit is contained in:
Joakim Hellsén 2026-03-17 05:50:01 +01:00
commit 70298fdd1e
Signed by: Joakim Hellsén
SSH key fingerprint: SHA256:/9h/CsExpFp+PRhsfA0xznFx2CGfTT5R/kpuFfUgEQk
6 changed files with 61 additions and 44 deletions

View file

@ -285,7 +285,7 @@ def docs_rss_view(request: HttpRequest) -> HttpResponse:
return render(
request,
"twitch/docs_rss.html",
"core/docs_rss.html",
{
"game": sample_game,
**seo_context,
@ -432,7 +432,7 @@ def debug_view(request: HttpRequest) -> HttpResponse:
)
context.update(seo_context)
return render(request, "twitch/debug.html", context)
return render(request, "core/debug.html", context)
# MARK: /datasets/
@ -543,7 +543,7 @@ def dataset_backups_view(request: HttpRequest) -> HttpResponse:
"dataset_count": len(datasets),
**seo_context,
}
return render(request, "twitch/dataset_backups.html", context)
return render(request, "core/dataset_backups.html", context)
def dataset_backup_download_view(
@ -682,7 +682,7 @@ def search_view(request: HttpRequest) -> HttpResponse:
)
return render(
request,
"twitch/search_results.html",
"core/search_results.html",
{"query": query, "results": results, **seo_context},
)

View file

@ -115,39 +115,41 @@
</tbody>
</table>
</section>
<section>
<h2>Filtered RSS Feeds</h2>
<p>You can subscribe to RSS feeds scoped to a specific game.</p>
<table>
<thead>
<tr>
<th>Game</th>
<th>RSS</th>
<th>Atom</th>
<th>Discord</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ game.display_name }}</td>
<td>
<a href="{% url 'core:game_campaign_feed' game.twitch_id %}">
https://ttvdrops.lovinator.space/rss/games/{{ game.twitch_id }}/
</a>
</td>
<td>
<a href="{% url 'core:game_campaign_feed_atom' game.twitch_id %}">
https://ttvdrops.lovinator.space/atom/games/{{ game.twitch_id }}/
</a>
</td>
<td>
<a href="{% url 'core:game_campaign_feed_discord' game.twitch_id %}">
https://ttvdrops.lovinator.space/discord/games/{{ game.twitch_id }}/
</a>
</td>
</tr>
</tbody>
</table>
</section>
{% if game %}
<section>
<h2>Filtered RSS Feeds</h2>
<p>You can subscribe to RSS feeds scoped to a specific game.</p>
<table>
<thead>
<tr>
<th>Game</th>
<th>RSS</th>
<th>Atom</th>
<th>Discord</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ game.display_name }}</td>
<td>
<a href="{% url 'core:game_campaign_feed' game.twitch_id %}">
https://ttvdrops.lovinator.space/rss/games/{{ game.twitch_id }}/
</a>
</td>
<td>
<a href="{% url 'core:game_campaign_feed_atom' game.twitch_id %}">
https://ttvdrops.lovinator.space/atom/games/{{ game.twitch_id }}/
</a>
</td>
<td>
<a href="{% url 'core:game_campaign_feed_discord' game.twitch_id %}">
https://ttvdrops.lovinator.space/discord/games/{{ game.twitch_id }}/
</a>
</td>
</tr>
</tbody>
</table>
</section>
{% endif %}
</main>
{% endblock content %}

View file

@ -1006,14 +1006,29 @@ class TestChannelListView:
@pytest.mark.django_db
def test_docs_rss_view(self, client: Client) -> None:
"""Test docs RSS view returns 200 and has feeds in context."""
"""Test docs RSS view returns 200."""
response: _MonkeyPatchedWSGIResponse = client.get(reverse("core:docs_rss"))
assert response.status_code == 200
assert "feeds" in response.context
assert "filtered_feeds" in response.context
assert response.context["feeds"][0]["example_xml"]
html: str = response.content.decode()
assert '<code class="language-xml">' in html
# Add Game with running campaign to ensure it's included in the RSS feed
game: Game = Game.objects.create(
twitch_id="g-rss",
name="Game RSS",
display_name="Game RSS",
)
DropCampaign.objects.create(
twitch_id="c-rss",
name="Campaign RSS",
game=game,
start_at=timezone.now() - timedelta(days=1),
end_at=timezone.now() + timedelta(days=1),
operation_names=["DropCampaignDetails"],
)
response = client.get(reverse("core:docs_rss"))
assert response.status_code == 200
assert "g-rss" in response.content.decode("utf-8")
@pytest.mark.django_db