From 4663a827e4f5f352c85c762f48c626211c1af99e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Helle=C5=9Ben?= Date: Wed, 11 Mar 2026 23:38:31 +0100 Subject: [PATCH] Make templates sexier --- templates/twitch/badge_list.html | 4 +- templates/twitch/badge_set_detail.html | 9 +- templates/twitch/campaign_detail.html | 196 +++++++------- templates/twitch/campaign_list.html | 69 ++--- templates/twitch/channel_detail.html | 54 ++-- templates/twitch/dashboard.html | 289 +++++++++++---------- templates/twitch/emote_gallery.html | 2 + templates/twitch/game_detail.html | 60 +++-- templates/twitch/reward_campaign_list.html | 50 ++-- twitch/models.py | 8 + twitch/tests/test_views.py | 7 +- twitch/views.py | 97 +++---- 12 files changed, 437 insertions(+), 408 deletions(-) diff --git a/templates/twitch/badge_list.html b/templates/twitch/badge_list.html index c6da862..49e4016 100644 --- a/templates/twitch/badge_list.html +++ b/templates/twitch/badge_list.html @@ -1,17 +1,19 @@ {% extends "base.html" %} {% load image_tags %} {% block title %} - Chat Badges - ttvdrops + Chat Badges {% endblock title %} {% block content %}

{{ badge_sets.count }} Twitch Chat Badges

{% if badge_sets %} {% for data in badge_data %} +

{{ data.set.set_id }}

{% for badge in data.badges %} +
diff --git a/templates/twitch/badge_set_detail.html b/templates/twitch/badge_set_detail.html index ef3e57c..3d203e6 100644 --- a/templates/twitch/badge_set_detail.html +++ b/templates/twitch/badge_set_detail.html @@ -9,6 +9,7 @@ {% for badge in badges %} + {% if badge.award_campaigns %} +
The following campaigns have the same name as this badge and may be awarding it:
    {% for campaign in badge.award_campaigns %} +
  • {{ campaign.clean_name }}
  • diff --git a/templates/twitch/campaign_detail.html b/templates/twitch/campaign_detail.html index 5b452a6..ffabe75 100644 --- a/templates/twitch/campaign_detail.html +++ b/templates/twitch/campaign_detail.html @@ -17,110 +17,99 @@ {% endif %} {% endblock extra_head %} {% block content %} - -

    - {% if campaign.game %} - {{ campaign.game.get_game_name }} - {{ campaign.clean_name }} - {% else %} - {{ campaign.clean_name }} - {% endif %} -

    - - {% for org in owners %} -

    - {{ org.name }} -

    - {% endfor %} - - {% if campaign.image_best_url %} - {% picture campaign.image_best_url alt=campaign.name width=160 %} - {% endif %} - -

    {{ campaign.description|linebreaksbr }}

    - -
    - {% if campaign.end_at < now %} - - {% else %} - - {% endif %} -
    - -
    - {% if campaign.start_at > now %} - - {% else %} - - {% endif %} -
    - -
    - -
    -
    - - {% if campaign.details_url %}[details]{% endif %} - - {% if campaign.account_link_url %} - [connect] - {% endif %} - - {% if campaign.game %} - [rss] - [atom] - {% endif %} -
    - {% if allowed_channels %} -
    Allowed Channels
    -
    - {% for channel in allowed_channels %} - {{ channel.display_name }} - {% endfor %} +
    + +
    + {% if campaign.image_best_url %} + {% picture campaign.image_best_url alt=campaign.name width=160 %} + {% endif %}
    - {% else %} - - Go to a participating live channel - - {% endif %} + +
    +

    {{ campaign.clean_name }}

    +
    + {% if campaign.game %} + {{ campaign.game.get_game_name }} + {% endif %} + {% if owners %} + - + + {% for org in owners %} + {{ org.name }} + {% endfor %} + {% endif %} +
    + +

    {{ campaign.description|linebreaksbr }}

    + +
    + {% if campaign.end_at < now %} + + {% else %} + + {% endif %} +
    + +
    + {% if campaign.start_at > now %} + + {% else %} + + {% endif %} +
    + +
    + +
    + +
    + + {% if campaign.details_url %}[details]{% endif %} + + {% if campaign.account_link_url %} + [connect] + {% endif %} + + {% if campaign.game %} + [rss] + [atom] + {% endif %} +
    +
    +
    Campaign Info
    {% if drops %} -
{{ badge.badge_id }} @@ -24,18 +25,16 @@ [72px] - {% if badge.click_url %} - {{ badge.click_action }} - {% else %} - - - {% endif %} + {% if badge.click_url %}{{ badge.click_action }}{% endif %}
- - - - - - - - + +
Drop NameRequirementsPeriod
{% for drop in drops %} - + +
{% for benefit in drop.drop.benefits.all %} {% if benefit.image_asset_url %} + {% picture benefit.image_best_url|default:benefit.image_asset_url alt=benefit.name width=160 height=160 style="object-fit: cover; margin-right: 3px" %} {% endif %} {% if benefit.distribution_type == "BADGE" and drop.awarded_badge %} +
Awards Badge: @@ -128,6 +117,7 @@ {{ drop.awarded_badge.title }} {% if drop.awarded_badge.description %} +
{{ drop.awarded_badge.description|linebreaksbr }}
{% endif %}
@@ -138,6 +128,7 @@
{{ drop.drop.name }}
{% for benefit in drop.drop.benefits.all %} {% if benefit.name != drop.drop.name %} +
{{ benefit.name }}
{% endif %} {% endfor %} @@ -163,8 +154,27 @@
{% else %} +

No drops available for this campaign.

{% endif %} + + {% if allowed_channels %} + +
Allowed Channels
+
+ {% for channel in allowed_channels %} + + {{ channel.display_name }} + {% endfor %} +
+ {% else %} + + + Go to a participating live channel + + {% endif %} {{ campaign_data|safe }} {% endblock content %} diff --git a/templates/twitch/campaign_list.html b/templates/twitch/campaign_list.html index cc31beb..67dbec8 100644 --- a/templates/twitch/campaign_list.html +++ b/templates/twitch/campaign_list.html @@ -3,7 +3,7 @@ {% load image_tags %} {% load image_tags %} {% block title %} - Drop Campaigns - Twitch Drops Tracker + Drop Campaigns {% endblock title %} {% block extra_head %} {% for game in games %} +