Add ids to tags; use pygments to color JSON

This commit is contained in:
Joakim Hellsén 2025-09-07 22:31:31 +02:00
commit 8f438aca2d
18 changed files with 365 additions and 211 deletions

View file

@ -3,14 +3,16 @@
Debug
{% endblock title %}
{% block content %}
<h1>Debug Data Integrity Report</h1>
<p>Generated at: {{ now }}</p>
<h1 id="page-title">Debug Data Integrity Report</h1>
<p>
Generated at: <time id="generation-time">{{ now }}</time>
</p>
<section>
<h2>Games Without an Assigned Owner ({{ games_without_owner|length }})</h2>
<h2 id="games-without-owner-header">Games Without an Assigned Owner ({{ games_without_owner|length }})</h2>
{% if games_without_owner %}
<ul>
<ul id="games-without-owner-list">
{% for game in games_without_owner %}
<li>
<li id="game-{{ game.id }}">
<a href="{% url 'twitch:game_detail' game.id %}">{{ game.display_name }}</a> (ID: {{ game.id }})
</li>
{% endfor %}
@ -20,11 +22,11 @@
{% endif %}
</section>
<section>
<h2>Campaigns With Broken Image URLs ({{ broken_image_campaigns|length }})</h2>
<h2 id="broken-image-campaigns-header">Campaigns With Broken Image URLs ({{ broken_image_campaigns|length }})</h2>
{% if broken_image_campaigns %}
<ul>
<ul id="broken-image-campaigns-list">
{% for c in broken_image_campaigns %}
<li>
<li id="campaign-{{ c.id }}">
<a href="{% url 'twitch:campaign_detail' c.id %}">{{ c.name }}</a>
(Game: <a href="{% url 'twitch:game_detail' c.game.id %}">{{ c.game.display_name }}</a>)
- URL: {{ c.image_url|default:'(empty)' }}
@ -36,14 +38,14 @@
{% endif %}
</section>
<section>
<h2>Benefits With Broken Image URLs ({{ broken_benefit_images|length }})</h2>
<h2 id="broken-benefit-images-header">Benefits With Broken Image URLs ({{ broken_benefit_images|length }})</h2>
{% if broken_benefit_images %}
<ul>
<ul id="broken-benefit-images-list">
{% for b in broken_benefit_images %}
{# A benefit is linked to a game via a drop and a campaign. #}
{# We use the 'with' tag to get the first drop for cleaner access. #}
{% with first_drop=b.drops.all.0 %}
<li>
<li id="benefit-{{ b.id }}">
{{ b.name }}
{# Check if the relationship path to the game exists #}
{% if first_drop and first_drop.campaign and first_drop.campaign.game %}
@ -61,11 +63,11 @@
{% endif %}
</section>
<section>
<h2>Active Campaigns Missing Image ({{ active_missing_image|length }})</h2>
<h2 id="active-missing-image-header">Active Campaigns Missing Image ({{ active_missing_image|length }})</h2>
{% if active_missing_image %}
<ul>
<ul id="active-missing-image-list">
{% for c in active_missing_image %}
<li>
<li id="campaign-{{ c.id }}">
<a href="{% url 'twitch:campaign_detail' c.id %}">{{ c.name }}</a>
(Game: <a href="{% url 'twitch:game_detail' c.game.id %}">{{ c.game.display_name }}</a>)
</li>
@ -76,11 +78,11 @@
{% endif %}
</section>
<section>
<h2>Time-Based Drops Without Benefits ({{ drops_without_benefits|length }})</h2>
<h2 id="drops-without-benefits-header">Time-Based Drops Without Benefits ({{ drops_without_benefits|length }})</h2>
{% if drops_without_benefits %}
<ul>
<ul id="drops-without-benefits-list">
{% for d in drops_without_benefits %}
<li>
<li id="drop-{{ d.id }}">
{{ d.name }}
(Campaign: <a href="{% url 'twitch:campaign_detail' d.campaign.id %}">{{ d.campaign.name }}</a>
in Game: <a href="{% url 'twitch:game_detail' d.campaign.game.id %}">{{ d.campaign.game.display_name }}</a>)
@ -92,11 +94,11 @@
{% endif %}
</section>
<section>
<h2>Campaigns With Invalid Dates ({{ invalid_date_campaigns|length }})</h2>
<h2 id="invalid-date-campaigns-header">Campaigns With Invalid Dates ({{ invalid_date_campaigns|length }})</h2>
{% if invalid_date_campaigns %}
<ul>
<ul id="invalid-date-campaigns-list">
{% for c in invalid_date_campaigns %}
<li>
<li id="campaign-{{ c.id }}">
<a href="{% url 'twitch:campaign_detail' c.id %}">{{ c.name }}</a>
(Game: <a href="{% url 'twitch:game_detail' c.game.id %}">{{ c.game.display_name }}</a>)
- Start: {{ c.start_at|default:'(none)' }} / End: {{ c.end_at|default:'(none)' }}
@ -108,9 +110,9 @@
{% endif %}
</section>
<section>
<h2>Duplicate Campaign Names Per Game ({{ duplicate_name_campaigns|length }})</h2>
<h2 id="duplicate-name-campaigns-header">Duplicate Campaign Names Per Game ({{ duplicate_name_campaigns|length }})</h2>
{% if duplicate_name_campaigns %}
<table>
<table id="duplicate-name-campaigns-table">
<thead>
<tr>
<th>Game</th>