added translations

This commit is contained in:
Joren de Graaf
2026-10-01 22:43:45 +02:00
parent 2e36f26089
commit 3b864f001d
78 changed files with 1787 additions and 291 deletions
@@ -1,32 +1,33 @@
{% load i18n %}
{% if error %}
<section class="results-card error-card" role="alert">
<h2>Analysis unavailable</h2>
<h2>{% trans "Analysis unavailable" %}</h2>
<p>{{ error }}</p>
</section>
{% else %}
<section class="results-card" tabindex="-1">
<div class="result-heading">
<div>
<h2>Analysis complete</h2>
<h2>{% trans "Analysis complete" %}</h2>
<p>{{ result.filename|default:"Audio file" }}</p>
</div>
<span class="result-status">Ready</span>
<span class="result-status">{% trans "Ready" %}</span>
</div>
<div class="meta">
<span>{{ result.duration_seconds|default:"—" }} seconds</span>
<span>{{ result.frames_analysed|default:"—" }} frames analysed</span>
<span>{{ result.yamnet_sample_rate|default:"—" }} Hz model rate</span>
<span>{% blocktrans with duration=result.duration_seconds|default:"—" %}{{ duration }} seconds{% endblocktrans %}</span>
<span>{% blocktrans with frames=result.frames_analysed|default:"—" %}{{ frames }} frames analysed{% endblocktrans %}</span>
<span>{% blocktrans with rate=result.yamnet_sample_rate|default:"—" %}{{ rate }} Hz model rate{% endblocktrans %}</span>
</div>
<div class="legend" aria-label="Result legend">
{% if firework_count %}<span class="firework">✦ {{ firework_count }} firework-related signal{{ firework_count|pluralize }}</span>{% endif %}
{% if speech_count %}<span class="speech">● {{ speech_count }} speech/privacy signal{{ speech_count|pluralize }}</span>{% endif %}
<div class="legend" aria-label="{% trans "Result legend" %}">
{% if firework_count %}<span class="firework">✦ {% blocktrans count count=firework_count %}{{ count }} firework-related signal{% plural %}{{ count }} firework-related signals{% endblocktrans %}</span>{% endif %}
{% if speech_count %}<span class="speech">● {% blocktrans count count=speech_count %}{{ count }} speech/privacy signal{% plural %}{{ count }} speech/privacy signals{% endblocktrans %}</span>{% endif %}
</div>
<div class="result-grid">
<section class="result-group" aria-labelledby="top-predictions">
<h3 id="top-predictions">Top sound classes</h3>
<h3 id="top-predictions">{% trans "Top sound classes" %}</h3>
{% if predictions %}
<ul class="prediction-list">
{% for prediction in predictions %}
@@ -37,11 +38,11 @@
</li>
{% endfor %}
</ul>
{% else %}<p class="empty">No overall predictions were returned.</p>{% endif %}
{% else %}<p class="empty">{% trans "No overall predictions were returned." %}</p>{% endif %}
</section>
<section class="result-group" aria-labelledby="peak-predictions">
<h3 id="peak-predictions">Notable moments</h3>
<h3 id="peak-predictions">{% trans "Notable moments" %}</h3>
{% if peak_predictions %}
<div class="peak-list">
{% for prediction in peak_predictions %}
@@ -55,14 +56,14 @@
</article>
{% endfor %}
</div>
{% else %}<p class="empty">No peak events were returned.</p>{% endif %}
{% else %}<p class="empty">{% trans "No peak events were returned." %}</p>{% endif %}
</section>
</div>
{% if submission_token %}
<div class="review-submission" id="review-submission">
<input type="hidden" name="classification_token" value="{{ submission_token }}">
<div><strong>Submit this sample for review</strong><p>The audio and signed classifier response will be added to Pending.</p></div>
<button type="button" hx-post="{% url 'fireworks_detect:submit_pending' %}" hx-target="#review-submission" hx-swap="outerHTML" hx-encoding="multipart/form-data">Send to Pending →</button>
<div><strong>{% trans "Submit this sample for review" %}</strong><p>{% trans "The audio and signed classifier response will be added to Pending." %}</p></div>
<button type="button" hx-post="{% url 'fireworks_detect:submit_pending' %}" hx-target="#review-submission" hx-swap="outerHTML" hx-encoding="multipart/form-data">{% trans "Send to Pending →" %}</button>
</div>
{% endif %}
</section>
@@ -1,26 +1,27 @@
{% load vite %}
{% load i18n vite %}
<!doctype html>
<html lang="en" data-theme="dark">
<html lang="{{ request.LANGUAGE_CODE|default:'en' }}" data-theme="dark">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Report fireworks · Sound Signal</title>
<title>{% trans "Report fireworks · Sound Signal" %}</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css">
<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.4/dist/htmx.min.js"></script>
{% vite_asset "frontend/src/entries/dashboard.js" %}
{% include "js_translations.html" %}
</head>
<body class="dashboard-page">
{% if user.is_authenticated %}<a class="profile-circle" href="{% url "user_settings" %}" aria-label="Open settings for {{ user.get_username }}" title="Settings">{{ user.get_username|first|upper }}</a>{% endif %}
{% if user.is_authenticated %}<a class="profile-circle" href="{% url "user_settings" %}" aria-label="{% blocktrans with username=user.get_username %}Open settings for {{ username }}{% endblocktrans %}" title="{% trans "Settings" %}">{{ user.get_username|first|upper }}</a>{% endif %}
<main class="dashboard-shell">
{% include "fireworks_detect/includes/navigation.html" %}
<section class="dashboard-intro" aria-labelledby="dashboard-title">
<p class="dashboard-kicker">Community reporting</p>
<h1 id="dashboard-title">Report what you heard.</h1>
<p>Quickly log fireworks when they happen. Your optional location is represented as an H3 cell on the map, rather than as precise coordinates.</p>
<p class="dashboard-kicker">{% trans "Community reporting" %}</p>
<h1 id="dashboard-title">{% trans "Report what you heard." %}</h1>
<p>{% trans "Quickly log fireworks when they happen. Your optional location is represented as an H3 cell on the map, rather than as precise coordinates." %}</p>
</section>
<section class="dashboard-section" aria-label="Quick fireworks report">
<section class="dashboard-section" aria-label="{% trans "Quick fireworks report" %}">
<div class="dashboard-report">
{% include "fireworks_detect/includes/manual_report_form.html" %}
</div>
@@ -28,15 +29,15 @@
<section class="dashboard-section dashboard-map" aria-labelledby="dashboard-map-title">
<header class="dashboard-section__header">
<div><p class="dashboard-kicker">Recent reports</p><h2 id="dashboard-map-title">Activity map</h2></div>
<a class="dashboard-link" href="{% url "fireworks_detect:map" %}">Open map controls <span aria-hidden="true">→</span></a>
<div><p class="dashboard-kicker">{% trans "Recent reports" %}</p><h2 id="dashboard-map-title">{% trans "Activity map" %}</h2></div>
<a class="dashboard-link" href="{% url "fireworks_detect:map" %}">{% trans "Open map controls" %} <span aria-hidden="true">→</span></a>
</header>
{% include "fireworks_detect/includes/map_panel.html" %}
</section>
<section class="dashboard-section" aria-labelledby="dashboard-audio-title">
<header class="dashboard-section__header">
<div><p class="dashboard-kicker">Audio analysis</p><h2 id="dashboard-audio-title">Classify a recording</h2></div>
<div><p class="dashboard-kicker">{% trans "Audio analysis" %}</p><h2 id="dashboard-audio-title">{% trans "Classify a recording" %}</h2></div>
</header>
<div class="upload-card dashboard-upload">
{% include "fireworks_detect/includes/audio_upload_form.html" %}
@@ -1,27 +1,28 @@
{% load i18n %}
{% if event.source_type == "manual" %}
<h2>Manual fireworks report</h2>
<p class="meta">Approved {{ event.approved_at|date:"j M Y, H:i" }} · Reported manually</p>
<h3>Report details</h3>
<div class="prediction prediction--firework"><strong>Occurrences</strong><span>{{ event.occurrences }}</span></div>
<div class="prediction prediction--firework"><strong>Location</strong><span>{{ event.location|default:"Not recorded" }}</span></div>
<div class="prediction prediction--firework"><strong>Captured location</strong><span>{{ event_h3_cell|default:"Not recorded" }}</span></div>
<div class="prediction prediction--firework"><strong>Direction</strong><span>{{ event.direction_display }}</span></div>
{% if event.direction_accuracy_degrees is not None %}<div class="prediction prediction--firework"><strong>Compass accuracy</strong><span>±{{ event.direction_accuracy_degrees|floatformat:"-1" }}°</span></div>{% endif %}
<div class="prediction prediction--firework"><strong>Visually confirmed</strong><span>{% if event.visually_confirmed %}Yes{% else %}No{% endif %}</span></div>
<p class="empty">This was a manual report; there is no audio classification attached.</p>
<h2>{% trans "Manual fireworks report" %}</h2>
<p class="meta">{% blocktrans with date=event.approved_at|date:"j M Y, H:i" %}Approved {{ date }} · Reported manually{% endblocktrans %}</p>
<h3>{% trans "Report details" %}</h3>
<div class="prediction prediction--firework"><strong>{% trans "Occurrences" %}</strong><span>{{ event.occurrences }}</span></div>
<div class="prediction prediction--firework"><strong>{% trans "Location" %}</strong><span>{{ event.location|default:"Not recorded" }}</span></div>
<div class="prediction prediction--firework"><strong>{% trans "Captured location" %}</strong><span>{{ event_h3_cell|default:"Not recorded" }}</span></div>
<div class="prediction prediction--firework"><strong>{% trans "Direction" %}</strong><span>{{ event.direction_display }}</span></div>
{% if event.direction_accuracy_degrees is not None %}<div class="prediction prediction--firework"><strong>{% trans "Compass accuracy" %}</strong><span>±{{ event.direction_accuracy_degrees|floatformat:"-1" }}°</span></div>{% endif %}
<div class="prediction prediction--firework"><strong>{% trans "Visually confirmed" %}</strong><span>{% if event.visually_confirmed %}{% trans "Yes" %}{% else %}{% trans "No" %}{% endif %}</span></div>
<p class="empty">{% trans "This was a manual report; there is no audio classification attached." %}</p>
{% else %}
<h2>{{ event.original_filename }}</h2>
<p class="meta">Approved {{ event.approved_at|date:"j M Y, H:i" }} · {{ result.duration_seconds|default:"—" }} seconds · {{ result.frames_analysed|default:"—" }} frames</p>
<h3>Top sound classes</h3>
<p class="meta">{% blocktrans with date=event.approved_at|date:"j M Y, H:i" duration=result.duration_seconds|default:"—" frames=result.frames_analysed|default:"—" %}Approved {{ date }} · {{ duration }} seconds · {{ frames }} frames{% endblocktrans %}</p>
<h3>{% trans "Top sound classes" %}</h3>
{% for prediction in predictions %}
<div class="prediction prediction--{{ prediction.kind }}"><strong>{{ prediction.label }}</strong><span>{{ prediction.score_display }}</span></div>
{% empty %}
<p class="empty">No predictions returned.</p>
<p class="empty">{% trans "No predictions returned." %}</p>
{% endfor %}
<h3>Notable moments</h3>
<h3>{% trans "Notable moments" %}</h3>
{% for prediction in peak_predictions %}
<div class="prediction prediction--{{ prediction.kind }}"><strong>{{ prediction.label }}</strong><span>{{ prediction.time_seconds|default:"—" }}s · {{ prediction.score_display }}</span></div>
{% empty %}
<p class="empty">No peak events returned.</p>
<p class="empty">{% trans "No peak events returned." %}</p>
{% endfor %}
{% endif %}
@@ -1,2 +1,2 @@
{% load vite %}
<!doctype html><html lang="en" data-theme="dark"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Events · Sound Signal</title><script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.4/dist/htmx.min.js"></script>{% vite_asset "frontend/src/entries/events.js" %}</head><body><main class="shell">{% include "fireworks_detect/includes/navigation.html" with active_page="events" %}<p class="eyebrow">Reviewed signal archive</p><h1>Approved events.</h1><p class="lede">This feed refreshes automatically every three seconds after a pending sample is approved in admin.</p><div class="grid"><section class="panel"><h2>Latest events</h2><div id="events-feed" hx-get="{% url 'fireworks_detect:events_list' %}" hx-trigger="load, every 3s" hx-swap="innerHTML"><p class="empty">Loading events…</p></div></section><section class="panel detail" id="event-detail"><h2>Select an event</h2><p class="empty">Choose an approved event to inspect its classification details.</p></section></div></main></body></html>
{% load i18n vite %}
<!doctype html><html lang="{{ request.LANGUAGE_CODE|default:'en' }}" data-theme="dark"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{% trans "Events · Sound Signal" %}</title><script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.4/dist/htmx.min.js"></script>{% vite_asset "frontend/src/entries/events.js" %}{% include "js_translations.html" %}</head><body><main class="shell">{% include "fireworks_detect/includes/navigation.html" with active_page="events" %}<p class="eyebrow">{% trans "Reviewed signal archive" %}</p><h1>{% trans "Approved events." %}</h1><p class="lede">{% trans "This feed refreshes automatically every three seconds after a pending sample is approved in admin." %}</p><div class="grid"><section class="panel"><h2>{% trans "Latest events" %}</h2><div id="events-feed" hx-get="{% url 'fireworks_detect:events_list' %}" hx-trigger="load, every 3s" hx-swap="innerHTML"><p class="empty">{% trans "Loading events…" %}</p></div></section><section class="panel detail" id="event-detail"><h2>{% trans "Select an event" %}</h2><p class="empty">{% trans "Choose an approved event to inspect its classification details." %}</p></section></div></main></body></html>
@@ -1,20 +1,21 @@
{% load i18n %}
{% if events %}
{% for event in events %}
<button class="event {% if event.source_type == "manual" %}event--manual{% else %}event--sensor{% endif %}" hx-get="{% url 'fireworks_detect:event_detail' event.id %}" hx-target="#event-detail" hx-swap="innerHTML">
<span class="event__content">
{% if event.source_type == "manual" %}
<span class="event__source">Manual report</span>
<strong>Manual fireworks report</strong><br>
<small>{{ event.occurrences }} occurrence{{ event.occurrences|pluralize }}{% if event.location %} · {{ event.location }}{% endif %}</small>
<span class="event__source">{% trans "Manual report" %}</span>
<strong>{% trans "Manual fireworks report" %}</strong><br>
<small>{% blocktrans count count=event.occurrences %}{{ count }} occurrence{% plural %}{{ count }} occurrences{% endblocktrans %}{% if event.location %} · {{ event.location }}{% endif %}</small>
{% else %}
<span class="event__source">Sensor classification</span>
<span class="event__source">{% trans "Sensor classification" %}</span>
<strong>{{ event.primary_label }}</strong><br>
<small>{{ event.original_filename }} · {{ event.duration }}s</small>
{% endif %}
</span>
<span class="badge">{% if event.source_type == "manual" %}Manual →{% else %}{{ event.primary_score }} →{% endif %}</span>
<span class="badge">{% if event.source_type == "manual" %}{% trans "Manual" %} →{% else %}{{ event.primary_score }} →{% endif %}</span>
</button>
{% endfor %}
{% else %}
<p class="empty">No approved events yet. Submit a classification, then approve it from the Pending page in admin.</p>
<p class="empty">{% trans "No approved events yet. Submit a classification, then approve it from the Pending page in admin." %}</p>
{% endif %}
@@ -1,13 +1,14 @@
{% load vite %}
{% load i18n vite %}
<!DOCTYPE html>
<html lang="en" data-theme="dark">
<html lang="{{ request.LANGUAGE_CODE|default:'en' }}" data-theme="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sound Signal · Fireworks detection</title>
<title>{% trans "Sound Signal · Fireworks detection" %}</title>
<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.4/dist/htmx.min.js"></script>
{% vite_asset "frontend/src/entries/fireworks-home.js" %}
{% include "js_translations.html" %}
</head>
<body>
@@ -16,16 +17,14 @@
<section class="intro" aria-labelledby="page-title">
<p class="kicker">Audio event analysis</p>
<h1 id="page-title">See what your audio heard.</h1>
<p class="lede">Drop a recording to identify its most likely sounds. Firework-related signals are
highlighted in amber; speech-related signals are marked in red for future privacy filtering.</p>
<a href="https://pixabay.com/sound-effects/search/fireworks/" class="button" target="_blank">Here's some
samples to test with</a>
<p class="kicker">{% trans "Audio event analysis" %}</p>
<h1 id="page-title">{% trans "See what your audio heard." %}</h1>
<p class="lede">{% blocktrans trimmed %}Drop a recording to identify its most likely sounds. Firework-related signals are highlighted in amber; speech-related signals are marked in red for future privacy filtering.{% endblocktrans %}</p>
<a href="https://pixabay.com/sound-effects/search/fireworks/" class="button" target="_blank">{% trans "Here are some samples to test with" %}</a>
<br /><br />
</section>
<section class="upload-card" aria-label="Upload audio for classification">
<section class="upload-card" aria-label="{% trans "Upload audio for classification" %}">
{% include "fireworks_detect/includes/audio_upload_form.html" %}
</section>
</main>
@@ -1,18 +1,19 @@
{% load i18n %}
<form class="upload-form" action="{% url "fireworks_detect:classify_upload" %}" method="post" enctype="multipart/form-data" hx-post="{% url "fireworks_detect:classify_upload" %}" hx-target="#classification-results" hx-swap="innerHTML" hx-encoding="multipart/form-data" hx-indicator="#upload-indicator">
{% csrf_token %}
<label class="drop-zone" id="drop-zone">
<input class="file-input" id="audio-file" type="file" name="audio" accept="audio/*,.wav,.mp3,.m4a,.ogg,.flac,.aac,.opus" required>
<span>
<span class="upload-icon">↑</span>
<strong>Drop an audio file here</strong>
<span>or click to browse your device</span>
<strong>{% trans "Drop an audio file here" %}</strong>
<span>{% trans "or click to browse your device" %}</span>
</span>
<span class="file-name" id="file-name">No file selected</span>
<span class="file-name" id="file-name">{% trans "No file selected" %}</span>
</label>
<div class="form-footer">
<p class="file-note">WAV, MP3, M4A, OGG and more · 25 MiB maximum</p>
<button type="submit"><span class="spinner htmx-indicator" id="upload-indicator" aria-hidden="true"></span>Analyse audio</button>
<p class="file-note">{% trans "WAV, MP3, M4A, OGG and more · 25 MiB maximum" %}</p>
<button type="submit"><span class="spinner htmx-indicator" id="upload-indicator" aria-hidden="true"></span>{% trans "Analyse audio" %}</button>
</div>
<section id="classification-results" aria-live="polite" aria-label="Classification results"></section>
<section id="classification-results" aria-live="polite" aria-label="{% trans "Classification results" %}"></section>
</form>
<p id="upload-status" role="status" aria-live="polite"></p>
@@ -1,22 +1,23 @@
{% load i18n %}
<section class="manual-report" aria-labelledby="manual-report-title">
<p class="eyebrow">No recording needed</p>
<h2 class="manual-report__title" id="manual-report-title">Report fireworks now</h2>
<p class="manual-report__intro">Choose how many times you heard fireworks, then send it straight to Pending. The report is timestamped now.</p>
<p class="eyebrow">{% trans "No recording needed" %}</p>
<h2 class="manual-report__title" id="manual-report-title">{% trans "Report fireworks now" %}</h2>
<p class="manual-report__intro">{% trans "Choose how many times you heard fireworks, then send it straight to Pending. The report is timestamped now." %}</p>
<form id="manual-report-form" action="{% url "fireworks_detect:submit_manual_pending" %}" method="post" hx-post="{% url "fireworks_detect:submit_manual_pending" %}" hx-target="#manual-submission" hx-swap="outerHTML">
{% csrf_token %}
<label class="manual-report__label" for="manual-occurrences">Number of occurrences</label>
<label class="manual-report__label" for="manual-occurrences">{% trans "Number of occurrences" %}</label>
<input id="manual-latitude" name="latitude" type="hidden">
<input id="manual-longitude" name="longitude" type="hidden">
<input id="manual-direction-degrees" name="direction_degrees" type="hidden">
<input id="manual-direction-accuracy" name="direction_accuracy_degrees" type="hidden">
<input id="manual-occurrences" name="occurrences" type="number" min="1" max="1000" value="1" required inputmode="numeric">
<div class="manual-direction-panel" id="manual-direction-panel" hidden>
<strong class="manual-direction-panel__heading">Direction <span>(optional)</span></strong>
<p class="manual-direction-panel__copy">Point the top of your phone toward the fireworks, then capture a single compass reading.</p>
<button id="manual-capture-direction" class="manual-direction-panel__button" type="button">Capture direction</button>
<strong class="manual-direction-panel__heading">{% trans "Direction" %} <span>({% trans "optional" %})</span></strong>
<p class="manual-direction-panel__copy">{% trans "Point the top of your phone toward the fireworks, then capture a single compass reading." %}</p>
<button id="manual-capture-direction" class="manual-direction-panel__button" type="button">{% trans "Capture direction" %}</button>
<div id="manual-direction-status" class="manual-direction-panel__status" aria-live="polite"></div>
</div>
<button id="manual-submit" class="manual-report__submit" type="button">I heard fireworks — send to Pending</button>
<button id="manual-submit" class="manual-report__submit" type="button">{% trans "I heard fireworks — send to Pending" %}</button>
</form>
<div id="manual-submission" class="manual-report__submission" aria-live="polite"></div>
</section>
@@ -1,7 +1,8 @@
<section class="map-panel" aria-label="Manual fireworks report map">
<div class="map-header"><strong>Manual reports · privacy-preserving H3 cells</strong><span class="live"><i></i> H3 resolution {{ h3_resolution }} · sensor layer disabled</span></div>
<div class="map-wrap"><div id="event-map" class="map" data-h3-resolution="{{ h3_resolution }}" aria-label="Interactive map of manual fireworks reports"></div>
<aside class="legend" aria-label="Map legend"><h2>Manual reports</h2><div><span class="legend-dot"></span> Report marker at H3-cell centre</div><div><span class="legend-ring"></span> H3 cell (resolution {{ h3_resolution }})</div><div><span class="legend-line"></span> Saved compass direction</div></aside>
{% load i18n %}
<section class="map-panel" aria-label="{% trans "Manual fireworks report map" %}">
<div class="map-header"><strong>{% trans "Manual reports · privacy-preserving H3 cells" %}</strong><span class="live"><i></i> {% blocktrans with resolution=h3_resolution %}H3 resolution {{ resolution }} · sensor layer disabled{% endblocktrans %}</span></div>
<div class="map-wrap"><div id="event-map" class="map" data-h3-resolution="{{ h3_resolution }}" aria-label="{% trans "Interactive map of manual fireworks reports" %}"></div>
<aside class="legend" aria-label="{% trans "Map legend" %}"><h2>{% trans "Manual reports" %}</h2><div><span class="legend-dot"></span> {% trans "Report marker at H3-cell centre" %}</div><div><span class="legend-ring"></span> {% blocktrans with resolution=h3_resolution %}H3 cell (resolution {{ resolution }}){% endblocktrans %}</div><div><span class="legend-line"></span> {% trans "Saved compass direction" %}</div></aside>
</div>
</section>
{{ h3_cells|json_script:"h3-cells-data" }}
@@ -1,11 +1,24 @@
{% load i18n %}
<header class="fireworks-header">
<a class="fireworks-brand" href="{% url "fireworks_detect:fireworks" %}"><span class="brand-mark">✦</span> Sound Signal</a>
<div class="fireworks-header__controls">
<nav class="fireworks-nav" aria-label="Fireworks navigation">
<a href="{% url "fireworks_detect:fireworks" %}"{% if active_page == "analyse" %} aria-current="page"{% endif %}>Analyse</a>
<a href="{% url "fireworks_detect:map" %}"{% if active_page == "map" %} aria-current="page"{% endif %}>Map</a>
<a href="{% url "fireworks_detect:events" %}"{% if active_page == "events" %} aria-current="page"{% endif %}>Events</a>
<nav class="fireworks-nav" aria-label="{% trans "Fireworks navigation" %}">
<a href="{% url "fireworks_detect:fireworks" %}"{% if active_page == "analyse" %} aria-current="page"{% endif %}>{% trans "Analyse" %}</a>
<a href="{% url "fireworks_detect:map" %}"{% if active_page == "map" %} aria-current="page"{% endif %}>{% trans "Map" %}</a>
<a href="{% url "fireworks_detect:events" %}"{% if active_page == "events" %} aria-current="page"{% endif %}>{% trans "Events" %}</a>
</nav>
<button class="theme-toggle theme-toggle--inline" type="button" aria-label="Switch theme"></button>
{% if not request.user.is_authenticated %}
<form class="public-language" action="{% url 'set_anonymous_language' %}" method="post" style="display:flex;align-items:center;gap:.3rem;color:var(--muted,#aab9d8);font-size:.78rem">
{% csrf_token %}
<input type="hidden" name="next" value="{{ request.get_full_path }}">
<label for="public-language-choice">{% trans "Language" %}</label>
<select id="public-language-choice" name="language" style="border:1px solid var(--line,#2b3d68);border-radius:.5rem;padding:.4rem;color:inherit;background:transparent;font:inherit">
<option value="nl"{% if request.LANGUAGE_CODE == 'nl' %} selected{% endif %}>Nederlands</option>
<option value="en"{% if request.LANGUAGE_CODE == 'en' %} selected{% endif %}>English</option>
</select>
<button type="submit" style="border:1px solid var(--line,#2b3d68);border-radius:.5rem;padding:.4rem;color:inherit;background:transparent;font:inherit;cursor:pointer">OK</button>
</form>
{% endif %}
<button class="theme-toggle theme-toggle--inline" type="button" aria-label="{% trans "Switch theme" %}"></button>
</div>
</header>
@@ -1,7 +1,8 @@
{% load i18n %}
<div id="manual-submission" role="status">
{% if error %}
<strong>Could not report fireworks</strong><p>{{ error }}</p>
<strong>{% trans "Could not report fireworks" %}</strong><p>{{ error }}</p>
{% else %}
<strong>Report sent to Pending</strong><p>{{ pending.occurrences }} occurrence{{ pending.occurrences|pluralize }} reported at {{ pending.created_at|date:"H:i" }}.</p>
<strong>{% trans "Report sent to Pending" %}</strong><p>{% blocktrans count count=pending.occurrences with time=pending.created_at|date:"H:i" %}{{ count }} occurrence reported at {{ time }}.{% plural %}{{ count }} occurrences reported at {{ time }}.{% endblocktrans %}</p>
{% endif %}
</div>
@@ -1,30 +1,31 @@
{% load vite %}
{% load i18n vite %}
<!DOCTYPE html>
<html lang="en" data-theme="dark">
<html lang="{{ request.LANGUAGE_CODE|default:'en' }}" data-theme="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Signal map · Sound Signal</title>
<title>{% trans "Signal map · Sound Signal" %}</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css">
{% vite_asset "frontend/src/entries/map.js" %}
{% include "js_translations.html" %}
</head>
<body>
<main class="shell">
{% include "fireworks_detect/includes/navigation.html" with active_page="map" %}
<section class="headline" aria-labelledby="map-title">
<div><p class="kicker">Manual report intelligence</p><h1 id="map-title">Sound activity map.</h1></div>
<p>Reviewed manual reports with a captured location appear as their H3 cell, not their precise coordinates. Saved phone compass readings show the reported direction of the sound.</p>
<div><p class="kicker">{% trans "Manual report intelligence" %}</p><h1 id="map-title">{% trans "Sound activity map." %}</h1></div>
<p>{% trans "Reviewed manual reports with a captured location appear as their H3 cell, not their precise coordinates. Saved phone compass readings show the reported direction of the sound." %}</p>
</section>
<form class="filters" method="get" action="{% url 'fireworks_detect:map' %}" aria-label="Map filters">
<div class="filter"><label for="event-source">Source</label><select id="event-source" disabled><option selected>Manual reports</option><option>Sensor events — coming soon</option></select></div>
<div class="filter"><label for="range">Period</label><select id="range" name="range"><option value="7" {% if map_filters.range == "7" %}selected{% endif %}>Last 7 days</option><option value="14" {% if map_filters.range == "14" %}selected{% endif %}>Last 2 weeks</option><option value="30" {% if map_filters.range == "30" %}selected{% endif %}>Last 30 days</option><option value="all" {% if map_filters.range == "all" %}selected{% endif %}>All time</option><option value="custom" {% if map_filters.range == "custom" %}selected{% endif %}>Custom range</option></select></div>
<div class="filter"><label for="from-date">From</label><input id="from-date" name="from" type="date" value="{{ map_filters.date_from }}"></div>
<div class="filter"><label for="to-date">To</label><input id="to-date" name="to" type="date" value="{{ map_filters.date_to }}"></div>
<div class="filter"><label for="visual">Visual confirmation</label><select id="visual" name="visual"><option value="all" {% if map_filters.visual == "all" %}selected{% endif %}>Any report</option><option value="yes" {% if map_filters.visual == "yes" %}selected{% endif %}>Visually confirmed</option><option value="no" {% if map_filters.visual == "no" %}selected{% endif %}>Not visually confirmed</option></select></div>
<button class="filter-submit" type="submit">Apply filters</button>
<span class="map-tag">{{ mapped_event_count }} report{{ mapped_event_count|pluralize }}</span>
<form class="filters" method="get" action="{% url 'fireworks_detect:map' %}" aria-label="{% trans "Map filters" %}">
<div class="filter"><label for="event-source">{% trans "Source" %}</label><select id="event-source" disabled><option selected>{% trans "Manual reports" %}</option><option>{% trans "Sensor events — coming soon" %}</option></select></div>
<div class="filter"><label for="range">{% trans "Period" %}</label><select id="range" name="range"><option value="7" {% if map_filters.range == "7" %}selected{% endif %}>{% trans "Last 7 days" %}</option><option value="14" {% if map_filters.range == "14" %}selected{% endif %}>{% trans "Last 2 weeks" %}</option><option value="30" {% if map_filters.range == "30" %}selected{% endif %}>{% trans "Last 30 days" %}</option><option value="all" {% if map_filters.range == "all" %}selected{% endif %}>{% trans "All time" %}</option><option value="custom" {% if map_filters.range == "custom" %}selected{% endif %}>{% trans "Custom range" %}</option></select></div>
<div class="filter"><label for="from-date">{% trans "From" %}</label><input id="from-date" name="from" type="date" value="{{ map_filters.date_from }}"></div>
<div class="filter"><label for="to-date">{% trans "To" %}</label><input id="to-date" name="to" type="date" value="{{ map_filters.date_to }}"></div>
<div class="filter"><label for="visual">{% trans "Visual confirmation" %}</label><select id="visual" name="visual"><option value="all" {% if map_filters.visual == "all" %}selected{% endif %}>{% trans "Any report" %}</option><option value="yes" {% if map_filters.visual == "yes" %}selected{% endif %}>{% trans "Visually confirmed" %}</option><option value="no" {% if map_filters.visual == "no" %}selected{% endif %}>{% trans "Not visually confirmed" %}</option></select></div>
<button class="filter-submit" type="submit">{% trans "Apply filters" %}</button>
<span class="map-tag">{% blocktrans count count=mapped_event_count %}{{ count }} report{% plural %}{{ count }} reports{% endblocktrans %}</span>
</form>
{% include "fireworks_detect/includes/map_panel.html" %}
@@ -1,3 +1,4 @@
{% load i18n %}
<div class="review-submission" id="review-submission" role="status">
{% if error %}<div><strong>Could not submit this sample</strong><p>{{ error }}</p></div>{% else %}<div><strong>Sent to Pending</strong><p>{{ pending.original_filename }} is ready for administrator review.</p></div><a href="{% url 'fireworks_detect:events' %}">View events</a>{% endif %}
{% if error %}<div><strong>{% trans "Could not submit this sample" %}</strong><p>{{ error }}</p></div>{% else %}<div><strong>{% trans "Sent to Pending" %}</strong><p>{% blocktrans with filename=pending.original_filename %}{{ filename }} is ready for administrator review.{% endblocktrans %}</p></div><a href="{% url 'fireworks_detect:events' %}">{% trans "View events" %}</a>{% endif %}
</div>
+13 -13
View File
@@ -1,10 +1,10 @@
{% load vite %}
{% load i18n vite %}
<!DOCTYPE html>
<html lang="en" data-theme="dark">
<html lang="{{ request.LANGUAGE_CODE|default:'en' }}" data-theme="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sound Signal · Fireworks detection</title>
<title>{% trans "Sound Signal · Fireworks detection" %}</title>
<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.4/dist/htmx.min.js"></script>
{% vite_asset "frontend/src/entries/legacy-fireworks-home.js" %}
</head>
@@ -12,32 +12,32 @@
<main class="shell">
<div class="brand"><span class="brand-mark">✦</span> Sound Signal</div>
<section class="intro" aria-labelledby="page-title">
<p class="kicker">Audio event analysis</p>
<h1 id="page-title">See what your audio heard.</h1>
<p class="lede">Drop a recording to identify its most likely sounds. Firework-related signals are highlighted in amber; speech-related signals are marked in red for future privacy filtering.</p>
<p class="kicker">{% trans "Audio event analysis" %}</p>
<h1 id="page-title">{% trans "See what your audio heard." %}</h1>
<p class="lede">{% trans "Drop a recording to identify its most likely sounds. Firework-related signals are highlighted in amber; speech-related signals are marked in red for future privacy filtering." %}</p>
</section>
<section class="upload-card" aria-label="Upload audio for classification">
<section class="upload-card" aria-label="{% trans "Upload audio for classification" %}">
<form class="upload-form" action="{% url 'fireworks_detect:classify' %}" method="post" enctype="multipart/form-data" hx-post="{% url 'fireworks_detect:classify' %}" hx-target="#classification-results" hx-swap="innerHTML" hx-encoding="multipart/form-data" hx-indicator="#upload-indicator">
{% csrf_token %}
<label class="drop-zone" id="drop-zone">
<input class="file-input" id="audio-file" type="file" name="audio" accept="audio/*,.wav,.mp3,.m4a,.ogg,.flac,.aac,.opus" required>
<span>
<span class="upload-icon">↑</span>
<strong>Drop an audio file here</strong>
<span>or click to browse your device</span>
<strong>{% trans "Drop an audio file here" %}</strong>
<span>{% trans "or click to browse your device" %}</span>
</span>
<span class="file-name" id="file-name">No file selected</span>
<span class="file-name" id="file-name">{% trans "No file selected" %}</span>
</label>
<div class="form-footer">
<p class="file-note">WAV, MP3, M4A, OGG and more · 25 MiB maximum</p>
<button type="submit"><span class="spinner htmx-indicator" id="upload-indicator" aria-hidden="true"></span>Analyse audio</button>
<p class="file-note">{% trans "WAV, MP3, M4A, OGG and more · 25 MiB maximum" %}</p>
<button type="submit"><span class="spinner htmx-indicator" id="upload-indicator" aria-hidden="true"></span>{% trans "Analyse audio" %}</button>
</div>
</form>
<p id="upload-status" role="status" aria-live="polite"></p>
</section>
<section id="classification-results" aria-live="polite" aria-label="Classification results"></section>
<section id="classification-results" aria-live="polite" aria-label="{% trans "Classification results" %}"></section>
</main>
</body>
</html>