fix now card width

This commit is contained in:
Joren de Graaf
2026-10-14 18:17:27 +02:00
parent f68fb9e048
commit 7e22abe5d4
67 changed files with 1589 additions and 106 deletions
+105
View File
@@ -0,0 +1,105 @@
# Field notes: specification review and implementation
## Review decisions
The requested separation between recorded evidence and human context fits the
application. Inspection found these differences from the illustrative spec:
1. **Bursts are Event/PendingEvent records with occurrences >= 3**, not separate
incidents. The live browser listener has no server-side event until submission.
`FieldNoteContext` is a small, author-owned association record, with no incident
timestamps, count, audio or classification of its own. It holds a draft UUID and
later references the existing PendingEvent or Event. Multiple notes attach once
to that report rather than being copied across individual bangs.
2. **Pending manual ownership was session-based.** Note contexts preserve author
attribution across sessions without inventing ownership for old reports. New
draft tokens are signed, author-bound and expire after seven days. A submitted
token cannot be reused for another report; the UI rotates it on success. Late
note saves still follow the original report through moderation.
3. **The frontend uses custom SCSS, HTMX and existing theme tokens**, not Bootstrap.
These conventions are reused; no second CSS framework is introduced.
4. **There was no incident export pipeline or event merge UI.** Added CSV/JSON
note exports through one permission-filtered service. PDF export and event
regrouping interfaces remain outside this pass. A tested regrouping service
preserves note provenance for future merge operations.
5. **Corrections are new notes.** No edit/delete route or editable admin form is
provided. This keeps original text and entry timestamps unchanged. Verification
labels describe the author's stated assessment, not automated validation.
6. **Timezone follows Django's active timezone**, currently Europe/Amsterdam;
there is no per-user timezone setting. Datetimes are stored timezone-aware,
with the timezone shown beside entry/observation times. Adding a user timezone
preference later can use the same fields.
## Privacy and permissions
- Notes default to private, unknown source and unverified. Only content is required.
- An authenticated author can read/create their own notes. Reportable notes are
still not public and do not become verified.
- Approved events are already public; authenticated users may add their own notes
to them. Pending targets require existing session ownership, sensor ownership,
a note context owned by that user, or staff `view_pendingevent` permission.
- `view_all_fieldnotes` explicitly allows reading other authors' private notes.
Staff status alone does not. Django superusers have this permission.
- `export_reportable_fieldnotes` explicitly allows exporting other authors'
reportable notes. Without it, exports contain only the caller's reportable notes.
**Private notes are excluded even for superusers.** Read-all permission does not
imply export-all permission.
- Every export starts with `field_notes.reportable_notes(user)`. Future PDF/API
reporting must use this service, rather than `visible_to()` or raw relations.
- CSV escapes formula-like user values; HTML renders escaped plain text and keeps
line breaks. Public event/map responses do not serialize note data.
- Link operations are author-only, POST/CSRF-protected, and only accept an existing
approved event. Existing linked notes cannot be silently reparented through the
user endpoint. Each standalone observation context can hold several live notes;
linking it moves that observation's notes together.
- Admin is read-only and uses the same visibility boundary. Association history
is similarly scoped. ORM `save()` rejects note/history edits; direct SQL or
`QuerySet.update()` is not an application editing interface and must not be used
to bypass this policy.
## Lifecycle and interfaces
- The dashboard's Add field note form is adjacent to quick reporting and updates
only its own HTMX region, leaving listener/audio controls mounted and running.
- Submission binds the draft context to Pending Review. Approval atomically moves
contexts to the approved Event and records the moderator (or system/null actor
for non-request approvals). Notes retain their original entry timestamps.
- Denial/deletion clears the foreign key but preserves the note and its historical
target ID. The observation remains available in My field notes.
- `regroup_event_notes(actor, source, target)` requires staff, `change_event` and
`view_all_fieldnotes`. Existing or future merge code must call it inside its
transaction before deleting the source. It moves associations without copying
notes and records previous/current event IDs. No automatic grouping is added.
- Historical event details show only visible notes and counts. Direct event pages
and the archive now have normal links for no-JavaScript access.
- `/fireworks/notes/` creates standalone observations and lists accessible notes;
event/pending filters provide contextual forms. `/fireworks/notes/export/json/`
and `/fireworks/notes/export/csv/` export authorised reportable notes, optionally
filtered by approved event ID.
- Standard POST forms redirect after saving. HTMX forms return their own updated
region; validation responses intentionally use HTTP 200 so HTMX renders errors.
- Occurrence and entry dates are displayed separately. New information is appended
chronologically; author-supplied observed time does not reorder entry history.
## Validation and deployment
Migration `0014` adds three tables, constraints and an author/time index. It does
not rewrite existing event data. Apply with `python manage.py migrate` after
updating the application; build assets with the existing `npm run build` command.
No firmware changes or version bump are needed for this Django-only feature.
Automated tests cover defaults, escaping, anonymous/cross-user access, explicit
staff permissions, private export exclusion (including superuser), source and
uncertainty preservation, observed/entry timestamps, append-only saves, invalid
forms, active draft binding, approval, late saves, stale-token rejection,
standalone linking, regrouping and denied-report retention.
Browser verification uses the actual Django application with an isolated SQLite
DB under `/tmp`. It covers HTMX note saves during a **synthetic browser audio
stream**, listener continuity, report binding/token rotation, historical notes,
mobile/desktop layouts, dark/light appearance, accessibility labels, exports and
standard form submission in a JavaScript-disabled browser context. This is not a
microphone/hardware validation and does not claim classification accuracy.
Out of scope: attachments, CCTV files, witness identity management, PDF generation,
new incident/merge interfaces, full timeline redesign, or changing detection logic.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+45 -1
View File
@@ -134,7 +134,7 @@ class PendingEventAdmin(ClassificationAdmin):
def approve_selected(self, request, queryset):
approved = 0
for pending in queryset:
pending.approve()
pending.approve(actor=request.user)
approved += 1
self.message_user(request, ngettext("%(count)d sample approved and moved to Events.", "%(count)d samples approved and moved to Events.", approved) % {"count": approved}, messages.SUCCESS)
@@ -198,3 +198,47 @@ class SensorAdmin(admin.ModelAdmin):
sensor = queryset.get()
token = sensor.issue_token()
self.message_user(request, format_html(_("Copy this token now; it is not stored and will not be shown again: <code>{}</code>"), token), messages.WARNING)
from .models import FieldNote, FieldNoteAssociation
@admin.register(FieldNote)
class FieldNoteAdmin(admin.ModelAdmin):
list_display = ("id", "author", "category", "source_type", "verification_status", "visibility", "created_at")
list_filter = ("visibility", "category", "source_type", "verification_status")
readonly_fields = tuple(f.name for f in FieldNote._meta.fields)
search_fields = ("content",)
def get_queryset(self, request):
return super().get_queryset(request).visible_to(request.user).select_related("author", "context")
def has_add_permission(self, request):
return False
def has_change_permission(self, request, obj=None):
return False
def has_delete_permission(self, request, obj=None):
return False
@admin.register(FieldNoteAssociation)
class FieldNoteAssociationAdmin(admin.ModelAdmin):
list_display = ("context", "actor", "reason", "created_at")
readonly_fields = tuple(f.name for f in FieldNoteAssociation._meta.fields)
def get_queryset(self, request):
qs = super().get_queryset(request)
if request.user.has_perm("fireworks_detect.view_all_fieldnotes"):
return qs
return qs.filter(context__author=request.user)
def has_add_permission(self, request):
return False
def has_change_permission(self, request, obj=None):
return False
def has_delete_permission(self, request, obj=None):
return False
+100
View File
@@ -0,0 +1,100 @@
"""Central access checks and association/reporting services for field notes."""
import uuid
from django.contrib.auth import get_user_model
from django.core import signing
from django.core.exceptions import PermissionDenied
from django.db import transaction
from django.db.models import Q
from django.http import Http404
from .models import Event, PendingEvent, FieldNote, FieldNoteContext, FieldNoteAssociation
def draft_token(user):
if not user.is_authenticated:
return ""
return signing.dumps({"author": user.pk, "id": str(uuid.uuid4())}, salt="field-notes")
def token_id(user, token):
try:
data = signing.loads(token, salt="field-notes", max_age=7 * 86400)
if data["author"] != user.pk:
raise ValueError
return uuid.UUID(data["id"])
except (signing.BadSignature, ValueError, KeyError, TypeError):
raise PermissionDenied("Invalid or expired note context. Reload the reporting page.")
def accessible_pending(user, session_ids=()):
if not user.is_authenticated:
return PendingEvent.objects.none()
if user.is_staff and user.has_perm("fireworks_detect.view_pendingevent"):
return PendingEvent.objects.all()
return PendingEvent.objects.filter(Q(note_contexts__author=user) | Q(sensor__owner=user) | Q(pk__in=session_ids)).distinct()
def target_snapshot(context):
if context.event_id:
return {"kind": "event", "id": context.event_id}
if context.pending_event_id:
return {"kind": "pending", "id": context.pending_event_id}
return {}
def associate(context, *, event=None, pending=None, actor=None, reason):
previous = target_snapshot(context)
context.event = event
context.pending_event = pending
context.full_clean()
context.save(update_fields=["event", "pending_event"])
FieldNoteAssociation.objects.create(context=context, actor=actor, previous=previous,
target=target_snapshot(context), reason=reason)
@transaction.atomic
def context_for_token(user, token):
# Serialize draft-note creation and report binding for the same author.
get_user_model().objects.select_for_update().get(pk=user.pk)
context, _ = FieldNoteContext.objects.get_or_create(id=token_id(user, token), defaults={"author": user})
if context.author_id != user.pk:
raise PermissionDenied
return context
@transaction.atomic
def bind_report(user, token, pending):
if not user.is_authenticated or not token:
return
context = context_for_token(user, token)
if context.event_id or context.pending_event_id:
raise PermissionDenied("This note context already belongs to a report. Reload before reporting again.")
associate(context, pending=pending, actor=user, reason="submission")
@transaction.atomic
def link_standalone(user, context_id, event):
# Approved events are publicly accessible in the existing application.
context = FieldNoteContext.objects.select_for_update().filter(pk=context_id, author=user).first()
if not context or context.event_id or context.pending_event_id:
raise Http404
associate(context, event=event, actor=user, reason="linked")
return context
@transaction.atomic
def regroup_event_notes(user, source, target):
"""Hook for future event-merging code; does not modify detection records."""
if not (user.is_staff and user.has_perm("fireworks_detect.change_event") and
user.has_perm("fireworks_detect.view_all_fieldnotes")):
raise PermissionDenied
if source.pk == target.pk:
return
for context in FieldNoteContext.objects.select_for_update().filter(event=source):
associate(context, event=target, actor=user, reason="regrouped")
def reportable_notes(user):
"""All exports, including future PDF reports, must start with this queryset."""
return FieldNote.objects.reportable_to(user).select_related("author", "context")
+33
View File
@@ -0,0 +1,33 @@
from django import forms
from django.utils.translation import gettext_lazy as _
from .models import FieldNote
class FieldNoteForm(forms.ModelForm):
class Meta:
model = FieldNote
fields = ["content", "category", "source_type", "verification_status", "visibility", "observed_at"]
widgets = {
"content": forms.Textarea(attrs={"rows": 3, "placeholder": _("What did you observe or learn?")}),
"observed_at": forms.DateTimeInput(format="%Y-%m-%dT%H:%M", attrs={"type": "datetime-local"}),
}
labels = {"content": _("Note"), "observed_at": _("Observed at (optional)"),
"category": _("Category"), "source_type": _("Source"),
"verification_status": _("Verification status"), "visibility": _("Visibility")}
help_texts = {
"visibility": _("Private by default. Reportable permits authorised export; it does not mean verified or public."),
"observed_at": _("Local time (Europe/Amsterdam). The entry time is recorded separately."),
}
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
for name in self.fields:
if name != "content":
self.fields[name].required = False
def clean(self):
data = super().clean()
for name in ("category", "source_type", "verification_status", "visibility"):
if not data.get(name):
data[name] = FieldNote._meta.get_field(name).get_default()
return data
@@ -0,0 +1,86 @@
# Generated by Django 6.1.1 on 2026-10-13 07:57
import django.db.models.deletion
import uuid
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fireworks_detect', '0013_event_submitted_at'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='FieldNoteContext',
fields=[
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('created_at', models.DateTimeField(auto_now_add=True)),
('author', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
('event', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='note_contexts', to='fireworks_detect.event')),
('pending_event', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='note_contexts', to='fireworks_detect.pendingevent')),
],
),
migrations.CreateModel(
name='FieldNoteAssociation',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('previous', models.JSONField(default=dict)),
('target', models.JSONField(default=dict)),
('reason', models.CharField(max_length=32)),
('created_at', models.DateTimeField(auto_now_add=True)),
('actor', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
('context', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='associations', to='fireworks_detect.fieldnotecontext')),
],
options={
'ordering': ['created_at', 'pk'],
},
),
migrations.CreateModel(
name='FieldNote',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('content', models.TextField(max_length=10000)),
('category', models.CharField(choices=[('general', 'General'), ('witness', 'Witness'), ('people_vehicles', 'People / vehicles'), ('cctv', 'CCTV'), ('location_direction', 'Location / direction'), ('follow_up', 'Follow-up'), ('other', 'Other')], default='general', max_length=32)),
('source_type', models.CharField(choices=[('first_hand', 'First-hand'), ('second_hand', 'Second-hand'), ('unknown', 'Other / unknown')], default='unknown', max_length=24)),
('verification_status', models.CharField(choices=[('unverified', 'Unverified'), ('corroborated', 'Corroborated'), ('disputed', 'Disputed')], default='unverified', max_length=24)),
('visibility', models.CharField(choices=[('private', 'Private'), ('reportable', 'Reportable')], default='private', max_length=16)),
('observed_at', models.DateTimeField(blank=True, null=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('author', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='field_notes', to=settings.AUTH_USER_MODEL)),
('context', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='notes', to='fireworks_detect.fieldnotecontext')),
],
options={
'ordering': ['created_at', 'pk'],
'permissions': [('view_all_fieldnotes', 'Read all private field notes'), ('export_reportable_fieldnotes', 'Export reportable field notes from all authors')],
},
),
migrations.AddConstraint(
model_name='fieldnotecontext',
constraint=models.CheckConstraint(condition=models.Q(('event__isnull', False), ('pending_event__isnull', False), _negated=True), name='note_context_one_target'),
),
migrations.AddIndex(
model_name='fieldnote',
index=models.Index(fields=['author', 'created_at'], name='fieldnote_author_time'),
),
migrations.AddConstraint(
model_name='fieldnote',
constraint=models.CheckConstraint(condition=models.Q(('content', ''), _negated=True), name='fieldnote_nonempty'),
),
migrations.AddConstraint(
model_name='fieldnote',
constraint=models.CheckConstraint(condition=models.Q(('visibility__in', ['private', 'reportable'])), name='fieldnote_visibility'),
),
migrations.AddConstraint(
model_name='fieldnote',
constraint=models.CheckConstraint(condition=models.Q(('source_type__in', ['first_hand', 'second_hand', 'unknown'])), name='fieldnote_source'),
),
migrations.AddConstraint(
model_name='fieldnote',
constraint=models.CheckConstraint(condition=models.Q(('verification_status__in', ['unverified', 'corroborated', 'disputed'])), name='fieldnote_verification'),
),
]
+118 -1
View File
@@ -265,7 +265,7 @@ class PendingEvent(ClassifiedAudio):
verbose_name_plural = _("Pending")
@transaction.atomic
def approve(self):
def approve(self, actor=None):
event = Event.objects.create(
submitted_at=self.created_at,
audio_file=self.audio_file.name,
@@ -289,6 +289,9 @@ class PendingEvent(ClassifiedAudio):
direction_accuracy_degrees=self.direction_accuracy_degrees,
direction_source=self.direction_source,
)
from .field_notes import associate
for context in self.note_contexts.select_for_update():
associate(context, event=event, actor=actor, reason="approved")
self.delete()
return event
@@ -334,3 +337,117 @@ class SensorSubmission(models.Model):
class Meta:
constraints = [models.UniqueConstraint(fields=["sensor", "event_id"], name="unique_sensor_event_id")]
class FieldNoteContext(models.Model):
"""An author's note association, including drafts before a report exists.
This stores no detection/incident data; Event/PendingEvent remain canonical.
"""
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
author = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.PROTECT)
event = models.ForeignKey(Event, null=True, blank=True, on_delete=models.SET_NULL, related_name="note_contexts")
pending_event = models.ForeignKey(PendingEvent, null=True, blank=True, on_delete=models.SET_NULL, related_name="note_contexts")
created_at = models.DateTimeField(auto_now_add=True)
class Meta:
constraints = [models.CheckConstraint(condition=~(models.Q(event__isnull=False) & models.Q(pending_event__isnull=False)), name="note_context_one_target")]
class FieldNoteQuerySet(models.QuerySet):
def visible_to(self, user):
if not user.is_authenticated or not user.is_active:
return self.none()
if user.is_active and user.has_perm("fireworks_detect.view_all_fieldnotes"):
return self
return self.filter(author=user)
def reportable_to(self, user):
if not user.is_authenticated or not user.is_active:
return self.none()
notes = self.filter(visibility="reportable")
if user.is_active and user.has_perm("fireworks_detect.export_reportable_fieldnotes"):
return notes
return notes.filter(author=user)
class FieldNote(models.Model):
class Category(models.TextChoices):
GENERAL = "general", _("General")
WITNESS = "witness", _("Witness")
PEOPLE = "people_vehicles", _("People / vehicles")
CCTV = "cctv", _("CCTV")
LOCATION = "location_direction", _("Location / direction")
FOLLOW_UP = "follow_up", _("Follow-up")
OTHER = "other", _("Other")
class Source(models.TextChoices):
FIRST_HAND = "first_hand", _("First-hand")
SECOND_HAND = "second_hand", _("Second-hand")
UNKNOWN = "unknown", _("Other / unknown")
class Verification(models.TextChoices):
UNVERIFIED = "unverified", _("Unverified")
CORROBORATED = "corroborated", _("Corroborated")
DISPUTED = "disputed", _("Disputed")
class Visibility(models.TextChoices):
PRIVATE = "private", _("Private")
REPORTABLE = "reportable", _("Reportable")
author = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.PROTECT, related_name="field_notes")
context = models.ForeignKey(FieldNoteContext, on_delete=models.PROTECT, related_name="notes")
content = models.TextField(max_length=10000)
category = models.CharField(max_length=32, choices=Category.choices, default=Category.GENERAL)
source_type = models.CharField(max_length=24, choices=Source.choices, default=Source.UNKNOWN)
verification_status = models.CharField(max_length=24, choices=Verification.choices, default=Verification.UNVERIFIED)
visibility = models.CharField(max_length=16, choices=Visibility.choices, default=Visibility.PRIVATE)
observed_at = models.DateTimeField(null=True, blank=True)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
objects = FieldNoteQuerySet.as_manager()
class Meta:
ordering = ["created_at", "pk"]
indexes = [models.Index(fields=["author", "created_at"], name="fieldnote_author_time")]
permissions = [
("view_all_fieldnotes", "Read all private field notes"),
("export_reportable_fieldnotes", "Export reportable field notes from all authors"),
]
constraints = [
models.CheckConstraint(condition=~models.Q(content=""), name="fieldnote_nonempty"),
models.CheckConstraint(condition=models.Q(visibility__in=["private", "reportable"]), name="fieldnote_visibility"),
models.CheckConstraint(condition=models.Q(source_type__in=["first_hand", "second_hand", "unknown"]), name="fieldnote_source"),
models.CheckConstraint(condition=models.Q(verification_status__in=["unverified", "corroborated", "disputed"]), name="fieldnote_verification"),
]
def clean(self):
super().clean()
if not self.content.strip():
raise ValidationError({"content": _("Enter a note.")})
if self.context_id and self.author_id != self.context.author_id:
raise ValidationError(_("The note and its context must have the same author."))
def save(self, *args, **kwargs):
if not self._state.adding:
raise ValidationError(_("Field notes are append-only. Add a follow-up to correct an earlier note."))
self.full_clean()
return super().save(*args, **kwargs)
class FieldNoteAssociation(models.Model):
"""Immutable provenance retained even when the original event is deleted."""
context = models.ForeignKey(FieldNoteContext, on_delete=models.PROTECT, related_name="associations")
actor = models.ForeignKey(settings.AUTH_USER_MODEL, null=True, on_delete=models.SET_NULL)
previous = models.JSONField(default=dict)
target = models.JSONField(default=dict)
reason = models.CharField(max_length=32)
created_at = models.DateTimeField(auto_now_add=True)
class Meta:
ordering = ["created_at", "pk"]
def save(self, *args, **kwargs):
if not self._state.adding:
raise ValidationError("Association history is append-only.")
return super().save(*args, **kwargs)
+126
View File
@@ -0,0 +1,126 @@
import csv
import json
from urllib.parse import urlencode
from django.contrib.auth.decorators import login_required
from django.db import transaction
from django.http import Http404, HttpResponse, JsonResponse
from django.shortcuts import get_object_or_404, redirect, render
from django.urls import reverse
from django.views.decorators.cache import never_cache
from django.views.decorators.http import require_http_methods
from .field_notes import accessible_pending, associate, context_for_token, link_standalone, reportable_notes, token_id
from .forms import FieldNoteForm
from .models import Event, FieldNote, FieldNoteContext
def panel_context(request, params=None):
params = params if params is not None else request.GET
selected = [(k, params.get(k)) for k in ("event", "pending", "token") if params.get(k)]
if len(selected) > 1:
raise Http404
notes = FieldNote.objects.visible_to(request.user).select_related("author", "context__event", "context__pending_event").prefetch_related("context__associations")
target = None
kind, value = selected[0] if selected else ("", "")
try:
if kind == "event":
target = get_object_or_404(Event, pk=int(value))
notes = notes.filter(context__event=target)
elif kind == "pending":
target = get_object_or_404(accessible_pending(request.user, request.session.get("manual_pending_ids", [])), pk=int(value))
notes = notes.filter(context__pending_event=target)
elif kind == "token":
key = token_id(request.user, value)
notes = notes.filter(context_id=key)
except (ValueError, TypeError):
raise Http404
return {"field_notes": notes, "note_count": notes.count(), "note_form": FieldNoteForm(),
"note_kind": kind, "note_value": value, "note_target": target,
"note_panel_id": "live-field-notes" if kind == "token" else "field-notes",
"note_query": urlencode({kind: value}) if kind else "",
"note_events": Event.objects.all() if not kind else (),
"note_token": value if kind == "token" else ""}
@login_required
@never_cache
@require_http_methods(["GET", "POST"])
def notes(request):
params = request.POST if request.method == "POST" else request.GET
context = panel_context(request, params)
if request.method == "POST":
form = FieldNoteForm(request.POST)
if form.is_valid():
with transaction.atomic():
kind = context["note_kind"]
if kind == "token":
owner_context = context_for_token(request.user, context["note_value"])
else:
owner_context = FieldNoteContext.objects.create(author=request.user)
if kind:
associate(owner_context, event=context["note_target"] if kind == "event" else None,
pending=context["note_target"] if kind == "pending" else None,
actor=request.user, reason="created")
note = form.save(commit=False)
note.author = request.user
note.context = owner_context
note.save()
if request.headers.get("HX-Request") != "true":
return redirect(reverse("fireworks_detect:field_notes") + ("?" + context["note_query"] if context["note_query"] else ""))
context = panel_context(request, params)
context["note_saved"] = True
else:
context["note_form"] = form
# Invalid HTMX forms deliberately return 200 so HTMX renders field errors.
template = "fireworks_detect/notes/panel.html" if request.headers.get("HX-Request") == "true" else "fireworks_detect/notes/page.html"
return render(request, template, context)
@login_required
@never_cache
@require_http_methods(["POST"])
def link_note(request, context_id):
try:
event = get_object_or_404(Event, pk=int(request.POST.get("event", "")))
except (ValueError, TypeError):
raise Http404
link_standalone(request.user, context_id, event)
return redirect("fireworks_detect:field_notes")
@login_required
@never_cache
@require_http_methods(["GET"])
def export_notes(request, format):
notes = reportable_notes(request.user).prefetch_related("context__associations")
if request.GET.get("event"):
try:
event = get_object_or_404(Event, pk=int(request.GET["event"]))
except (ValueError, TypeError):
raise Http404
notes = notes.filter(context__event=event)
rows = [{"id": n.pk, "author": n.author.get_username(), "event_id": n.context.event_id,
"pending_event_id": n.context.pending_event_id, "content": n.content,
"category": n.category, "source_type": n.source_type,
"verification_status": n.verification_status, "visibility": n.visibility,
"observed_at": n.observed_at.isoformat() if n.observed_at else None,
"created_at": n.created_at.isoformat(), "updated_at": n.updated_at.isoformat(),
"association_history": [{"previous": a.previous, "target": a.target, "reason": a.reason,
"created_at": a.created_at.isoformat()} for a in n.context.associations.all()]}
for n in notes]
if format == "json":
response = JsonResponse({"notes": rows})
elif format == "csv":
response = HttpResponse(content_type="text/csv; charset=utf-8")
fields = ["id", "author", "event_id", "pending_event_id", "content", "category", "source_type", "verification_status", "visibility", "observed_at", "created_at", "updated_at", "association_history"]
writer = csv.DictWriter(response, fieldnames=fields)
writer.writeheader()
for row in rows:
row["association_history"] = json.dumps(row["association_history"])
# Prevent spreadsheet formula execution from user-authored text.
writer.writerow({k: "'" + v if isinstance(v, str) and v.lstrip().startswith(("=", "+", "-", "@")) else v for k, v in row.items()})
else:
raise Http404
response["Content-Disposition"] = f'attachment; filename="boomcast-field-notes.{format}"'
return response
@@ -25,6 +25,7 @@
<section class="dashboard-section" aria-label="{% trans "Quick fireworks report" %}">
<div class="dashboard-report">
{% include "fireworks_detect/includes/manual_report_form.html" %}
{% if user.is_authenticated %}{% include "fireworks_detect/notes/panel.html" %}{% else %}<p><a href="{% url 'login' %}?next=/">{% trans "Sign in to add private field notes" %}</a></p>{% endif %}
</div>
</section>
@@ -30,3 +30,5 @@
<p class="empty">{% trans "No peak events returned." %}</p>
{% endfor %}
{% endif %}
{% if request.user.is_authenticated %}{% include "fireworks_detect/notes/panel.html" %}{% else %}<p><a href="{% url 'login' %}?next={{ request.path|urlencode }}">{% trans "Sign in to add private field notes" %}</a></p>{% endif %}
@@ -0,0 +1,2 @@
{% 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 "Event · BoomCast" %}</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" %}<section class="panel">{% include "fireworks_detect/event_detail.html" %}</section></main></body></html>
@@ -1,2 +1,2 @@
{% 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>
<!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">{% include "fireworks_detect/events_list.html" %}</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,7 +1,7 @@
{% 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">
<a href="{% url 'fireworks_detect:event_detail' event.id %}" 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">{% trans "Manual report" %}</span>
@@ -14,7 +14,7 @@
{% endif %}
</span>
<span class="badge">{% if event.source_type == "manual" %}{% trans "Manual" %} →{% else %}{{ event.primary_score }} →{% endif %}</span>
</button>
</a>
{% endfor %}
{% else %}
<p class="empty">{% trans "No approved events yet. Submit a classification, then approve it from the Pending page in admin." %}</p>
@@ -10,22 +10,32 @@
<time id="manual-report-time" class="report-clock__time" aria-label="{% trans 'Now' %}">
<span id="report-clock-hours" aria-hidden="true">--</span><span class="report-clock__colon" aria-hidden="true">:</span><span id="report-clock-minutes" aria-hidden="true">--</span>
</time>
<span class="report-clock__now" aria-hidden="true"><span class="report-clock__dot"></span>{% trans "Now" %}</span>
<div class="report-clock__controls">
<span id="report-clock-mode" class="report-clock__now"><span class="report-clock__dot" aria-hidden="true"></span><span id="report-clock-mode-label">{% trans "Now" %}</span></span>
<button id="report-clock-edit" class="report-clock__edit" type="button" aria-label="{% trans 'Edit report time' %}" aria-controls="report-clock-editor" aria-expanded="false" title="{% trans 'Edit report time' %}"><span aria-hidden="true">✎</span></button>
</div>
</div>
<span id="report-clock-date" class="report-clock__date" hidden></span>
<button id="report-clock-reset" class="report-clock__reset" type="button" hidden>{% trans "Use now" %}</button>
<div id="report-clock-editor" class="report-clock__editor" hidden>
<div class="report-clock__fields">
<div><label for="report-clock-draft-date">{% trans "Date" %}</label><input id="report-clock-draft-date" type="date" aria-describedby="report-clock-error"></div>
<div><label for="report-clock-draft-time">{% trans "Time (24-hour)" %}</label><input id="report-clock-draft-time" type="text" inputmode="numeric" autocomplete="off" placeholder="14:30" maxlength="5" aria-describedby="report-clock-error"></div>
</div>
<p id="report-clock-error" class="report-clock__error" role="alert" hidden></p>
<label class="manual-report__check"><input id="manual-time-approximate" name="time_approximate" type="checkbox" form="manual-report-form" disabled> {% trans "Time is approximate" %}</label>
<div class="report-clock__actions"><button id="report-clock-apply" type="button">{% trans "Apply" %}</button><button id="report-clock-cancel" type="button">{% trans "Cancel" %}</button></div>
</div>
</div>
</header>
<form id="manual-report-form" action="{% url "fireworks_detect:submit_manual_pending" %}" method="post" enctype="multipart/form-data">
{% csrf_token %}
{% if note_token %}<input type="hidden" name="field_note_context" id="manual-note-context" value="{{ note_token }}">{% endif %}
<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">
<div class="manual-report__occurrence">
<label class="manual-report__label" for="manual-occurred-at">{% trans "When did it happen?" %}</label>
<div class="manual-report__time-row"><input id="manual-occurred-at" name="occurred_at" type="datetime-local" aria-describedby="manual-time-help"><button id="manual-use-now" type="button">{% trans "Use now" %}</button></div>
<label class="manual-report__check"><input id="manual-time-approximate" name="time_approximate" type="checkbox"> {% trans "Time is approximate" %}</label>
<small id="manual-time-help">{% trans "Leave the time empty to use the submission time." %}</small>
</div>
<input id="manual-occurred-at" name="occurred_at" type="hidden">
<div class="manual-report__primary">
<div class="manual-report__quantity">
<label class="manual-report__label" for="manual-occurrences">{% trans "How many times did you hear it?" %}</label>
@@ -8,6 +8,7 @@
<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>
{% if request.user.is_authenticated %}
<a href="{% url 'fireworks_detect:field_notes' %}">{% trans "Field notes" %}</a>
<form action="{% url 'logout' %}" method="post">
{% csrf_token %}
<button type="submit">{% trans "Sign out" %}</button>
@@ -1,5 +1,5 @@
{% load i18n %}
<div id="manual-submission" class="manual-submission{% if error %} manual-submission--error{% else %} manual-submission--success{% endif %}" role="status" data-result="{% if error %}error{% else %}success{% endif %}">
<div id="manual-submission" class="manual-submission{% if error %} manual-submission--error{% else %} manual-submission--success{% endif %}" role="status" data-next-note-token="{{ next_note_token }}" data-result="{% if error %}error{% else %}success{% endif %}">
{% if error %}
<span class="manual-submission__icon" aria-hidden="true">!</span>
<strong>{% trans "Could not report fireworks" %}</strong>
@@ -16,6 +16,7 @@
<p>{% if pending.is_burst %}{% trans "Burst Event" %}{% else %}{% trans "Ordinary report" %}{% endif %} · {% trans "Submitted" %} {{ pending.created_at|date:"j M Y, H:i" }}</p>
{% if pending.is_burst %}<p>{% trans "Duration" %}: {% if pending.observation_duration_minutes %}{{ pending.observation_duration_minutes }} {% trans "minutes (estimated)" %}{% else %}{% trans "Unknown" %}{% endif %}</p>
<p>{% trans "Intensity" %}: {% if pending.burst_intensity %}{{ pending.burst_intensity_display }} ({{ pending.bangs_per_15_minutes|floatformat:1 }} {% trans "bangs per 15 minutes" %}){% else %}{% trans "Not rated" %}{% endif %}</p>{% endif %}
{% if request.user.is_authenticated %}<p><a href="{% url 'fireworks_detect:field_notes' %}?pending={{ pending.pk }}">{% trans "Add or review field notes for this report" %}</a></p>{% endif %}
{% if editable %}<form class="manual-submission__edit" method="post" action="{% url 'fireworks_detect:update_manual_pending' pending.pk %}" hx-post="{% url 'fireworks_detect:update_manual_pending' pending.pk %}" hx-target="#manual-submission" hx-swap="outerHTML">
{% csrf_token %}
<label for="manual-edit-count">{% trans "Correct bang count" %}</label>
@@ -0,0 +1,2 @@
{% 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 "Field notes · BoomCast" %}</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" %}<section class="panel">{% include "fireworks_detect/notes/panel.html" %}<p>{% trans "Exports include only reportable notes you are authorised to export. Private notes are always excluded." %}</p><a href="{% url 'fireworks_detect:export_field_notes' 'json' %}">JSON</a> · <a href="{% url 'fireworks_detect:export_field_notes' 'csv' %}">CSV</a></section></main></body></html>
@@ -0,0 +1,38 @@
{% load i18n tz %}
<section class="field-notes" id="{{ note_panel_id|default:'live-field-notes' }}" aria-label="{% trans 'Field notes' %}">
<h2>{% trans "Field notes" %} <span class="field-notes__count">({{ note_count|default:0 }})</span></h2>
<p>{% trans "Human context, separate from detection evidence. Notes are private by default. Add a follow-up to correct an earlier entry." %}</p>
{% if note_target %}<p>{% trans "Report" %} #{{ note_target.pk }} · {{ note_target.occurrences }} {% trans "bangs" %}</p>{% endif %}
{% if note_saved %}<p role="status">{% trans "Field note saved." %}</p>{% endif %}
<details {% if note_form.errors %}open{% endif %}>
<summary>{% trans "Add field note" %}</summary>
<form method="post" action="{% url 'fireworks_detect:field_notes' %}" hx-post="{% url 'fireworks_detect:field_notes' %}" hx-target="closest .field-notes" hx-swap="outerHTML">
{% csrf_token %}
{% if note_token %}<input type="hidden" name="token" value="{{ note_token }}">{% elif note_kind %}<input type="hidden" name="{{ note_kind }}" value="{{ note_value }}">{% endif %}
{{ note_form.non_field_errors }}
<div class="field-notes__field">{{ note_form.content.label_tag }}{{ note_form.content }}{{ note_form.content.errors }}</div>
<details {% if note_form.errors %}open{% endif %}><summary>{% trans "Optional details" %}</summary>
<div class="field-notes__fields">
{% for field in note_form %}{% if field.name != 'content' %}<div class="field-notes__field">{{ field.label_tag }}{{ field }}{% if field.help_text %}<small id="{{ field.auto_id }}_helptext">{{ field.help_text }}</small>{% endif %}{{ field.errors }}</div>{% endif %}{% endfor %}
</div>
</details>
<button type="submit">{% trans "Save field note" %}</button>
</form>
</details>
<ol class="field-notes__timeline">
{% for note in field_notes %}
<li>
<p class="field-notes__meta">{{ note.get_category_display }} · {{ note.author.get_username }} · {{ note.get_visibility_display }}</p>
<p class="field-notes__meta">{{ note.get_source_type_display }} · {{ note.get_verification_status_display }}</p>
<p class="field-notes__content">{{ note.content }}</p>
<p class="field-notes__meta">{% trans "Entered" %}: <time datetime="{{ note.created_at|date:'c' }}">{{ note.created_at|localtime|date:"j M Y, H:i T" }}</time>{% if note.observed_at %}<br>{% trans "Observed" %}: <time datetime="{{ note.observed_at|date:'c' }}">{{ note.observed_at|localtime|date:"j M Y, H:i T" }}</time>{% endif %}</p>
{% if note.context.event_id %}<a href="{% url 'fireworks_detect:event_detail' note.context.event_id %}">{% trans "Event" %} #{{ note.context.event_id }}</a>{% elif note.context.pending_event_id %}<a href="{% url 'fireworks_detect:field_notes' %}?pending={{ note.context.pending_event_id }}">{% trans "Pending report" %} #{{ note.context.pending_event_id }}</a>{% else %}<span>{% if note_token %}{% trans "Current observation — not yet submitted" %}{% else %}{% trans "Standalone observation" %}{% endif %}</span>{% endif %}
{% if note.context.associations.all %}<details><summary>{% trans "Association history" %}</summary><ul>{% for change in note.context.associations.all %}<li>{{ change.created_at|localtime|date:"j M Y, H:i" }} · {{ change.reason }} · {{ change.previous.kind|default:"standalone" }} {{ change.previous.id|default:"" }} → {{ change.target.kind }} {{ change.target.id }}</li>{% endfor %}</ul></details>{% endif %}
{% if not note_kind and not note.context.event_id and not note.context.pending_event_id and note.author_id == request.user.pk %}
<form method="post" action="{% url 'fireworks_detect:link_field_note' note.context_id %}">{% csrf_token %}<label for="link-{{ note.pk }}">{% trans "Link to an approved event" %}</label><select name="event" id="link-{{ note.pk }}" required><option value="">{% trans "Choose an event" %}</option>{% for item in note_events %}<option value="{{ item.pk }}">#{{ item.pk }} · {{ item.captured_at|default:item.created_at|date:"j M Y, H:i" }} · {{ item.occurrences }} {% trans "bangs" %}</option>{% endfor %}</select><button type="submit">{% trans "Link observation" %}</button></form>
{% endif %}
</li>
{% empty %}<li>{% trans "No field notes visible to you yet." %}</li>{% endfor %}
</ol>
<p><a href="{% url 'fireworks_detect:field_notes' %}">{% trans "My field notes" %}</a></p>
</section>
+182
View File
@@ -0,0 +1,182 @@
from datetime import timedelta
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.core.exceptions import PermissionDenied, ValidationError
from django.test import TestCase
from django.urls import reverse
from django.utils import timezone
from .field_notes import draft_token, regroup_event_notes, reportable_notes
from .models import Event, FieldNote, FieldNoteContext, FieldNoteAssociation, PendingEvent
class FieldNotesTests(TestCase):
def setUp(self):
User = get_user_model()
self.alice = User.objects.create_user('alice', password='test-password')
self.bob = User.objects.create_user('bob', password='test-password')
self.event = Event.objects.create(original_filename='Burst', classifier_response={}, source_type='manual', occurrences=15)
self.url = reverse('fireworks_detect:field_notes')
self.client.force_login(self.alice)
def note(self, user=None, visibility='private', **kwargs):
user = user or self.alice
context = FieldNoteContext.objects.create(author=user, event=self.event)
return FieldNote.objects.create(author=user, context=context, content='A private observation', visibility=visibility, **kwargs)
def test_only_content_required_private_defaults_plain_text(self):
response = self.client.post(self.url, {'content': '<script>alert(1)</script>\nSecond line'})
self.assertEqual(response.status_code, 302)
note = FieldNote.objects.get()
self.assertEqual(note.visibility, 'private')
self.assertEqual(note.source_type, 'unknown')
self.assertEqual(note.verification_status, 'unverified')
response = self.client.get(self.url)
self.assertContains(response, '&lt;script&gt;')
self.assertNotContains(response, '<script>alert(1)</script>')
def test_cross_user_read_create_link_and_export_are_scoped(self):
note = self.note()
self.client.force_login(self.bob)
self.assertNotContains(self.client.get(self.url), note.content)
self.assertNotContains(self.client.get(reverse('fireworks_detect:event_detail', args=[self.event.pk])), note.content)
response = self.client.post(self.url, {'content':'forged', 'token':draft_token(self.alice)})
self.assertEqual(response.status_code, 403)
self.assertEqual(self.client.post(reverse('fireworks_detect:link_field_note', args=[note.context_id]), {'event': self.event.pk}).status_code, 404)
self.assertEqual(self.client.get(reverse('fireworks_detect:export_field_notes', args=['json'])).json()['notes'], [])
def test_anonymous_cannot_create_read_or_export_notes(self):
self.note()
self.client.logout()
self.assertEqual(self.client.post(self.url, {'content':'no'}).status_code, 302)
self.assertEqual(self.client.get(self.url).status_code, 302)
self.assertNotContains(self.client.get(reverse('fireworks_detect:event_detail', args=[self.event.pk])), 'A private observation')
self.assertEqual(self.client.get(reverse('fireworks_detect:export_field_notes', args=['json'])).status_code, 302)
def test_export_always_excludes_private_even_for_superuser(self):
self.note()
public = self.note(visibility='reportable', source_type='second_hand')
self.note(self.bob, visibility='reportable')
self.assertEqual(list(reportable_notes(self.alice)), [public])
self.alice.is_superuser = self.alice.is_staff = True
self.alice.save()
for format in ['json','csv']:
response = self.client.get(reverse('fireworks_detect:export_field_notes', args=[format]))
self.assertEqual(response.status_code, 200)
self.assertNotIn('"visibility": "private"', response.content.decode())
rows = self.client.get(reverse('fireworks_detect:export_field_notes', args=['json'])).json()['notes']
self.assertEqual(len(rows), 2)
self.assertEqual(rows[0]['source_type'], 'second_hand')
self.assertEqual(rows[0]['verification_status'], 'unverified')
def test_reportable_does_not_grant_other_users_read_access(self):
note = self.note(visibility='reportable')
self.client.force_login(self.bob)
self.assertNotContains(self.client.get(self.url), note.content)
def test_observed_time_entry_time_and_append_only(self):
self.client.post(self.url, {'content':'Later information', 'observed_at':'2026-10-09T14:00'})
note = FieldNote.objects.get()
self.assertTrue(timezone.is_aware(note.observed_at))
self.assertLess(note.observed_at, note.created_at)
entered = note.created_at
note.content = 'rewrite'
with self.assertRaises(ValidationError): note.save()
note.refresh_from_db()
self.assertEqual(note.content, 'Later information')
self.assertEqual(note.created_at, entered)
def test_invalid_forms_render_with_and_without_htmx(self):
for headers in [{}, {'HTTP_HX_REQUEST':'true'}]:
response = self.client.post(self.url, {'content':' ', 'visibility':'public'}, **headers)
self.assertEqual(response.status_code, 200)
self.assertContains(response, 'errorlist')
self.assertFalse(FieldNote.objects.exists())
def test_live_notes_bind_to_report_and_survive_approval(self):
token = draft_token(self.alice)
self.client.post(self.url, {'token':token, 'content':'Heard during listening'}, HTTP_HX_REQUEST='true')
note = FieldNote.objects.get()
original_time = note.created_at
response = self.client.post(reverse('fireworks_detect:submit_manual_pending'), {'occurrences':'15', 'field_note_context':token})
self.assertEqual(response.status_code, 200)
pending = PendingEvent.objects.get()
note.context.refresh_from_db()
self.assertEqual(note.context.pending_event_id, pending.pk)
event = pending.approve(actor=self.alice)
note.context.refresh_from_db()
self.assertEqual(note.context.event_id, event.pk)
self.assertIsNone(note.context.pending_event_id)
note.refresh_from_db()
self.assertEqual(note.created_at, original_time)
self.assertEqual(note.context.associations.count(), 2)
self.assertEqual(note.context.associations.last().actor_id, self.alice.pk)
# A note submitted from an already-open form follows the approved report.
self.client.post(self.url, {'token':token, 'content':'Late save'})
self.assertEqual(FieldNote.objects.get(content='Late save').context.event_id, event.pk)
# Reusing a report token cannot reparent existing notes or create a report.
self.assertEqual(self.client.post(reverse('fireworks_detect:submit_manual_pending'), {'occurrences':'1', 'field_note_context':token}).status_code, 403)
self.assertFalse(PendingEvent.objects.exists())
def test_pending_access_checked_and_historical_append(self):
pending = PendingEvent.objects.create(original_filename='secret', classifier_response={})
self.assertEqual(self.client.get(self.url, {'pending':pending.pk}).status_code, 404)
self.assertEqual(self.client.post(self.url, {'pending':pending.pk,'content':'no'}).status_code, 404)
self.assertEqual(self.client.post(self.url, {'event':self.event.pk,'content':'Historical follow-up'}).status_code, 302)
self.assertEqual(FieldNote.objects.get().context.event_id, self.event.pk)
def test_standalone_link_and_regroup_preserve_provenance(self):
self.client.post(self.url, {'content':'Possible camera lead'})
note = FieldNote.objects.get()
response = self.client.post(reverse('fireworks_detect:link_field_note', args=[note.context_id]), {'event':self.event.pk})
self.assertEqual(response.status_code, 302)
target = Event.objects.create(original_filename='Grouped burst', classifier_response={}, occurrences=20)
with self.assertRaises(PermissionDenied): regroup_event_notes(self.alice, self.event, target)
self.alice.is_superuser = self.alice.is_staff = True; self.alice.save()
regroup_event_notes(self.alice, self.event, target)
self.event.delete()
note.context.refresh_from_db()
self.assertEqual(note.context.event_id, target.pk)
self.assertEqual(note.context.associations.count(), 2)
self.assertEqual(note.context.associations.last().previous['id'], self.event.pk or note.context.associations.first().target['id'])
self.assertEqual(FieldNote.objects.count(), 1)
def test_denied_report_retains_notes_and_original_reference(self):
token = draft_token(self.alice)
self.client.post(self.url, {'token':token,'content':'Retain observation'})
self.client.post(reverse('fireworks_detect:submit_manual_pending'), {'occurrences':'3','field_note_context':token})
pending = PendingEvent.objects.get(); old_id = pending.pk; pending.deny()
note = FieldNote.objects.get()
self.assertIsNone(note.context.pending_event_id)
self.assertEqual(note.context.associations.get().target, {'kind':'pending','id':old_id})
def test_staff_needs_explicit_permission_for_private_notes(self):
self.note()
self.bob.is_staff = True; self.bob.save()
self.assertFalse(FieldNote.objects.visible_to(self.bob).exists())
self.bob.user_permissions.add(Permission.objects.get(codename='view_all_fieldnotes'))
bob = get_user_model().objects.get(pk=self.bob.pk)
self.assertEqual(FieldNote.objects.visible_to(bob).count(), 1)
self.assertFalse(reportable_notes(bob).exists())
def test_csv_formula_is_escaped(self):
ctx = FieldNoteContext.objects.create(author=self.alice)
FieldNote.objects.create(author=self.alice, context=ctx, content='=1+1', visibility='reportable')
self.assertContains(self.client.get(reverse('fireworks_detect:export_field_notes', args=['csv'])), "'=1+1")
def test_note_posts_require_csrf(self):
from django.test import Client
browser = Client(enforce_csrf_checks=True)
browser.force_login(self.alice)
self.assertEqual(browser.post(self.url, {"content":"forged"}).status_code, 403)
self.assertFalse(FieldNote.objects.exists())
def test_history_orders_by_entry_not_backdated_observation(self):
first = self.note(observed_at=timezone.now())
second = self.note(observed_at=timezone.now()-timedelta(days=7))
self.assertEqual(list(FieldNote.objects.values_list("pk", flat=True)), [first.pk, second.pk])
self.client.force_login(self.bob)
self.bob.user_permissions.add(Permission.objects.get(codename="export_reportable_fieldnotes"))
# Export permission does not grant read access to private history.
self.assertNotContains(self.client.get(self.url), first.content)
+5
View File
@@ -19,9 +19,14 @@ from .views import (
browser_processing_policy,
)
from . import note_views
app_name = "fireworks_detect"
urlpatterns = [
path("notes/", note_views.notes, name="field_notes"),
path("notes/<uuid:context_id>/link/", note_views.link_note, name="link_field_note"),
path("notes/export/<str:format>/", note_views.export_notes, name="export_field_notes"),
path("", fireworks_view, name="fireworks"),
path("map/", fireworks_map_view, name="map"),
path("classify/", classify_audio, name="classify"),
+25 -2
View File
@@ -30,6 +30,7 @@ from django.views.decorators.http import require_http_methods
from .h3_utils import cell_boundary, cell_center, cell_from_coordinates, h3_resolution
from .browser_policy import advisory_browser_metadata, browser_config, browser_policy
from .models import BrowserProcessingSettings, ClassificationRule, Event, ManualReportRevision, PendingEvent, Sensor, SensorSubmission
from .field_notes import draft_token
from .bursts import BURST_MIN_BANGS, DEFAULT_ESTIMATED_DURATION_MINUTES, burst_intensity, burst_rate
@@ -187,6 +188,8 @@ def fireworks_map_view(request):
@never_cache
def dashboard_view(request):
from .field_notes import draft_token
from .forms import FieldNoteForm
map_events, h3_cells = _events_for_map({
"date_from": None,
"date_to": None,
@@ -194,6 +197,10 @@ def dashboard_view(request):
"visual": "all",
})
return render(request, "fireworks_detect/dashboard.html", {
"note_token": draft_token(request.user),
"note_form": FieldNoteForm(),
"note_mode": "draft",
"note_panel_id": "live-field-notes",
"h3_resolution": h3_resolution(),
"h3_cells": h3_cells,
"map_events": map_events,
@@ -204,7 +211,7 @@ def dashboard_view(request):
def events_view(request):
return render(request, "fireworks_detect/events.html")
return render(request, "fireworks_detect/events.html", {"events": Event.objects.all()[:30]})
def _classification_context(payload):
@@ -405,6 +412,7 @@ def manual_direction_panel(request):
@require_http_methods(["POST"])
@never_cache
@transaction.atomic
def submit_manual_pending_event(request):
try:
occurrences = int(request.POST.get("occurrences", ""))
@@ -437,6 +445,14 @@ def submit_manual_pending_event(request):
h3_cell = cell_from_coordinates(latitude, longitude)
direction_degrees, direction_accuracy_degrees = _manual_direction(request)
# Reject stale/foreign contexts before FileField writes an audio file.
note_token = request.POST.get("field_note_context")
if request.user.is_authenticated and note_token:
from .field_notes import context_for_token
from django.core.exceptions import PermissionDenied
note_context = context_for_token(request.user, note_token)
if note_context.event_id or note_context.pending_event_id:
raise PermissionDenied("This note context already belongs to a report. Reload before reporting again.")
pending = PendingEvent.objects.create(
audio_file=uploaded_file,
original_filename="Manual fireworks report",
@@ -451,6 +467,8 @@ def submit_manual_pending_event(request):
direction_accuracy_degrees=direction_accuracy_degrees,
direction_source="device_compass" if direction_degrees is not None else "",
)
from .field_notes import bind_report
bind_report(request.user, request.POST.get("field_note_context"), pending)
owned = request.session.get("manual_pending_ids", [])
request.session["manual_pending_ids"] = (owned + [pending.pk])[-20:]
direction_names = {
@@ -460,6 +478,7 @@ def submit_manual_pending_event(request):
return render(request, "fireworks_detect/manual_pending_submission.html", {
"pending": pending,
"editable": True,
"next_note_token": draft_token(request.user),
"direction_label": direction_names.get(pending.direction_cardinal) if direction_degrees is not None else "",
})
@@ -542,7 +561,11 @@ def event_detail(request, event_id):
context = _classification_context(event.classifier_response)
context["event"] = event
context["event_h3_cell"] = event.h3_cell or cell_from_coordinates(event.latitude, event.longitude)
return render(request, "fireworks_detect/event_detail.html", context)
if request.user.is_authenticated:
from .note_views import panel_context
context.update(panel_context(request, {"event": event.pk}))
template = "fireworks_detect/event_detail.html" if request.headers.get("HX-Request") == "true" else "fireworks_detect/event_page.html"
return render(request, template, context)
def _audio_response(record):
+2
View File
@@ -11,3 +11,5 @@ import "../scripts/theme.js";
import "../scripts/manual-report.js";
import "../scripts/audio-upload.js";
import "../scripts/event-map.js";
import "../styles/components/field-notes.scss";
+2
View File
@@ -3,3 +3,5 @@ import "../styles/components/fireworks-navigation.scss";
import "../styles/pages/events.scss";
import "../styles/theme.scss";
import "../scripts/theme.js";
import "../styles/components/field-notes.scss";
+106 -8
View File
@@ -22,7 +22,20 @@
const reportHours = document.querySelector("#report-clock-hours");
const reportMinutes = document.querySelector("#report-clock-minutes");
const occurredAt = document.querySelector("#manual-occurred-at");
const useNow = document.querySelector("#manual-use-now");
const clockModeLabel = document.querySelector("#report-clock-mode-label");
const clockDate = document.querySelector("#report-clock-date");
const clockEdit = document.querySelector("#report-clock-edit");
const clockReset = document.querySelector("#report-clock-reset");
const clockEditor = document.querySelector("#report-clock-editor");
const clockDraftDate = document.querySelector("#report-clock-draft-date");
const clockDraftTime = document.querySelector("#report-clock-draft-time");
const clockApply = document.querySelector("#report-clock-apply");
const clockCancel = document.querySelector("#report-clock-cancel");
const clockError = document.querySelector("#report-clock-error");
const timeApproximate = document.querySelector("#manual-time-approximate");
let timestampMode = "NOW";
let overrideTime = null;
let overrideApproximate = false;
const burstStatus = document.querySelector("#manual-burst-status");
const burstDuration = document.querySelector("#manual-burst-duration");
let orientationListener;
@@ -38,23 +51,93 @@
const displayDegrees = (value) => Number(value.toFixed(1)).toString();
const updateReportTime = () => {
if (!reportTime) return;
const now = new Date();
reportTime.dateTime = now.toISOString();
const parts = new Intl.DateTimeFormat(document.documentElement.lang || undefined, { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }).formatToParts(now);
const shown = timestampMode === "OVERRIDE" ? overrideTime : new Date();
reportTime.dateTime = shown.toISOString();
const parts = new Intl.DateTimeFormat(document.documentElement.lang || undefined, { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }).formatToParts(shown);
const hours = parts.find((part) => part.type === "hour")?.value;
const minutes = parts.find((part) => part.type === "minute")?.value;
if (!hours || !minutes || !reportHours || !reportMinutes) return;
reportHours.textContent = hours;
reportMinutes.textContent = minutes;
reportTime.setAttribute("aria-label", `${hours}:${minutes}`);
if (clockDate) {
clockDate.hidden = timestampMode !== "OVERRIDE";
if (timestampMode === "OVERRIDE") clockDate.textContent = new Intl.DateTimeFormat(document.documentElement.lang || undefined, { day: "numeric", month: "long", year: "numeric" }).format(shown);
}
};
updateReportTime();
if (reportTime) window.setInterval(updateReportTime, 60000);
const idleSubmitLabel = submitLabel?.textContent || "I heard fireworks";
useNow?.addEventListener("click", () => {
const now = new Date();
const local = new Date(now.getTime() - now.getTimezoneOffset() * 60000);
occurredAt.value = local.toISOString().slice(0, 16);
const localInputValue = (date) => {
const pad = (value) => String(value).padStart(2, "0");
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad(date.getHours())}:${pad(date.getMinutes())}`;
};
const clearClockError = () => {
if (!clockError) return;
clockError.hidden = true;
clockError.textContent = "";
clockDraftDate.removeAttribute("aria-invalid");
clockDraftTime.removeAttribute("aria-invalid");
};
const closeClockEditor = () => {
clockEditor.hidden = true;
clockEdit.setAttribute("aria-expanded", "false");
clearClockError();
clockEdit.focus();
};
clockEdit?.addEventListener("click", () => {
const [date, time] = localInputValue(timestampMode === "OVERRIDE" ? overrideTime : new Date()).split("T");
clockDraftDate.value = date;
clockDraftTime.value = time;
timeApproximate.checked = timestampMode === "OVERRIDE" && overrideApproximate;
timeApproximate.disabled = false;
clearClockError();
clockEditor.hidden = false;
clockEdit.setAttribute("aria-expanded", "true");
clockDraftDate.focus();
});
clockCancel?.addEventListener("click", () => {
timeApproximate.checked = timestampMode === "OVERRIDE" && overrideApproximate;
timeApproximate.disabled = timestampMode === "NOW";
closeClockEditor();
});
clockApply?.addEventListener("click", () => {
const date = clockDraftDate.value;
const time = clockDraftTime.value.trim();
const value = `${date}T${time}`;
const complete = /^\d{4}-\d{2}-\d{2}T(?:[01]\d|2[0-3]):[0-5]\d$/.test(value);
const chosen = complete ? new Date(value) : null;
if (!chosen || Number.isNaN(chosen.getTime()) || localInputValue(chosen) !== value || chosen.getTime() > Date.now() + 300000) {
clockError.textContent = !chosen || Number.isNaN(chosen.getTime()) || localInputValue(chosen) !== value
? (t.invalidReportTime || "Enter a valid date and time.")
: (t.futureReportTime || "Report time cannot be in the future.");
clockError.hidden = false;
clockDraftDate.setAttribute("aria-invalid", "true");
clockDraftTime.setAttribute("aria-invalid", "true");
(!date ? clockDraftDate : clockDraftTime).focus();
return;
}
overrideTime = chosen;
overrideApproximate = timeApproximate.checked;
timestampMode = "OVERRIDE";
occurredAt.value = chosen.toISOString();
clockModeLabel.textContent = t.adjusted || "Adjusted";
clockReset.hidden = false;
updateReportTime();
closeClockEditor();
});
clockReset?.addEventListener("click", () => {
timestampMode = "NOW";
overrideTime = null;
overrideApproximate = false;
occurredAt.value = "";
timeApproximate.checked = false;
timeApproximate.disabled = true;
clockModeLabel.textContent = t.now || "Now";
clockReset.hidden = true;
updateReportTime();
if (!clockEditor.hidden) closeClockEditor();
clockEdit.focus();
});
const setSubmissionState = (next, message = "") => {
@@ -68,6 +151,13 @@
}
};
const rotateNoteContext = (receipt) => {
const token = receipt?.dataset.nextNoteToken;
const input = document.querySelector("#manual-note-context");
if (!token || !input || input.value === token) return;
input.value = token;
if (window.htmx) htmx.ajax("GET", "/fireworks/notes/?token=" + encodeURIComponent(token), {target: "#live-field-notes", swap: "outerHTML"});
};
const showResponse = (html, successful) => {
const parsed = new DOMParser().parseFromString(html, "text/html").querySelector("#manual-submission");
if (!parsed) {
@@ -75,6 +165,7 @@
return false;
}
document.querySelector("#manual-submission").replaceWith(parsed);
if (successful) rotateNoteContext(parsed);
setSubmissionState(successful ? "submitted" : "error");
return successful;
};
@@ -213,6 +304,11 @@
};
const submitManualReport = async () => {
if (occurredAt) occurredAt.value = timestampMode === "OVERRIDE" ? overrideTime.toISOString() : "";
if (timeApproximate) {
timeApproximate.checked = timestampMode === "OVERRIDE" && overrideApproximate;
timeApproximate.disabled = timestampMode === "NOW";
}
setCount(occurrences.value);
stopCompassReading();
setSubmissionState("submitting", t.sendingReport || "Sending…");
@@ -300,3 +396,5 @@
if (event.detail.elt === manualForm) setSubmissionState("error", t.reportFailed || "Could not send the report. Please try again.");
});
document.body.addEventListener("htmx:afterSwap", () => rotateNoteContext(document.querySelector("#manual-submission")));
@@ -0,0 +1,21 @@
.field-notes {
margin-top: 1.5rem; padding: 1rem; border: 1px solid var(--theme-line); border-radius: 1rem;
color: var(--theme-ink); background: var(--theme-surface); overflow-wrap: anywhere;
h2 { font-size: 1.3rem; }
p, small { line-height: 1.55; }
details { margin: .8rem 0; }
summary { cursor: pointer; padding: .4rem 0; font-weight: 650; }
form { margin-top: .8rem; }
label, small { display: block; margin: .4rem 0; }
input, select, textarea { width: 100%; max-width: 100%; min-width: 0; padding: .65rem; border: 1px solid var(--theme-line); border-radius: .5rem; font: inherit; color: var(--theme-ink); background: var(--theme-input); }
textarea { resize: vertical; }
button { margin-top: .7rem; padding: .65rem 1rem; border: 1px solid var(--theme-line); border-radius: .5rem; background: var(--theme-surface-raised); color: var(--theme-ink); font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid #789eff; outline-offset: 3px; }
&__fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; }
&__timeline { padding-left: 1.3rem; }
&__timeline > li { padding: .6rem 0 1rem .4rem; border-bottom: 1px solid var(--theme-line); }
&__content { white-space: pre-wrap; }
&__meta, small { color: var(--theme-muted); font-size: .85rem; }
.errorlist { color: #f28c96; }
@media (max-width: 650px) { &__fields { grid-template-columns: 1fr; } }
}
@@ -6,7 +6,7 @@
--manual-report-section-gap: 1rem;
}
.manual-report__occurrence, .manual-report__duration {
.manual-report__duration {
display: grid;
gap: .55rem;
max-width: 36rem;
@@ -31,26 +31,6 @@
}
.manual-report__duration[hidden] { display: none; }
.manual-report__time-row {
display: flex;
gap: .5rem;
align-items: center;
input { min-width: 0; flex: 1; }
button { flex: none; }
}
@media (max-width: 30rem) {
.manual-report__time-row { flex-direction: column; align-items: stretch; }
.manual-report__time-row button { align-self: flex-start; }
}
.manual-report__occurrence button {
justify-self: start;
padding: .35rem .75rem;
border: 1px solid #725da4;
border-radius: .55rem;
color: #f5f0ff;
background: #302553;
cursor: pointer;
}
.manual-report__check {
display: flex;
align-items: center;
@@ -367,6 +347,10 @@
.manual-report__header {
padding-right: 2.5rem;
}
.manual-report__header .report-clock {
width: calc(100% + 2.5rem);
max-width: none;
}
.manual-report form {
padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
}
@@ -461,6 +445,55 @@
gap: .75rem;
}
.report-clock__controls {
display: flex;
align-items: center;
gap: .4rem;
}
.report-clock__edit, .report-clock__reset, .report-clock__actions button {
min-height: 2.25rem;
padding: .35rem .65rem;
border: 1px solid #936ea8;
border-radius: .55rem;
color: #f5f0ff;
background: #302553;
font: inherit;
cursor: pointer;
}
.report-clock__edit { min-width: 2.25rem; font-size: 1.2rem; line-height: 1; }
.report-clock__date { display: block; margin-top: .25rem; color: #e9def8; font-size: .85rem; }
.report-clock__reset { margin-top: .6rem; }
.report-clock__editor { display: grid; gap: .5rem; margin-top: .8rem; padding-top: .8rem; border-top: 1px solid #69539d; color: #f5f0ff; }
.report-clock__fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(7rem, .6fr); gap: .6rem; }
.report-clock__fields > div { min-width: 0; }
@media (max-width: 30rem) {
.report-clock__fields { grid-template-columns: minmax(0, 1fr); }
}
.report-clock__editor label { display: block; margin-bottom: .3rem; font-weight: 650; }
.report-clock__editor input[type="date"], .report-clock__editor input[type="text"] {
box-sizing: border-box;
width: 100%;
min-height: 2.75rem;
padding: .45rem .65rem;
border: 1px solid #936ea8;
border-radius: .55rem;
color: #f5f0ff;
background: #211d3d;
color-scheme: dark;
font: inherit;
}
.report-clock__editor input[type="text"] { font-variant-numeric: tabular-nums; }
.report-clock__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.report-clock__error { margin: 0; color: #ffb9a9; }
.report-clock [hidden] { display: none !important; }
@media (max-width: 25rem) {
.report-clock__display { align-items: center; }
.report-clock__now { font-size: .6rem; }
}
.report-clock__time {
display: inline-flex;
align-items: center;
+43
View File
@@ -5,7 +5,13 @@ import { JSDOM } from "jsdom";
test("compass stays hidden until permission and a heading, then rotates and hides when stopped", async () => {
const dom = new JSDOM(`<!doctype html><html><body>
<time id="manual-report-time"><span id="report-clock-hours">--</span><span class="report-clock__colon">:</span><span id="report-clock-minutes">--</span></time>
<span id="report-clock-mode-label">Now</span><span id="report-clock-date" hidden></span>
<button id="report-clock-edit" aria-expanded="false"></button><button id="report-clock-reset" hidden></button>
<div id="report-clock-editor" hidden><input id="report-clock-draft-date" type="date"><input id="report-clock-draft-time" type="text"><p id="report-clock-error" hidden></p>
<input id="manual-time-approximate" type="checkbox" name="time_approximate" form="manual-report-form" disabled>
<button id="report-clock-apply"></button><button id="report-clock-cancel"></button></div>
<form id="manual-report-form" action="/submit">
<input id="manual-occurred-at" name="occurred_at" type="hidden">
<input id="manual-latitude"><input id="manual-longitude">
<input id="manual-direction-degrees"><input id="manual-direction-accuracy">
<button id="manual-decrease" type="button"></button><input id="manual-occurrences" value="1"><button id="manual-increase" type="button"></button>
@@ -37,6 +43,43 @@ test("compass stays hidden until permission and a heading, then rotates and hide
assert.match(reportTime.getAttribute("aria-label"), /^\d{2}:\d{2}$/);
assert.equal(reportTime.querySelector(".report-clock__colon").textContent, ":");
assert.match(reportTime.dateTime, /^\d{4}-\d{2}-\d{2}T/);
const editTime = window.document.querySelector("#report-clock-edit");
const draftDate = window.document.querySelector("#report-clock-draft-date");
const draftTime = window.document.querySelector("#report-clock-draft-time");
const submittedTime = window.document.querySelector("#manual-occurred-at");
editTime.click();
draftDate.value = "2020-01-02";
draftTime.value = "12:30";
window.document.querySelector("#report-clock-cancel").click();
assert.equal(submittedTime.value, "");
editTime.click();
draftTime.value = "";
window.document.querySelector("#report-clock-apply").click();
assert.equal(window.document.querySelector("#report-clock-editor").hidden, false);
assert.equal(draftTime.getAttribute("aria-invalid"), "true");
draftTime.value = "25:00";
window.document.querySelector("#report-clock-apply").click();
assert.equal(submittedTime.value, "");
draftDate.value = "2099-01-02";
draftTime.value = "12:30";
window.document.querySelector("#report-clock-apply").click();
assert.equal(submittedTime.value, "");
draftDate.value = "2020-01-02";
draftTime.value = "12:30";
window.document.querySelector("#manual-time-approximate").checked = true;
window.document.querySelector("#report-clock-apply").click();
assert.equal(submittedTime.value, new Date("2020-01-02T12:30").toISOString());
assert.equal(new window.FormData(window.document.querySelector("#manual-report-form")).get("time_approximate"), "on");
assert.equal(window.document.querySelector("#report-clock-reset").hidden, false);
editTime.click();
draftDate.value = "2020-01-03";
draftTime.value = "12:30";
window.document.querySelector("#report-clock-cancel").click();
assert.equal(submittedTime.value, new Date("2020-01-02T12:30").toISOString());
assert.equal(new window.FormData(window.document.querySelector("#manual-report-form")).get("time_approximate"), "on");
window.document.querySelector("#report-clock-reset").click();
assert.equal(submittedTime.value, "");
assert.equal(new window.FormData(window.document.querySelector("#manual-report-form")).get("time_approximate"), null);
const compass = window.document.querySelector("#manual-compass");
const rose = window.document.querySelector("#manual-compass-rose");
const button = window.document.querySelector("#manual-capture-direction");
Binary file not shown.
+247
View File
@@ -1299,6 +1299,33 @@ msgstr "Nu"
msgid "Report time"
msgstr "Tijdstip melding"
msgid "Edit report time"
msgstr "Tijdstip aanpassen"
msgid "Date and time"
msgstr "Datum en tijd"
msgid "Date"
msgstr "Datum"
msgid "Time (24-hour)"
msgstr "Tijd (24 uur)"
msgid "Apply"
msgstr "Toepassen"
msgid "Cancel"
msgstr "Annuleren"
msgid "Adjusted"
msgstr "Aangepast"
msgid "Enter a valid date and time."
msgstr "Voer een geldige datum en tijd in."
msgid "Report time cannot be in the future."
msgstr "Het tijdstip van de melding kan niet in de toekomst liggen."
msgid "How many times did you hear it?"
msgstr "Hoe vaak hoorde je het?"
@@ -1483,3 +1510,223 @@ msgstr "Intens"
msgid "Report updated!"
msgstr "Melding bijgewerkt!"
#: fireworks_detect/forms.py:11
msgid "What did you observe or learn?"
msgstr "Wat heb je waargenomen of vernomen?"
#: fireworks_detect/forms.py:14
msgid "Note"
msgstr "Notitie"
#: fireworks_detect/forms.py:14
msgid "Observed at (optional)"
msgstr "Waargenomen op (optioneel)"
#: fireworks_detect/forms.py:15
msgid "Category"
msgstr "Categorie"
#: fireworks_detect/forms.py:16
#| msgid "Classification results"
msgid "Verification status"
msgstr "Verificatiestatus"
#: fireworks_detect/forms.py:16
msgid "Visibility"
msgstr "Zichtbaarheid"
#: fireworks_detect/forms.py:18
msgid ""
"Private by default. Reportable permits authorised export; it does not mean "
"verified or public."
msgstr "Standaard privé. Opneembaar in rapporten staat bevoegde export toe; de notitie is daarmee niet geverifieerd of openbaar."
#: fireworks_detect/forms.py:19
msgid "Local time (Europe/Amsterdam). The entry time is recorded separately."
msgstr "Lokale tijd (Europe/Amsterdam). Het tijdstip van invoeren wordt apart vastgelegd."
#: fireworks_detect/models.py:376
msgid "General"
msgstr "Algemeen"
#: fireworks_detect/models.py:377
msgid "Witness"
msgstr "Getuige"
#: fireworks_detect/models.py:378
msgid "People / vehicles"
msgstr "Personen / voertuigen"
#: fireworks_detect/models.py:379
msgid "CCTV"
msgstr "Camerabeelden"
#: fireworks_detect/models.py:380
#| msgid "Capture direction"
msgid "Location / direction"
msgstr "Locatie / richting"
#: fireworks_detect/models.py:381
msgid "Follow-up"
msgstr "Aanvulling"
#: fireworks_detect/models.py:382
msgid "Other"
msgstr "Overig"
#: fireworks_detect/models.py:385
msgid "First-hand"
msgstr "Zelf waargenomen"
#: fireworks_detect/models.py:386
msgid "Second-hand"
msgstr "Van horen zeggen"
#: fireworks_detect/models.py:387
msgid "Other / unknown"
msgstr "Overig / onbekend"
#: fireworks_detect/models.py:390
msgid "Unverified"
msgstr "Onbevestigd"
#: fireworks_detect/models.py:391
msgid "Corroborated"
msgstr "Ondersteund door andere informatie"
#: fireworks_detect/models.py:392
msgid "Disputed"
msgstr "Betwist"
#: fireworks_detect/models.py:395
msgid "Private"
msgstr "Privé"
#: fireworks_detect/models.py:396
#| msgid "Reported"
msgid "Reportable"
msgstr "Opneembaar in rapporten"
#: fireworks_detect/models.py:427
msgid "Enter a note."
msgstr "Voer een notitie in."
#: fireworks_detect/models.py:429
msgid "The note and its context must have the same author."
msgstr "De notitie en de context moeten dezelfde auteur hebben."
#: fireworks_detect/models.py:433
msgid ""
"Field notes are append-only. Add a follow-up to correct an earlier note."
msgstr "Veldnotities kunnen alleen worden aangevuld. Voeg een nieuwe notitie toe om een eerdere notitie te corrigeren."
#: fireworks_detect/templates/fireworks_detect/dashboard.html:28
#: fireworks_detect/templates/fireworks_detect/event_detail.html:34
msgid "Sign in to add private field notes"
msgstr "Log in om privéveldnotities toe te voegen"
#: fireworks_detect/templates/fireworks_detect/event_page.html:2
msgid "Event · BoomCast"
msgstr "Gebeurtenis · BoomCast"
#: fireworks_detect/templates/fireworks_detect/includes/navigation.html:11
#: fireworks_detect/templates/fireworks_detect/notes/panel.html:2
#: fireworks_detect/templates/fireworks_detect/notes/panel.html:3
msgid "Field notes"
msgstr "Veldnotities"
#: fireworks_detect/templates/fireworks_detect/manual_pending_submission.html:19
msgid "Add or review field notes for this report"
msgstr "Veldnotities bij deze melding toevoegen of bekijken"
#: fireworks_detect/templates/fireworks_detect/notes/page.html:2
msgid "Field notes · BoomCast"
msgstr "Veldnotities · BoomCast"
#: fireworks_detect/templates/fireworks_detect/notes/page.html:2
msgid ""
"Exports include only reportable notes you are authorised to export. Private "
"notes are always excluded."
msgstr "Exports bevatten alleen notities die in rapporten mogen worden opgenomen en die je mag exporteren. Privénotities worden altijd uitgesloten."
#: fireworks_detect/templates/fireworks_detect/notes/panel.html:4
msgid ""
"Human context, separate from detection evidence. Notes are private by "
"default. Add a follow-up to correct an earlier entry."
msgstr "Menselijke context, los van detectiegegevens. Notities zijn standaard privé. Voeg een aanvulling toe om een eerdere notitie te corrigeren."
#: fireworks_detect/templates/fireworks_detect/notes/panel.html:5
#| msgid "Reported"
msgid "Report"
msgstr "Melding"
#: fireworks_detect/templates/fireworks_detect/notes/panel.html:5
#: fireworks_detect/templates/fireworks_detect/notes/panel.html:32
msgid "bangs"
msgstr "knallen"
#: fireworks_detect/templates/fireworks_detect/notes/panel.html:6
msgid "Field note saved."
msgstr "Veldnotitie opgeslagen."
#: fireworks_detect/templates/fireworks_detect/notes/panel.html:8
msgid "Add field note"
msgstr "Veldnotitie toevoegen"
#: fireworks_detect/templates/fireworks_detect/notes/panel.html:14
#| msgid "Report details"
msgid "Optional details"
msgstr "Optionele details"
#: fireworks_detect/templates/fireworks_detect/notes/panel.html:19
msgid "Save field note"
msgstr "Veldnotitie opslaan"
#: fireworks_detect/templates/fireworks_detect/notes/panel.html:28
msgid "Entered"
msgstr "Ingevoerd"
#: fireworks_detect/templates/fireworks_detect/notes/panel.html:28
msgid "Observed"
msgstr "Waargenomen"
#: fireworks_detect/templates/fireworks_detect/notes/panel.html:29
#| msgid "Pending event"
msgid "Pending report"
msgstr "Melding in beoordeling"
#: fireworks_detect/templates/fireworks_detect/notes/panel.html:29
msgid "Current observation — not yet submitted"
msgstr "Huidige waarneming — nog niet ingediend"
#: fireworks_detect/templates/fireworks_detect/notes/panel.html:29
msgid "Standalone observation"
msgstr "Losse waarneming"
#: fireworks_detect/templates/fireworks_detect/notes/panel.html:30
msgid "Association history"
msgstr "Koppelgeschiedenis"
#: fireworks_detect/templates/fireworks_detect/notes/panel.html:32
#| msgid "Approved events."
msgid "Link to an approved event"
msgstr "Koppelen aan een goedgekeurde gebeurtenis"
#: fireworks_detect/templates/fireworks_detect/notes/panel.html:32
#| msgid "Select an event"
msgid "Choose an event"
msgstr "Kies een gebeurtenis"
#: fireworks_detect/templates/fireworks_detect/notes/panel.html:32
#| msgid "Administration"
msgid "Link observation"
msgstr "Waarneming koppelen"
#: fireworks_detect/templates/fireworks_detect/notes/panel.html:35
msgid "No field notes visible to you yet."
msgstr "Er zijn nog geen veldnotities zichtbaar voor jou."
#: fireworks_detect/templates/fireworks_detect/notes/panel.html:37
msgid "My field notes"
msgstr "Mijn veldnotities"
+196 -62
View File
@@ -1,198 +1,332 @@
{
"_fireworks-navigation-B0T7du8_.css": {
"file": "assets/fireworks-navigation-B0T7du8_.css",
"src": "_fireworks-navigation-B0T7du8_.css"
"_field-notes-STCCElbj.css": {
"file": "assets/field-notes-STCCElbj.css",
"src": "_field-notes-STCCElbj.css"
},
"_manual-report-BLClvilD.js": {
"file": "assets/manual-report-BLClvilD.js",
"_fireworks-navigation-BViXwBBT.css": {
"file": "assets/fireworks-navigation-BViXwBBT.css",
"src": "_fireworks-navigation-BViXwBBT.css"
},
"_fonts-4o1Uz5dn.css": {
"file": "assets/fonts-4o1Uz5dn.css",
"src": "_fonts-4o1Uz5dn.css"
},
"_manual-report-BCwcwvAZ.css": {
"file": "assets/manual-report-BCwcwvAZ.css",
"src": "_manual-report-BCwcwvAZ.css"
},
"_manual-report-DoPagyx-.js": {
"file": "assets/manual-report-DoPagyx-.js",
"name": "manual-report",
"css": [
"assets/manual-report-CLK_w7Fu.css"
"assets/manual-report-BCwcwvAZ.css"
]
},
"_manual-report-CLK_w7Fu.css": {
"file": "assets/manual-report-CLK_w7Fu.css",
"src": "_manual-report-CLK_w7Fu.css"
"_theme-CHgv-U5K.css": {
"file": "assets/theme-CHgv-U5K.css",
"src": "_theme-CHgv-U5K.css"
},
"_theme-CW8WI6CF.css": {
"file": "assets/theme-CW8WI6CF.css",
"src": "_theme-CW8WI6CF.css"
},
"_theme-DLdboZXJ.js": {
"file": "assets/theme-DLdboZXJ.js",
"_theme-DXAi27ON.js": {
"file": "assets/theme-DXAi27ON.js",
"name": "theme",
"css": [
"assets/theme-CW8WI6CF.css"
"assets/theme-CHgv-U5K.css"
]
},
"frontend/src/entries/admin-audio-preview.js": {
"file": "assets/frontend/src/entries/admin-audio-preview.js-B71K8d99.js",
"file": "assets/frontend/src/entries/admin-audio-preview.js-vLZXVaMY.js",
"name": "frontend/src/entries/admin-audio-preview.js",
"src": "frontend/src/entries/admin-audio-preview.js",
"isEntry": true,
"css": [
"assets/admin-audio-preview-GrJiPCWO.css"
"assets/admin-audio-preview-GrJiPCWO.css",
"assets/fonts-4o1Uz5dn.css"
]
},
"frontend/src/entries/admin-login.js": {
"file": "assets/frontend/src/entries/admin-login.js-CfSuUv-t.js",
"file": "assets/frontend/src/entries/admin-login.js-Bh9Fp4Fr.js",
"name": "frontend/src/entries/admin-login.js",
"src": "frontend/src/entries/admin-login.js",
"isEntry": true,
"css": [
"assets/admin-login-DfgxK8tz.css"
"assets/admin-login-CJd637Ns.css",
"assets/fonts-4o1Uz5dn.css"
]
},
"frontend/src/entries/dashboard.js": {
"file": "assets/frontend/src/entries/dashboard.js-ERuRY_J9.js",
"file": "assets/frontend/src/entries/dashboard.js-Bp7rX0Fc.js",
"name": "frontend/src/entries/dashboard.js",
"src": "frontend/src/entries/dashboard.js",
"isEntry": true,
"imports": [
"frontend/src/entries/fireworks-home.js",
"frontend/src/entries/map.js",
"_manual-report-BLClvilD.js",
"_theme-DLdboZXJ.js"
"_manual-report-DoPagyx-.js",
"_theme-DXAi27ON.js"
],
"css": [
"assets/dashboard-BLKe9w6Q.css",
"assets/fireworks-navigation-B0T7du8_.css"
"assets/dashboard-C1NKhBy7.css",
"assets/fonts-4o1Uz5dn.css",
"assets/fireworks-navigation-BViXwBBT.css",
"assets/field-notes-STCCElbj.css"
]
},
"frontend/src/entries/events.js": {
"file": "assets/frontend/src/entries/events.js-BOQifILX.js",
"file": "assets/frontend/src/entries/events.js-CoDvu5q7.js",
"name": "frontend/src/entries/events.js",
"src": "frontend/src/entries/events.js",
"isEntry": true,
"imports": [
"_theme-DLdboZXJ.js"
"_theme-DXAi27ON.js"
],
"css": [
"assets/events-CTJ_TfvY.css",
"assets/fireworks-navigation-B0T7du8_.css"
"assets/events-eRxioTQd.css",
"assets/fonts-4o1Uz5dn.css",
"assets/fireworks-navigation-BViXwBBT.css",
"assets/field-notes-STCCElbj.css"
]
},
"frontend/src/entries/fireworks-home.js": {
"file": "assets/frontend/src/entries/fireworks-home.js-CHsiS21S.js",
"file": "assets/frontend/src/entries/fireworks-home.js-CZsCTUTv.js",
"name": "frontend/src/entries/fireworks-home.js",
"src": "frontend/src/entries/fireworks-home.js",
"isEntry": true,
"imports": [
"_theme-DLdboZXJ.js"
"_theme-DXAi27ON.js"
],
"dynamicImports": [
"frontend/src/scripts/browser-submission-processor.js"
],
"css": [
"assets/fireworks-home-ofY4zwOZ.css",
"assets/fireworks-navigation-B0T7du8_.css"
"assets/fireworks-home-ojbnZX65.css",
"assets/fonts-4o1Uz5dn.css",
"assets/fireworks-navigation-BViXwBBT.css"
]
},
"frontend/src/entries/home.js": {
"file": "assets/frontend/src/entries/home.js-CZl35ei7.js",
"file": "assets/frontend/src/entries/home.js-Ds8f2Z8A.js",
"name": "frontend/src/entries/home.js",
"src": "frontend/src/entries/home.js",
"isEntry": true,
"imports": [
"_manual-report-BLClvilD.js",
"_theme-DLdboZXJ.js"
"_manual-report-DoPagyx-.js",
"_theme-DXAi27ON.js"
],
"css": [
"assets/home-tgr8z1B7.css"
"assets/home-BZbCv9Mm.css",
"assets/fonts-4o1Uz5dn.css"
]
},
"frontend/src/entries/legacy-fireworks-home.js": {
"file": "assets/frontend/src/entries/legacy-fireworks-home.js-BQuB64h2.js",
"file": "assets/frontend/src/entries/legacy-fireworks-home.js-Cod9E8XY.js",
"name": "frontend/src/entries/legacy-fireworks-home.js",
"src": "frontend/src/entries/legacy-fireworks-home.js",
"isEntry": true,
"imports": [
"_theme-DLdboZXJ.js"
"_theme-DXAi27ON.js"
],
"css": [
"assets/legacy-fireworks-home-DVDWazp8.css"
"assets/legacy-fireworks-home-C1-s3aRT.css",
"assets/fonts-4o1Uz5dn.css"
]
},
"frontend/src/entries/login.js": {
"file": "assets/frontend/src/entries/login.js-fU9bqtQj.js",
"file": "assets/frontend/src/entries/login.js-PEW1GjqV.js",
"name": "frontend/src/entries/login.js",
"src": "frontend/src/entries/login.js",
"isEntry": true,
"imports": [
"_theme-DLdboZXJ.js"
"_theme-DXAi27ON.js"
],
"css": [
"assets/login-CMTHjyC6.css"
"assets/login-CxDTcyYu.css",
"assets/fonts-4o1Uz5dn.css"
]
},
"frontend/src/entries/map.js": {
"file": "assets/frontend/src/entries/map.js-BA2PfDOg.js",
"file": "assets/frontend/src/entries/map.js-ZTK3kmoy.js",
"name": "frontend/src/entries/map.js",
"src": "frontend/src/entries/map.js",
"isEntry": true,
"imports": [
"_theme-DLdboZXJ.js"
"_theme-DXAi27ON.js"
],
"css": [
"assets/map-CUm_1Dqq.css",
"assets/fireworks-navigation-B0T7du8_.css"
"assets/map-CneBwLkV.css",
"assets/fonts-4o1Uz5dn.css",
"assets/fireworks-navigation-BViXwBBT.css"
]
},
"frontend/src/entries/member-form.js": {
"file": "assets/frontend/src/entries/member-form.js-B30CZoK0.js",
"file": "assets/frontend/src/entries/member-form.js-Di4vmLCq.js",
"name": "frontend/src/entries/member-form.js",
"src": "frontend/src/entries/member-form.js",
"isEntry": true,
"imports": [
"_theme-DLdboZXJ.js"
"_theme-DXAi27ON.js"
],
"css": [
"assets/member-form-BzsMXZtV.css"
"assets/member-form-CvIJ0BOZ.css",
"assets/fonts-4o1Uz5dn.css"
]
},
"frontend/src/entries/member-list.js": {
"file": "assets/frontend/src/entries/member-list.js-CfYXXJhy.js",
"file": "assets/frontend/src/entries/member-list.js-Buj1pYaw.js",
"name": "frontend/src/entries/member-list.js",
"src": "frontend/src/entries/member-list.js",
"isEntry": true,
"imports": [
"_theme-DLdboZXJ.js"
"_theme-DXAi27ON.js"
],
"css": [
"assets/member-list-D2ApQodm.css"
"assets/member-list-DxFGu1JS.css",
"assets/fonts-4o1Uz5dn.css"
]
},
"frontend/src/entries/member-success.js": {
"file": "assets/frontend/src/entries/member-success.js-BXfLAYYO.js",
"file": "assets/frontend/src/entries/member-success.js-By5Mf6TX.js",
"name": "frontend/src/entries/member-success.js",
"src": "frontend/src/entries/member-success.js",
"isEntry": true,
"imports": [
"_theme-DLdboZXJ.js"
"_theme-DXAi27ON.js"
],
"css": [
"assets/member-success-BCH60Gre.css"
"assets/member-success-Ck85tFD-.css",
"assets/fonts-4o1Uz5dn.css"
]
},
"frontend/src/entries/not-found.js": {
"file": "assets/frontend/src/entries/not-found.js-CuGnbXiG.js",
"file": "assets/frontend/src/entries/not-found.js-BtTrR72f.js",
"name": "frontend/src/entries/not-found.js",
"src": "frontend/src/entries/not-found.js",
"isEntry": true,
"imports": [
"_theme-DLdboZXJ.js"
"_theme-DXAi27ON.js"
],
"css": [
"assets/not-found-BeUv81Ot.css"
"assets/not-found-BuNpIK-z.css",
"assets/fonts-4o1Uz5dn.css"
]
},
"frontend/src/entries/settings.js": {
"file": "assets/frontend/src/entries/settings.js-SrQbM6Ii.js",
"file": "assets/frontend/src/entries/settings.js-s58FgvNQ.js",
"name": "frontend/src/entries/settings.js",
"src": "frontend/src/entries/settings.js",
"isEntry": true,
"imports": [
"_theme-DLdboZXJ.js"
"_theme-DXAi27ON.js"
],
"css": [
"assets/settings-B_NtXgaK.css"
"assets/settings-D3H5dzmU.css",
"assets/fonts-4o1Uz5dn.css",
"assets/fireworks-navigation-BViXwBBT.css"
]
},
"frontend/src/scripts/audio-preprocessor.js": {
"file": "assets/audio-preprocessor-B6FBlKED.js",
"name": "audio-preprocessor",
"src": "frontend/src/scripts/audio-preprocessor.js",
"isDynamicEntry": true
},
"frontend/src/scripts/browser-submission-gate.js": {
"file": "assets/browser-submission-gate-D8pBYGfs.js",
"name": "browser-submission-gate",
"src": "frontend/src/scripts/browser-submission-gate.js",
"isDynamicEntry": true
},
"frontend/src/scripts/browser-submission-processor.js": {
"file": "assets/browser-submission-processor-YT5vt2-z.js",
"name": "browser-submission-processor",
"src": "frontend/src/scripts/browser-submission-processor.js",
"isDynamicEntry": true,
"imports": [
"frontend/src/entries/fireworks-home.js",
"_theme-DXAi27ON.js"
],
"dynamicImports": [
"frontend/src/scripts/ffmpeg-video-extractor.js",
"frontend/src/scripts/audio-preprocessor.js",
"frontend/src/scripts/browser-yamnet-classifier.js",
"frontend/src/scripts/browser-submission-gate.js"
],
"css": [
"assets/fonts-4o1Uz5dn.css",
"assets/fireworks-navigation-BViXwBBT.css"
]
},
"frontend/src/scripts/browser-yamnet-classifier.js": {
"file": "assets/browser-yamnet-classifier-ldF6zTfh.js",
"name": "browser-yamnet-classifier",
"src": "frontend/src/scripts/browser-yamnet-classifier.js",
"isDynamicEntry": true,
"imports": [
"frontend/src/entries/fireworks-home.js",
"_theme-DXAi27ON.js"
],
"dynamicImports": [
"node_modules/@tensorflow/tfjs/dist/index.js"
],
"css": [
"assets/fonts-4o1Uz5dn.css",
"assets/fireworks-navigation-BViXwBBT.css"
]
},
"frontend/src/scripts/ffmpeg-video-extractor.js": {
"file": "assets/ffmpeg-video-extractor-KJPjcx9x.js",
"name": "ffmpeg-video-extractor",
"src": "frontend/src/scripts/ffmpeg-video-extractor.js",
"isDynamicEntry": true,
"imports": [
"frontend/src/entries/fireworks-home.js",
"_theme-DXAi27ON.js"
],
"dynamicImports": [
"node_modules/@ffmpeg/ffmpeg/dist/esm/index.js",
"node_modules/@ffmpeg/core/dist/esm/ffmpeg-core.js?url",
"node_modules/@ffmpeg/core/dist/esm/ffmpeg-core.wasm?url"
],
"css": [
"assets/fonts-4o1Uz5dn.css",
"assets/fireworks-navigation-BViXwBBT.css"
]
},
"node_modules/@ffmpeg/core/dist/esm/ffmpeg-core.js": {
"file": "assets/ffmpeg-core-CI9Irx9p.js",
"src": "node_modules/@ffmpeg/core/dist/esm/ffmpeg-core.js"
},
"node_modules/@ffmpeg/core/dist/esm/ffmpeg-core.js?url": {
"file": "assets/ffmpeg-core-CTa1UqMt.js",
"name": "ffmpeg-core",
"src": "node_modules/@ffmpeg/core/dist/esm/ffmpeg-core.js?url",
"isDynamicEntry": true,
"assets": [
"assets/ffmpeg-core-CI9Irx9p.js"
]
},
"node_modules/@ffmpeg/core/dist/esm/ffmpeg-core.wasm": {
"file": "assets/ffmpeg-core-CgUfceKH.wasm",
"src": "node_modules/@ffmpeg/core/dist/esm/ffmpeg-core.wasm"
},
"node_modules/@ffmpeg/core/dist/esm/ffmpeg-core.wasm?url": {
"file": "assets/ffmpeg-core-DJ3ydieg.js",
"name": "ffmpeg-core",
"src": "node_modules/@ffmpeg/core/dist/esm/ffmpeg-core.wasm?url",
"isDynamicEntry": true,
"assets": [
"assets/ffmpeg-core-CgUfceKH.wasm"
]
},
"node_modules/@ffmpeg/ffmpeg/dist/esm/index.js": {
"file": "assets/index-Cr8NHl2n.js",
"name": "index",
"src": "node_modules/@ffmpeg/ffmpeg/dist/esm/index.js",
"isDynamicEntry": true
},
"node_modules/@tensorflow/tfjs/dist/index.js": {
"file": "assets/index-jWGXPN38.js",
"name": "index",
"src": "node_modules/@tensorflow/tfjs/dist/index.js",
"isDynamicEntry": true
}
}
@@ -0,0 +1 @@
.field-notes{margin-top:1.5rem;padding:1rem;border:1px solid var(--theme-line);border-radius:1rem;color:var(--theme-ink);background:var(--theme-surface);overflow-wrap:anywhere}.field-notes h2{font-size:1.3rem}.field-notes p,.field-notes small{line-height:1.55}.field-notes details{margin:.8rem 0}.field-notes summary{cursor:pointer;padding:.4rem 0;font-weight:650}.field-notes form{margin-top:.8rem}.field-notes label,.field-notes small{display:block;margin:.4rem 0}.field-notes input,.field-notes select,.field-notes textarea{width:100%;max-width:100%;min-width:0;padding:.65rem;border:1px solid var(--theme-line);border-radius:.5rem;font:inherit;color:var(--theme-ink);background:var(--theme-input)}.field-notes textarea{resize:vertical}.field-notes button{margin-top:.7rem;padding:.65rem 1rem;border:1px solid var(--theme-line);border-radius:.5rem;background:var(--theme-surface-raised);color:var(--theme-ink);font:inherit;cursor:pointer}.field-notes :focus-visible{outline:3px solid #789eff;outline-offset:3px}.field-notes__fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem}.field-notes__timeline{padding-left:1.3rem}.field-notes__timeline>li{padding:.6rem 0 1rem .4rem;border-bottom:1px solid var(--theme-line)}.field-notes__content{white-space:pre-wrap}.field-notes__meta,.field-notes small{color:var(--theme-muted);font-size:.85rem}.field-notes .errorlist{color:#f28c96}@media(max-width:650px){.field-notes__fields{grid-template-columns:1fr}}
@@ -0,0 +1 @@
/* empty css *//* empty css */import"./fireworks-home.js-CZsCTUTv.js";import"./map.js-ZTK3kmoy.js";import"../../../manual-report-C-E8HQa9.js";import"../../../theme-DXAi27ON.js";/* empty css */
@@ -0,0 +1 @@
/* empty css *//* empty css */import"./fireworks-home.js-CZsCTUTv.js";import"./map.js-ZTK3kmoy.js";import"../../../manual-report-DoPagyx-.js";import"../../../theme-DXAi27ON.js";/* empty css */
@@ -0,0 +1 @@
/* empty css *//* empty css */import"./fireworks-home.js-CZsCTUTv.js";import"./map.js-ZTK3kmoy.js";import"../../../manual-report-v3jdwBHW.js";import"../../../theme-DXAi27ON.js";/* empty css */
@@ -0,0 +1 @@
/* empty css *//* empty css */import"./fireworks-home.js-CZsCTUTv.js";import"./map.js-ZTK3kmoy.js";import"../../../manual-report-CvfBM7VE.js";import"../../../theme-DXAi27ON.js";/* empty css */
@@ -0,0 +1 @@
/* empty css *//* empty css */import"./fireworks-home.js-CZsCTUTv.js";import"./map.js-ZTK3kmoy.js";import"../../../manual-report-DqrR4OFn.js";import"../../../theme-DXAi27ON.js";/* empty css */
@@ -0,0 +1 @@
/* empty css *//* empty css */import"../../../theme-DXAi27ON.js";/* empty css */
@@ -0,0 +1 @@
/* empty css */import"../../../manual-report-v3jdwBHW.js";import"../../../theme-DXAi27ON.js";
@@ -0,0 +1 @@
/* empty css */import"../../../manual-report-CvfBM7VE.js";import"../../../theme-DXAi27ON.js";
@@ -0,0 +1 @@
/* empty css */import"../../../manual-report-DqrR4OFn.js";import"../../../theme-DXAi27ON.js";
@@ -0,0 +1 @@
/* empty css */import"../../../manual-report-DoPagyx-.js";import"../../../theme-DXAi27ON.js";
@@ -0,0 +1 @@
/* empty css */import"../../../manual-report-C-E8HQa9.js";import"../../../theme-DXAi27ON.js";
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+4
View File
@@ -1,6 +1,10 @@
{% load i18n %}
<script>
window.BOOMCAST_I18N = {
now: "{% trans 'Now' as value %}{{ value|escapejs }}",
adjusted: "{% trans 'Adjusted' as value %}{{ value|escapejs }}",
invalidReportTime: "{% trans 'Enter a valid date and time.' as value %}{{ value|escapejs }}",
futureReportTime: "{% trans 'Report time cannot be in the future.' as value %}{{ value|escapejs }}",
noFile: "{% trans 'No file selected' as value %}{{ value|escapejs }}",
analysing: "{% trans 'Analysing your recording…' as value %}{{ value|escapejs }}",
analysisFailed: "{% trans 'Analysis could not be completed.' as value %}{{ value|escapejs }}",