The comeback

This commit is contained in:
2024-12-09 06:18:57 +01:00
parent dc19efc536
commit eb283451a8
37 changed files with 813 additions and 2402 deletions

View File

@ -1,21 +1,22 @@
{% load static %}
<!DOCTYPE html>
<html lang="en" data-bs-theme="dark">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="Twitch drops">
<meta name="author" content="TheLovinator">
<meta name="keywords" content="Twitch, drops">
<meta name="robots" content="index, follow">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="Twitch drops" />
<meta name="author" content="TheLovinator" />
<meta name="keywords" content="Twitch, drops" />
<meta name="robots" content="index, follow" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Twitch drops</title>
<link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}">
<link rel="stylesheet" href="{% static 'css/style.css' %}">
<link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}" />
<link rel="stylesheet" href="{% static 'css/style.css' %}" />
</head>
<body data-bs-spy="scroll" data-bs-target=".toc" data-bs-offset="-200" tabindex="0">
<body data-bs-spy="scroll"
data-bs-target=".toc"
data-bs-offset="-200"
tabindex="0">
{% include "partials/alerts.html" %}
<article class="container mt-5">
{% include "partials/header.html" %}
@ -24,5 +25,4 @@
</article>
<script src="{% static 'js/bootstrap.min.js' %}"></script>
</body>
</html>

View File

@ -1,106 +1,141 @@
{% extends "base.html" %}
{% block content %}
<div class="container">
<h2>{{ game.name }}</h2>
<img src="{{ game.box_art_url }}" alt="{{ game.name }} box art" height="283" width="212">
<h3>Game Details</h3>
<table class="table table-hover table-sm table-striped" cellspacing="0">
<tr>
<td><strong>Twitch ID:</strong></td>
<td>{{ game.pk }}</td>
</tr>
<tr>
<td><strong>Game URL:</strong></td>
<td><a href="{{ game.game_url }}" target="_blank">{{ game.game_url }}</a></td>
</tr>
<tr>
<td><strong>Game name:</strong></td>
<td>{{ game.name }}</td>
</tr>
<tr>
<td><strong>Game box art URL:</strong></td>
<td><a href="{{ game.box_art_url }}" target="_blank">{{ game.box_art_url }}</a></td>
</tr>
</table>
<h3>Organization</h3>
<table class="table table-hover table-sm table-striped" cellspacing="0">
<tr>
{% if game.org %}
<td><a href="#">{{ game.org.name }} -
<span class="text-muted">{{ game.org.pk }}</span></a></td>
{% else %}
<td>No organization associated with this game.</td>
{% endif %}
</tr>
</table>
<h3>Drop Campaigns</h3>
{% if game.drop_campaigns.all %}
{% for drop_campaign in game.drop_campaigns.all %}
<br>
<h2>{{ drop_campaign.name }}</h2>
<table class="table table-hover table-sm table-striped" cellspacing="0">
<tr>
<td><strong>Campaign Name:</strong></td>
<td>{{ drop_campaign.name }}</td>
</tr>
<tr>
<td><img src="{{ drop_campaign.image_url }}" alt="{{ drop_campaign.name }} image"></td>
<td>
<p><strong>Created at:</strong>
{{ drop_campaign.created_at }}
</p>
<p><strong>Modified at:</strong>
{{ drop_campaign.modified_at }}
</p>
<p><strong>Status:</strong>
{{ drop_campaign.status }}
</p>
<p><strong>Description:</strong>
{{ drop_campaign.description }}
</p>
<p><strong>Starts at:</strong>
{{ drop_campaign.starts_at }}
</p>
<p><strong>Ends at:</strong>
{{ drop_campaign.ends_at }}
</p>
<p><strong>More details:</strong>
<a href="{{ drop_campaign.details_url }}" target="_blank">{{ drop_campaign.details_url }}</a>
</p>
<p><strong>Account Link:</strong>
<a href="{{ drop_campaign.account_link_url }}"
target="_blank">{{ drop_campaign.account_link_url }}</a>
</p>
</td>
</tr>
</table>
{% if drop_campaign.drops.all %}
<table class="table table-hover table-sm table-striped" cellspacing="0">
<tr>
<th>ID</th>
<th>Item Name</th>
<th>Minutes</th>
<th>Image</th>
<th>Benefit Name</th>
</tr>
{% for item in drop_campaign.drops.all %}
<tr>
<td>{{ item.pk }}</td>
<td>{{ item.name }}</td>
<td>{{ item.required_minutes_watched }}</td>
{% for benefit in item.benefits.all %}
<td><img src="{{ benefit.image_url }}" alt="{{ benefit.name }} reward image" height="50" width="50"></td>
<td>{{ benefit.name }}</td>
<div class="container">
<h2>{{ game.name }}</h2>
<img src="{{ game.box_art_url }}"
alt="{{ game.name }} box art"
height="283"
width="212" />
<h3>Game Details</h3>
<table class="table table-hover table-sm table-striped" cellspacing="0">
<tr>
<td>
<strong>Twitch ID:</strong>
</td>
<td>{{ game.pk }}</td>
</tr>
<tr>
<td>
<strong>Game URL:</strong>
</td>
<td>
<a href="{{ game.game_url }}" target="_blank">{{ game.game_url }}</a>
</td>
</tr>
<tr>
<td>
<strong>Game name:</strong>
</td>
<td>{{ game.name }}</td>
</tr>
<tr>
<td>
<strong>Game box art URL:</strong>
</td>
<td>
<a href="{{ game.box_art_url }}" target="_blank">{{ game.box_art_url }}</a>
</td>
</tr>
</table>
<h3>Organization</h3>
<table class="table table-hover table-sm table-striped" cellspacing="0">
<tr>
{% if game.org %}
<td>
<a href="#">{{ game.org.name }} -
<span class="text-muted">{{ game.org.pk }}</span></a>
</td>
{% else %}
<td>No organization associated with this game.</td>
{% endif %}
</tr>
</table>
<h3>Drop Campaigns</h3>
{% if game.drop_campaigns.all %}
{% for drop_campaign in game.drop_campaigns.all %}
<br />
<h2>{{ drop_campaign.name }}</h2>
<table class="table table-hover table-sm table-striped" cellspacing="0">
<tr>
<td>
<strong>Campaign Name:</strong>
</td>
<td>{{ drop_campaign.name }}</td>
</tr>
<tr>
<td>
<img src="{{ drop_campaign.image_url }}"
alt="{{ drop_campaign.name }} image" />
</td>
<td>
<p>
<strong>Created at:</strong>
{{ drop_campaign.created_at }}
</p>
<p>
<strong>Modified at:</strong>
{{ drop_campaign.modified_at }}
</p>
<p>
<strong>Status:</strong>
{{ drop_campaign.status }}
</p>
<p>
<strong>Description:</strong>
{{ drop_campaign.description }}
</p>
<p>
<strong>Starts at:</strong>
{{ drop_campaign.starts_at }}
</p>
<p>
<strong>Ends at:</strong>
{{ drop_campaign.ends_at }}
</p>
<p>
<strong>More details:</strong>
<a href="{{ drop_campaign.details_url }}" target="_blank">{{ drop_campaign.details_url }}</a>
</p>
<p>
<strong>Account Link:</strong>
<a href="{{ drop_campaign.account_link_url }}" target="_blank">{{ drop_campaign.account_link_url }}</a>
</p>
</td>
</tr>
</table>
{% if drop_campaign.drops.all %}
<table class="table table-hover table-sm table-striped" cellspacing="0">
<tr>
<th>ID</th>
<th>Item Name</th>
<th>Minutes</th>
<th>Image</th>
<th>Benefit Name</th>
</tr>
{% for item in drop_campaign.drops.all %}
<tr>
<td>{{ item.pk }}</td>
<td>{{ item.name }}</td>
<td>{{ item.required_minutes_watched }}</td>
{% for benefit in item.benefits.all %}
<td>
<img src="{{ benefit.image_url }}"
alt="{{ benefit.name }} reward image"
height="50"
width="50" />
</td>
<td>{{ benefit.name }}</td>
{% endfor %}
</tr>
{% endfor %}
</table>
{% else %}
<p>No items associated with this drop campaign.</p>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
</table>
{% else %}
<p>No items associated with this drop campaign.</p>
{% endif %}
{% endfor %}
{% else %}
<p>No drop campaigns associated with this game.</p>
{% endif %}
</div>
{% else %}
<p>No drop campaigns associated with this game.</p>
{% endif %}
</div>
{% endblock content %}

View File

@ -1,34 +1,37 @@
{% extends "base.html" %}
{% block content %}
<div class="container mt-4">
{% for game in games %}
<div class="card mb-4 shadow-sm">
<div class="row g-0">
<div class="col-md-2">
<img src="{{ game.box_art_url }}" alt="{{ game.name }} box art" class="img-fluid rounded-start"
height="283" width="212" loading="lazy">
</div>
<div class="col-md-10">
<div class="card-body">
<h2 class="card-title h5">
<a href="https://www.twitch.tv/directory/category/{{ game.slug }}"
class="text-decoration-none">{{ game.name }}</a>
</h2>
<div>
<a href="{% url 'game' game.pk %}" class="text-decoration-none">See previous drops</a>
<div class="container mt-4">
{% for game in games %}
<div class="card mb-4 shadow-sm">
<div class="row g-0">
<div class="col-md-2">
<img src="{{ game.box_art_url }}"
alt="{{ game.name }} box art"
class="img-fluid rounded-start"
height="283"
width="212"
loading="lazy" />
</div>
<div>
<a href="" class="text-decoration-none">Subscribe to new drops</a>
<div class="col-md-10">
<div class="card-body">
<h2 class="card-title h5">
<a href="https://www.twitch.tv/directory/category/{{ game.slug }}"
class="text-decoration-none">{{ game.name }}</a>
</h2>
<div>
<a href="{% url 'game' game.pk %}" class="text-decoration-none">See previous drops</a>
</div>
<div>
<a href="" class="text-decoration-none">Subscribe to new drops</a>
</div>
<div>
<a href="" class="text-decoration-none">Subscribe to active drops</a>
</div>
</div>
</div>
<div>
<a href="" class="text-decoration-none">Subscribe to active drops</a>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
{% endfor %}
</div>
{% endblock content %}

View File

@ -1,176 +1,176 @@
{% extends "base.html" %}
{% load static %}
{% load custom_filters %}
{% load time_filters %}
{% load custom_filters static time_filters %}
{% block content %}
<div class="container mt-4">
{% include "partials/info_box.html" %}
{% include "partials/news.html" %}
<!-- Reward Campaigns Section -->
<section class="reward-campaigns">
<h2>
Reward Campaigns -
<span class="d-inline text-muted">
{{ reward_campaigns.count }} campaign{{ reward_campaigns.count|pluralize }}
</span>
</h2>
<!-- Loop through reward campaigns -->
{% for campaign in reward_campaigns %}
<div class="card mb-4 shadow-sm" id="campaign-{{ campaign.twitch_id }}">
<div class="row g-0">
<!-- Campaign Image -->
<div class="col-md-2">
<img src="{{ campaign.image_url }}" alt="{{ campaign.name }}" class="img-fluid rounded-start"
height="283" width="212" loading="lazy">
</div>
<!-- Campaign Details -->
<div class="col-md-10">
<div class="card-body">
<h2 class="card-title h5">
<a href="#campaign-{{ campaign.twitch_id }}" class="plain-text-item">
{{ campaign.name }}
</a>
</h2>
<p class="card-text text-muted">{{ campaign.summary }}</p>
<p class="mb-2 text-muted">
Ends in:
<abbr
title="{{ campaign.starts_at|date:'l d F H:i %Z' }} - {{ campaign.ends_at|date:'l d F H:i %Z' }}">
{{ campaign.ends_at|timesince }}
</abbr>
</p>
<a href="{{ campaign.external_url }}" class="btn btn-primary" target="_blank">Learn More</a>
<!-- Instructions (if any) -->
{% if campaign.instructions %}
<div class="mt-3">
<h3 class="h6">Instructions</h3>
<p>{{ campaign.instructions|safe }}</p>
<div class="container mt-4">
{% include "partials/info_box.html" %}
{% include "partials/news.html" %}
<!-- Reward Campaigns Section -->
<section class="reward-campaigns">
<h2>
Reward Campaigns -
<span class="d-inline text-muted">{{ reward_campaigns.count }} campaign{{ reward_campaigns.count|pluralize }}</span>
</h2>
<!-- Loop through reward campaigns -->
{% for campaign in reward_campaigns %}
<div class="card mb-4 shadow-sm" id="campaign-{{ campaign.twitch_id }}">
<div class="row g-0">
<!-- Campaign Image -->
<div class="col-md-2">
<img src="{{ campaign.image_url }}"
alt="{{ campaign.name }}"
class="img-fluid rounded-start"
height="283"
width="212"
loading="lazy" />
</div>
{% endif %}
<!-- Rewards (if any) -->
{% if campaign.rewards.all %}
<div class="mt-3">
<h3 class="h6">Rewards</h3>
<div class="row row-cols-1 row-cols-md-2 row-cols-lg-3 g-2">
{% for reward in campaign.rewards.all %}
<div class="col d-flex align-items-center position-relative">
<img src="{{ reward.thumbnail_image_url }}" alt="{{ reward.name }} reward image"
class="img-fluid rounded me-3" height="50" width="50" loading="lazy">
<div><strong>{{ reward.name }}</strong></div>
</div>
<!-- Campaign Details -->
<div class="col-md-10">
<div class="card-body">
<h2 class="card-title h5">
<a href="#campaign-{{ campaign.twitch_id }}" class="plain-text-item">{{ campaign.name }}</a>
</h2>
<p class="card-text text-muted">{{ campaign.summary }}</p>
<p class="mb-2 text-muted">
Ends in:
<abbr title="{{ campaign.starts_at|date:'l d F H:i %Z' }} - {{ campaign.ends_at|date:'l d F H:i %Z' }}">
{{ campaign.ends_at|timesince }}
</abbr>
</p>
<a href="{{ campaign.external_url }}"
class="btn btn-primary"
target="_blank">Learn More</a>
<!-- Instructions (if any) -->
{% if campaign.instructions %}
<div class="mt-3">
<h3 class="h6">Instructions</h3>
<p>{{ campaign.instructions|safe }}</p>
</div>
{% endif %}
<!-- Rewards (if any) -->
{% if campaign.rewards.all %}
<div class="mt-3">
<h3 class="h6">Rewards</h3>
<div class="row row-cols-1 row-cols-md-2 row-cols-lg-3 g-2">
{% for reward in campaign.rewards.all %}
<div class="col d-flex align-items-center position-relative">
<img src="{{ reward.thumbnail_image_url }}"
alt="{{ reward.name }} reward image"
class="img-fluid rounded me-3"
height="50"
width="50"
loading="lazy" />
<div>
<strong>{{ reward.name }}</strong>
</div>
</div>
{% endfor %}
</div>
</div>
{% endif %}
</div>
</div>
</div>
</div>
{% endfor %}
</section>
<!-- Drop Campaigns Section -->
<section class="drop-campaigns">
<h2>
Drop Campaigns -
<span class="d-inline text-muted">{{ games.count }} game{{ games.count|pluralize }}</span>
</h2>
<!-- Loop through games -->
{% for game in games %}
<div class="card mb-4 shadow-sm">
<div class="row g-0">
<!-- Game Box Art -->
<div class="col-md-2">
<img src="{{ game.box_art_url|default:'https://static-cdn.jtvnw.net/ttv-static/404_boxart.jpg' }}"
alt="{{ game.name|default:'Game name unknown' }} box art"
class="img-fluid rounded-start"
height="283"
width="212"
loading="lazy" />
</div>
<!-- Game Details -->
<div class="col-md-10">
<div class="card-body">
<h2 class="card-title h5">
<a href="{% url 'game' game.twitch_id %}" class="text-decoration-none">{{ game.name|default:'Unknown' }}</a>
-
<a href="https://www.twitch.tv/directory/category/{{ game.slug|default:'game-name-unknown' }}"
class="text-decoration-none text-muted">Twitch</a>
</h2>
<!-- Loop through campaigns for each game -->
{% for campaign in game.drop_campaigns.all %}
<div class="mt-4">
<h4 class="h6">{{ campaign.name }}</h4>
<a href="{{ campaign.details_url }}" class="text-decoration-none">Details</a>
{% if campaign.details_url != campaign.account_link_url %}
| <a href="{{ campaign.account_link_url }}" class="text-decoration-none">Link Account</a>
{% endif %}
<p class="mb-2 text-muted">
Ends in:
<abbr title="{{ campaign.starts_at|date:'l d F H:i' }} - {{ campaign.ends_at|date:'l d F H:i' }}">
{{ campaign.ends_at|timeuntil }}
</abbr>
</p>
<!-- Drop Benefits Table -->
<div class="table-responsive">
<table class="table table-striped table-hover align-middle">
<thead>
<tr>
<th>Benefit Image</th>
<th>Benefit Name</th>
<th>Required Minutes Watched</th>
</tr>
</thead>
<tbody>
{% for drop in campaign.drops.all %}
{% if drop.benefits.exists %}
{% for benefit in drop.benefits.all %}
<tr>
<td>
<img src="{{ benefit.image_url|default:'https://static-cdn.jtvnw.net/ttv-static/404_boxart.jpg' }}"
alt="{{ benefit.name|default:'Unknown' }}"
class="img-fluid rounded"
height="50"
width="50"
loading="lazy" />
</td>
<td>
<abbr title="{{ drop.name|default:'Unknown' }}">
{{ benefit.name|default:'Unknown' }}
</abbr>
</td>
<td>{{ drop.required_minutes_watched|minutes_to_hours }}</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td>
<img src="https://static-cdn.jtvnw.net/ttv-static/404_boxart.jpg"
alt="{{ drop.name|default:'Unknown' }}"
class="img-fluid rounded"
height="50"
width="50"
loading="lazy" />
</td>
<td>{{ drop.name|default:'Unknown' }}</td>
<td>N/A</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endfor %}
</div>
</div>
{% endif %}
</div>
</div>
</div>
</div>
{% endfor %}
</section>
<!-- Drop Campaigns Section -->
<section class="drop-campaigns">
<h2>
Drop Campaigns -
<span class="d-inline text-muted">{{ games.count }} game{{ games.count|pluralize }}</span>
</h2>
<!-- Loop through games -->
{% for game in games %}
<div class="card mb-4 shadow-sm">
<div class="row g-0">
<!-- Game Box Art -->
<div class="col-md-2">
<img src="{{ game.box_art_url|default:'https://static-cdn.jtvnw.net/ttv-static/404_boxart.jpg' }}"
alt="{{ game.name|default:'Game name unknown' }} box art" class="img-fluid rounded-start"
height="283" width="212" loading="lazy">
</div>
<!-- Game Details -->
<div class="col-md-10">
<div class="card-body">
<h2 class="card-title h5">
<a href="{% url 'game' game.twitch_id %}" class="text-decoration-none">
{{ game.name|default:'Unknown' }}
</a>
-
<a href="https://www.twitch.tv/directory/category/{{ game.slug|default:'game-name-unknown' }}"
class="text-decoration-none text-muted">Twitch</a>
</h2>
<!-- Loop through campaigns for each game -->
{% for campaign in game.drop_campaigns.all %}
<div class="mt-4">
<h4 class="h6">{{ campaign.name }}</h4>
<a href="{{ campaign.details_url }}" class="text-decoration-none">Details</a>
{% if campaign.details_url != campaign.account_link_url %}
| <a href="{{ campaign.account_link_url }}" class="text-decoration-none">Link Account</a>
{% endif %}
<p class="mb-2 text-muted">
Ends in:
<abbr
title="{{ campaign.starts_at|date:'l d F H:i' }} - {{ campaign.ends_at|date:'l d F H:i' }}">
{{ campaign.ends_at|timeuntil }}
</abbr>
</p>
<!-- Drop Benefits Table -->
<div class="table-responsive">
<table class="table table-striped table-hover align-middle">
<thead>
<tr>
<th>Benefit Image</th>
<th>Benefit Name</th>
<th>Required Minutes Watched</th>
</tr>
</thead>
<tbody>
{% for drop in campaign.drops.all %}
{% if drop.benefits.exists %}
{% for benefit in drop.benefits.all %}
<tr>
<td>
<img src="{{ benefit.image_url|default:'https://static-cdn.jtvnw.net/ttv-static/404_boxart.jpg' }}"
alt="{{ benefit.name|default:'Unknown' }}" class="img-fluid rounded"
height="50" width="50" loading="lazy">
</td>
<td>
<abbr title="{{ drop.name|default:'Unknown' }}">
{{ benefit.name|default:'Unknown' }}
</abbr>
</td>
<td>{{ drop.required_minutes_watched|minutes_to_hours }}</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td>
<img src="https://static-cdn.jtvnw.net/ttv-static/404_boxart.jpg"
alt="{{ drop.name|default:'Unknown' }}" class="img-fluid rounded"
height="50" width="50" loading="lazy">
</td>
<td>{{ drop.name|default:'Unknown' }}</td>
<td>N/A</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
{% endfor %}
</section>
</div>
{% endfor %}
</section>
</div>
{% endblock content %}

View File

@ -1,6 +1,10 @@
{% for message in messages %}
<div class="alert alert-dismissible {{ message.tags }} fade show" role="alert">
<div>{{ message | safe }}</div>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<div class="alert alert-dismissible {{ message.tags }} fade show"
role="alert">
<div>{{ message|safe }}</div>
<button type="button"
class="btn-close"
data-bs-dismiss="alert"
aria-label="Close"></button>
</div>
{% endfor %}

View File

@ -1,50 +1,53 @@
{% if webhooks %}
<div class="card mb-4 shadow-sm" id="info-box">
<div class="row g-0">
<div class="col-md-10">
<div class="card-body">
<h2 class="card-title h2">Site news</h2>
<div class="mt-auto">
{% for webhook in webhooks %}
<div class="mt-3">
<img src="{{ webhook.avatar }}?size=32" alt="{{ webhook.name }}" class="rounded-circle"
height="32" width="32">
<a href="{{ webhook.url }}" target="_blank">{{ webhook.name }}</a>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="new-drop-switch-daily">
<label class="form-check-label" for="new-drop-switch-daily">Daily notification of newly
added games to TTVdrops</label>
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="new-drop-switch-weekly">
<label class="form-check-label" for="new-drop-switch-weekly">
Weekly notification of newly added games to TTVdrops
</label>
</div>
<br>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="new-org-switch-daily">
<label class="form-check-label" for="new-org-switch-daily">
Daily notification of newly added <abbr
title="Organizations are the companies that own the games.">organizations</abbr> to
TTVdrops
</label>
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="new-org-switch-weekly">
<label class="form-check-label" for="new-org-switch-weekly">
Weekly notification of newly added <abbr
title="Organizations are the companies that own the games.">organizations</abbr> to
TTVdrops
</label>
</div>
<div class="card mb-4 shadow-sm" id="info-box">
<div class="row g-0">
<div class="col-md-10">
<div class="card-body">
<h2 class="card-title h2">Site news</h2>
<div class="mt-auto">
{% for webhook in webhooks %}
<div class="mt-3">
<img src="{{ webhook.avatar }}?size=32"
alt="{{ webhook.name }}"
class="rounded-circle"
height="32"
width="32" />
<a href="{{ webhook.url }}" target="_blank">{{ webhook.name }}</a>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="new-drop-switch-daily" />
<label class="form-check-label" for="new-drop-switch-daily">
Daily notification of newly
added games to TTVdrops
</label>
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="new-drop-switch-weekly" />
<label class="form-check-label" for="new-drop-switch-weekly">
Weekly notification of newly added games to TTVdrops
</label>
</div>
<br />
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="new-org-switch-daily" />
<label class="form-check-label" for="new-org-switch-daily">
Daily notification of newly added <abbr title="Organizations are the companies that own the games.">organizations</abbr> to
TTVdrops
</label>
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="new-org-switch-weekly" />
<label class="form-check-label" for="new-org-switch-weekly">
Weekly notification of newly added <abbr title="Organizations are the companies that own the games.">organizations</abbr> to
TTVdrops
</label>
</div>
</div>
{% endfor %}
</div>
{% endfor %}
</div>
</div>
</div>
</div>
</div>
{% else %}
<p class="text-muted">No webhooks added yet.</p>
<p class="text-muted">No webhooks added yet.</p>
{% endif %}

View File

@ -1,14 +1,12 @@
{% extends "base.html" %}
{% load static %}
{% load campaign_tags %}
{% load game_tags %}
{% load campaign_tags game_tags static %}
{% block content %}
<div class="container mt-4">
<div class="row">
<h2>Reward Campaigns</h2>
{% for campaign in reward_campaigns %}
{% render_campaign campaign %}
{% endfor %}
<div class="container mt-4">
<div class="row">
<h2>Reward Campaigns</h2>
{% for campaign in reward_campaigns %}
{% render_campaign campaign %}
{% endfor %}
</div>
</div>
</div>
{% endblock content %}

View File

@ -1,42 +0,0 @@
{% extends "base.html" %}
{% block content %}
<div class="container">
<h1 class="my-4">Add Discord Webhook</h1>
<div class="card card-body mb-3">
Webhooks will be saved in a cookie and will be sent to the server when you subscribe to a drop.
</div>
<div>
<form method="post" class="needs-validation" novalidate>
{% csrf_token %}
{{ form.non_field_errors }}
<div class="mb-3">
{{ form.webhook_url.errors }}
<label for="{{ form.webhook_url.id_for_label }}" class="form-label">{{ form.webhook_url.label }}</label>
<input type="url" name="webhook_url" required="" class="form-control"
aria-describedby="id_webhook_url_helptext" id="id_webhook_url">
<div class="form-text text-muted">{{ form.webhook_url.help_text }}</div>
</div>
<button type="submit" class="btn btn-primary">Add Webhook</button>
</form>
</div>
<h2 class="mt-5">Webhooks</h2>
{% if webhooks %}
<div class="list-group">
{% for webhook in webhooks %}
<div class="list-group-item d-flex justify-content-between align-items-center">
<span>
{% if webhook.avatar %}
<img src="https://cdn.discordapp.com/avatars/{{ webhook.id }}/a_{{ webhook.avatar }}.png"
alt="Avatar of {{ webhook.name }}" class="rounded-circle" height="32" width="32">
{% endif %}
<a href="https://discord.com/api/webhooks/{{ webhook.id }}/{{ webhook.token }}" target="_blank"
class="text-decoration-none">{{ webhook.name }}</a>
</span>
</div>
{% endfor %}
</div>
{% else %}
<div class="alert alert-info">No webhooks added</div>
{% endif %}
</div>
{% endblock content %}