More core templates to core template dir
All checks were successful
Deploy to Server / deploy (push) Successful in 12s
All checks were successful
Deploy to Server / deploy (push) Successful in 12s
This commit is contained in:
parent
768e6f2111
commit
70298fdd1e
6 changed files with 61 additions and 44 deletions
|
|
@ -285,7 +285,7 @@ def docs_rss_view(request: HttpRequest) -> HttpResponse:
|
||||||
|
|
||||||
return render(
|
return render(
|
||||||
request,
|
request,
|
||||||
"twitch/docs_rss.html",
|
"core/docs_rss.html",
|
||||||
{
|
{
|
||||||
"game": sample_game,
|
"game": sample_game,
|
||||||
**seo_context,
|
**seo_context,
|
||||||
|
|
@ -432,7 +432,7 @@ def debug_view(request: HttpRequest) -> HttpResponse:
|
||||||
)
|
)
|
||||||
context.update(seo_context)
|
context.update(seo_context)
|
||||||
|
|
||||||
return render(request, "twitch/debug.html", context)
|
return render(request, "core/debug.html", context)
|
||||||
|
|
||||||
|
|
||||||
# MARK: /datasets/
|
# MARK: /datasets/
|
||||||
|
|
@ -543,7 +543,7 @@ def dataset_backups_view(request: HttpRequest) -> HttpResponse:
|
||||||
"dataset_count": len(datasets),
|
"dataset_count": len(datasets),
|
||||||
**seo_context,
|
**seo_context,
|
||||||
}
|
}
|
||||||
return render(request, "twitch/dataset_backups.html", context)
|
return render(request, "core/dataset_backups.html", context)
|
||||||
|
|
||||||
|
|
||||||
def dataset_backup_download_view(
|
def dataset_backup_download_view(
|
||||||
|
|
@ -682,7 +682,7 @@ def search_view(request: HttpRequest) -> HttpResponse:
|
||||||
)
|
)
|
||||||
return render(
|
return render(
|
||||||
request,
|
request,
|
||||||
"twitch/search_results.html",
|
"core/search_results.html",
|
||||||
{"query": query, "results": results, **seo_context},
|
{"query": query, "results": results, **seo_context},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -115,39 +115,41 @@
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</section>
|
</section>
|
||||||
<section>
|
{% if game %}
|
||||||
<h2>Filtered RSS Feeds</h2>
|
<section>
|
||||||
<p>You can subscribe to RSS feeds scoped to a specific game.</p>
|
<h2>Filtered RSS Feeds</h2>
|
||||||
<table>
|
<p>You can subscribe to RSS feeds scoped to a specific game.</p>
|
||||||
<thead>
|
<table>
|
||||||
<tr>
|
<thead>
|
||||||
<th>Game</th>
|
<tr>
|
||||||
<th>RSS</th>
|
<th>Game</th>
|
||||||
<th>Atom</th>
|
<th>RSS</th>
|
||||||
<th>Discord</th>
|
<th>Atom</th>
|
||||||
</tr>
|
<th>Discord</th>
|
||||||
</thead>
|
</tr>
|
||||||
<tbody>
|
</thead>
|
||||||
<tr>
|
<tbody>
|
||||||
<td>{{ game.display_name }}</td>
|
<tr>
|
||||||
<td>
|
<td>{{ game.display_name }}</td>
|
||||||
<a href="{% url 'core:game_campaign_feed' game.twitch_id %}">
|
<td>
|
||||||
https://ttvdrops.lovinator.space/rss/games/{{ game.twitch_id }}/
|
<a href="{% url 'core:game_campaign_feed' game.twitch_id %}">
|
||||||
</a>
|
https://ttvdrops.lovinator.space/rss/games/{{ game.twitch_id }}/
|
||||||
</td>
|
</a>
|
||||||
<td>
|
</td>
|
||||||
<a href="{% url 'core:game_campaign_feed_atom' game.twitch_id %}">
|
<td>
|
||||||
https://ttvdrops.lovinator.space/atom/games/{{ game.twitch_id }}/
|
<a href="{% url 'core:game_campaign_feed_atom' game.twitch_id %}">
|
||||||
</a>
|
https://ttvdrops.lovinator.space/atom/games/{{ game.twitch_id }}/
|
||||||
</td>
|
</a>
|
||||||
<td>
|
</td>
|
||||||
<a href="{% url 'core:game_campaign_feed_discord' game.twitch_id %}">
|
<td>
|
||||||
https://ttvdrops.lovinator.space/discord/games/{{ game.twitch_id }}/
|
<a href="{% url 'core:game_campaign_feed_discord' game.twitch_id %}">
|
||||||
</a>
|
https://ttvdrops.lovinator.space/discord/games/{{ game.twitch_id }}/
|
||||||
</td>
|
</a>
|
||||||
</tr>
|
</td>
|
||||||
</tbody>
|
</tr>
|
||||||
</table>
|
</tbody>
|
||||||
</section>
|
</table>
|
||||||
|
</section>
|
||||||
|
{% endif %}
|
||||||
</main>
|
</main>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|
@ -1006,14 +1006,29 @@ class TestChannelListView:
|
||||||
|
|
||||||
@pytest.mark.django_db
|
@pytest.mark.django_db
|
||||||
def test_docs_rss_view(self, client: Client) -> None:
|
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"))
|
response: _MonkeyPatchedWSGIResponse = client.get(reverse("core:docs_rss"))
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
assert "feeds" in response.context
|
|
||||||
assert "filtered_feeds" in response.context
|
# Add Game with running campaign to ensure it's included in the RSS feed
|
||||||
assert response.context["feeds"][0]["example_xml"]
|
game: Game = Game.objects.create(
|
||||||
html: str = response.content.decode()
|
twitch_id="g-rss",
|
||||||
assert '<code class="language-xml">' in html
|
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
|
@pytest.mark.django_db
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue