Add rewards to more pages as we have support for them now
All checks were successful
Deploy to Server / deploy (push) Successful in 26s
All checks were successful
Deploy to Server / deploy (push) Successful in 26s
This commit is contained in:
parent
3535d7d2dd
commit
37c1390100
16 changed files with 966 additions and 216 deletions
|
|
@ -31,11 +31,10 @@
|
|||
{% endblock extra_head %}
|
||||
{% block content %}
|
||||
<main>
|
||||
<h1>Active Drops Dashboard</h1>
|
||||
<h1>Open Drop Campaigns</h1>
|
||||
<p>
|
||||
A combined overview of currently active Twitch and Kick drops campaigns.
|
||||
<br />
|
||||
Click any campaign to open details.
|
||||
Some Drops campaigns may not be available in your region.
|
||||
<a href="https://help.twitch.tv/s/article/mission-based-drops">Learn more about Drops</a>.
|
||||
</p>
|
||||
<hr />
|
||||
<section id="twitch-campaigns-section">
|
||||
|
|
@ -173,32 +172,39 @@
|
|||
padding-top: 1rem">
|
||||
<header style="margin-bottom: 1rem;">
|
||||
<h2 style="margin: 0 0 0.5rem 0;">
|
||||
<a href="{% url 'twitch:reward_campaign_list' %}">Twitch Reward Campaigns (Quest Rewards)</a>
|
||||
<a href="{% url 'twitch:reward_campaign_list' %}">Open Reward Campaigns</a>
|
||||
</h2>
|
||||
<p>
|
||||
Rewards are limited-time offers from top brands that you can unlock by
|
||||
supporting your favorite Twitch creators. Visit <a href="https://www.twitch.tv/drops/inventory">your inventory</a>
|
||||
to access unlocked rewards.
|
||||
</p>
|
||||
</header>
|
||||
<div style="display: grid;
|
||||
gap: 1rem;
|
||||
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr))">
|
||||
<ul>
|
||||
{% for campaign in active_reward_campaigns %}
|
||||
<article id="reward-campaign-{{ campaign.twitch_id }}"
|
||||
style="border: 1px solid #ddd;
|
||||
border-radius: 8px;
|
||||
padding: 1rem">
|
||||
<h3 style="margin: 0 0 0.5rem 0;">
|
||||
<a href="{% url 'twitch:reward_campaign_detail' campaign.twitch_id %}">
|
||||
{% if campaign.brand %}
|
||||
{{ campaign.brand }}: {{ campaign.name }}
|
||||
{% else %}
|
||||
{{ campaign.name }}
|
||||
{% endif %}
|
||||
</a>
|
||||
</h3>
|
||||
{% if campaign.summary %}
|
||||
<p style="font-size: 0.9rem; color: #555; margin: 0.5rem 0;">{{ campaign.summary }}</p>
|
||||
{% endif %}
|
||||
<div style="font-size: 0.85rem; color: #666;">
|
||||
<li id="reward-campaign-{{ campaign.twitch_id }}"
|
||||
style="display: flex;
|
||||
gap: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
align-items: flex-start">
|
||||
<a href="{% url 'twitch:reward_campaign_detail' campaign.twitch_id %}"
|
||||
style="flex-shrink: 0;
|
||||
display: block;
|
||||
line-height: 0">
|
||||
{% picture campaign.image_best_url alt="Image for "|add:campaign.name width=120 %}
|
||||
</a>
|
||||
<div>
|
||||
<h3 style="margin: 0;">
|
||||
<a href="{% url 'twitch:reward_campaign_detail' campaign.twitch_id %}">
|
||||
{% if campaign.brand %}
|
||||
{{ campaign.brand }}: {{ campaign.name }}
|
||||
{% else %}
|
||||
{{ campaign.name }}
|
||||
{% endif %}
|
||||
</a>
|
||||
</h3>
|
||||
{% if campaign.ends_at %}
|
||||
<p style="margin: 0.25rem 0;">
|
||||
<p>
|
||||
<strong>Ends:</strong>
|
||||
<time datetime="{{ campaign.ends_at|date:'c' }}"
|
||||
title="{{ campaign.ends_at|date:'DATETIME_FORMAT' }}">
|
||||
|
|
@ -206,20 +212,25 @@
|
|||
</time>
|
||||
</p>
|
||||
{% endif %}
|
||||
{% if campaign.summary %}
|
||||
<p>{{ campaign.summary }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div>
|
||||
{% if campaign.game %}
|
||||
<p style="margin: 0.25rem 0;">
|
||||
<p>
|
||||
<strong>Game:</strong>
|
||||
<a href="{% url 'twitch:game_detail' campaign.game.twitch_id %}">{{ campaign.game.display_name }}</a>
|
||||
</p>
|
||||
{% elif campaign.is_sitewide %}
|
||||
<p style="margin: 0.25rem 0;">
|
||||
<p>
|
||||
<strong>Type:</strong> Site-wide reward campaign
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</article>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</ul>
|
||||
</section>
|
||||
{% endif %}
|
||||
<section id="kick-campaigns-section"
|
||||
|
|
|
|||
|
|
@ -14,6 +14,14 @@
|
|||
upstream content and cannot guarantee upstream accuracy or permanence.
|
||||
</p>
|
||||
<p>Note that some drops has missing or incomplete data due to Twitch API limitations.</p>
|
||||
<p>
|
||||
Reward campaign data is sourced from
|
||||
<a href="https://github.com/SunkwiBOT/twitch-drops-api">SunkwiBOT/twitch-drops-api</a>.
|
||||
Raw JSON exports are available in the repository:
|
||||
<a href="https://github.com/SunkwiBOT/twitch-drops-api/blob/main/drops.json">drops.json</a>
|
||||
and
|
||||
<a href="https://github.com/SunkwiBOT/twitch-drops-api/blob/main/rewards.json">rewards.json</a>.
|
||||
</p>
|
||||
<p>
|
||||
Need a special format for your workflow or research pipeline?
|
||||
<a href="https://github.com/TheLovinator1/ttvdrops/issues">Contact me via GitHub issues</a>
|
||||
|
|
|
|||
|
|
@ -127,11 +127,15 @@
|
|||
{% if game %}
|
||||
<section>
|
||||
<h2>Filtered RSS Feeds</h2>
|
||||
<p>You can subscribe to RSS feeds scoped to a specific game.</p>
|
||||
<p>
|
||||
You can subscribe to RSS feeds scoped to a specific game.
|
||||
The Rewards feed will be empty if the game has no active reward campaigns.
|
||||
</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Game</th>
|
||||
<th>Feed Type</th>
|
||||
<th>RSS</th>
|
||||
<th>Atom</th>
|
||||
<th>Discord</th>
|
||||
|
|
@ -139,20 +143,39 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{ game.display_name }}</td>
|
||||
<td rowspan="2">{{ game.display_name }}</td>
|
||||
<td>Campaigns</td>
|
||||
<td>
|
||||
<a href="{% url 'core:game_campaign_feed' game.twitch_id %}">
|
||||
https://ttvdrops.lovinator.space/rss/games/{{ game.twitch_id }}/
|
||||
https://ttvdrops.lovinator.space/rss/games/{{ game.twitch_id }}/campaigns/
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{% url 'core:game_campaign_feed_atom' game.twitch_id %}">
|
||||
https://ttvdrops.lovinator.space/atom/games/{{ game.twitch_id }}/
|
||||
https://ttvdrops.lovinator.space/atom/games/{{ game.twitch_id }}/campaigns/
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{% url 'core:game_campaign_feed_discord' game.twitch_id %}">
|
||||
https://ttvdrops.lovinator.space/discord/games/{{ game.twitch_id }}/
|
||||
https://ttvdrops.lovinator.space/discord/games/{{ game.twitch_id }}/campaigns/
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Rewards</td>
|
||||
<td>
|
||||
<a href="{% url 'core:game_reward_feed' game.twitch_id %}">
|
||||
https://ttvdrops.lovinator.space/rss/games/{{ game.twitch_id }}/rewards/
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{% url 'core:game_reward_feed_atom' game.twitch_id %}">
|
||||
https://ttvdrops.lovinator.space/atom/games/{{ game.twitch_id }}/rewards/
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{% url 'core:game_reward_feed_discord' game.twitch_id %}">
|
||||
https://ttvdrops.lovinator.space/discord/games/{{ game.twitch_id }}/rewards/
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue