From 15caff2bc9ebfd0d4e5854d92f5813250f083cfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Sat, 30 Aug 2025 00:14:18 +0200 Subject: [PATCH] Refactor campaign list filters and improve layout for better usability --- templates/twitch/campaign_list.html | 220 +++++++++++++--------------- 1 file changed, 99 insertions(+), 121 deletions(-) diff --git a/templates/twitch/campaign_list.html b/templates/twitch/campaign_list.html index 84ba3f8..4345eb6 100644 --- a/templates/twitch/campaign_list.html +++ b/templates/twitch/campaign_list.html @@ -21,11 +21,7 @@
- {% for game in games %}
{% if campaigns %} {% regroup campaigns by game as campaigns_by_game %} {% for game_group in campaigns_by_game %}
-
-
+
+
{% if game_group.grouper.box_art_base_url %} Box art for {{ game_group.grouper.display_name }} {% else %} -
+ font-size: 1rem"> 🎮
No Image @@ -88,78 +73,82 @@ {% endif %}
-
-
-
- {% for campaign in game_group.list %} -
-
- - {% if campaign.image_url %} - Campaign artwork for {{ campaign.name }} - {% else %} -
- 📦 -
- No Image +
+

+ {{ game_group.grouper.display_name|default:game_group.grouper.name|default:game_group.grouper.slug|default:game_group.grouper.id }} +

+

+ {{ game_group.list.0.owner.name }} +

+
+
+
+ {% for campaign in game_group.list %} +
+
+ + {% if campaign.image_url %} + Campaign artwork for {{ campaign.name }} + {% else %} +
+ 📦 +
+ No Image +
+ {% endif %} +

{{ campaign.clean_name }}

+
+
+ + - +
- {% endif %} -

{{ campaign.clean_name }}

- -
- - - - -
-
- {% if campaign.start_at <= now and campaign.end_at >= now %} - Active - {% elif campaign.start_at > now %} - Upcoming - {% else %} - Expired - {% endif %} -
-
-
- {% endfor %} +
+ {% if campaign.start_at <= now and campaign.end_at >= now %} + Active + {% elif campaign.start_at > now %} + Upcoming + {% else %} + Expired + {% endif %} +
+
+
+ {% endfor %} +
+
{% endfor %} {% else %} -
+
📦
-

No Campaigns Found

+

No Campaigns Found

No campaigns match your current filters.
@@ -178,66 +167,55 @@ {% if page_obj.has_previous %} «« + text-decoration: none">«« « {% else %} - «« - « + «« + « {% endif %} {% for num in page_obj.paginator.page_range %} {% if page_obj.number == num %} - {{ num }} + {{ num }} {% elif num > page_obj.number|add:'-3' and num < page_obj.number|add:'3' %} {{ num }} + text-decoration: none">{{ num }} {% elif num == 1 or num == page_obj.paginator.num_pages %} {{ num }} + text-decoration: none">{{ num }} {% elif num == page_obj.number|add:'-4' or num == page_obj.number|add:'4' %} - ... + ... {% endif %} {% endfor %} {% if page_obj.has_next %} » + text-decoration: none">» »» + text-decoration: none">»» {% else %} - » - »» + » + »» {% endif %} - + Showing {{ page_obj.start_index }} to {{ page_obj.end_index }} of {{ page_obj.paginator.count }} campaigns (Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }})