Compare commits
34
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bca523be8a | ||
|
|
54f69077c1 | ||
|
|
206f5f2466 | ||
|
|
712af2839d | ||
|
|
aadadff69e | ||
|
|
ad78913bd5 | ||
|
|
4aa13de925 | ||
|
|
314eb6b4ec | ||
|
|
7559b61399 | ||
|
|
c45810762a | ||
|
|
a1662384dc | ||
|
|
686f536676 | ||
|
|
7d83caa27c | ||
|
|
c0c0bd7db8 | ||
|
|
d112028eb1 | ||
|
|
5820ea850a | ||
|
|
a54494c6a1 | ||
|
|
acb3b1f042 | ||
|
|
3c8bf956bf | ||
|
|
23b94b2b24 | ||
|
|
661bf3beaf | ||
|
|
c13a405d96 | ||
|
|
46ad514a70 | ||
|
|
1de4b8a0b3 | ||
|
|
c68e4b95ba | ||
|
|
beeb2b5e0e | ||
|
|
c93bead437 | ||
|
|
c047bd9843 | ||
|
|
13258e76c3 | ||
|
|
b676f35f0a | ||
|
|
66db97b6f7 | ||
|
|
884e2e8a11 | ||
|
|
a5dbbf3aed | ||
|
|
e572257f67 |
@@ -1,3 +1,10 @@
|
|||||||
vite_integration/static/vite/*
|
vite_integration/static/vite/*
|
||||||
!vite_integration/static/vite/.gitkeep
|
!vite_integration/static/vite/.gitkeep
|
||||||
node_modules/
|
node_modules/
|
||||||
|
|
||||||
|
# Local database and uploaded media
|
||||||
|
/db.sqlite3
|
||||||
|
/media/
|
||||||
|
|
||||||
|
# Local archives
|
||||||
|
*.zip
|
||||||
|
|||||||
BIN
Binary file not shown.
Binary file not shown.
@@ -53,6 +53,7 @@
|
|||||||
<small>{% trans "Optional. Without an accepted window, BoomCast reports the count without an intensity rating." %}</small>
|
<small>{% trans "Optional. Without an accepted window, BoomCast reports the count without an intensity rating." %}</small>
|
||||||
</div>
|
</div>
|
||||||
{% include "fireworks_detect/includes/manual_direction_panel.html" %}
|
{% include "fireworks_detect/includes/manual_direction_panel.html" %}
|
||||||
|
<label class="manual-report__check" for="manual-visually-confirmed"><input id="manual-visually-confirmed" name="visually_confirmed" type="checkbox"> {% trans "Visually confirmed" %}</label>
|
||||||
</div>
|
</div>
|
||||||
<section class="manual-report__supporting" data-state="off" aria-labelledby="manual-listening-title">
|
<section class="manual-report__supporting" data-state="off" aria-labelledby="manual-listening-title">
|
||||||
<div class="manual-report__supporting-header">
|
<div class="manual-report__supporting-header">
|
||||||
|
|||||||
@@ -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>
|
<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>
|
{% 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 %}
|
<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 %}
|
||||||
|
<p>{% trans "Visually confirmed" %}: {% if pending.visually_confirmed %}{% trans "Yes" %}{% else %}{% trans "No" %}{% endif %}</p>
|
||||||
{% 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 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">
|
{% 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 %}
|
{% csrf_token %}
|
||||||
|
|||||||
@@ -55,6 +55,24 @@ class ManualPendingEventTests(TestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.client.cookies["django_language"] = "en"
|
self.client.cookies["django_language"] = "en"
|
||||||
|
|
||||||
|
def test_manual_visual_confirmation_is_optional_and_survives_review(self):
|
||||||
|
url = reverse("fireworks_detect:submit_manual_pending")
|
||||||
|
for posted, expected in (({}, False), ({"visually_confirmed": "on"}, True)):
|
||||||
|
with self.subTest(confirmed=expected):
|
||||||
|
response = self.client.post(url, {"occurrences": "1", **posted})
|
||||||
|
self.assertEqual(response.status_code, 200)
|
||||||
|
pending = PendingEvent.objects.latest("pk")
|
||||||
|
self.assertEqual(pending.visually_confirmed, expected)
|
||||||
|
self.assertContains(response, f"Visually confirmed: {'Yes' if expected else 'No'}")
|
||||||
|
update_url = reverse("fireworks_detect:update_manual_pending", args=[pending.pk])
|
||||||
|
self.client.post(update_url, {"occurrences": "2"})
|
||||||
|
pending.refresh_from_db()
|
||||||
|
self.assertEqual(pending.visually_confirmed, expected)
|
||||||
|
event = pending.approve()
|
||||||
|
self.assertEqual(event.visually_confirmed, expected)
|
||||||
|
self.assertContains(self.client.get(reverse("fireworks_detect:event_detail", args=[event.pk])),
|
||||||
|
f"Visually confirmed</strong><span>{'Yes' if expected else 'No'}")
|
||||||
|
|
||||||
def test_manual_report_creates_a_timestamped_pending_event(self):
|
def test_manual_report_creates_a_timestamped_pending_event(self):
|
||||||
response = self.client.post(reverse("fireworks_detect:submit_manual_pending"), {
|
response = self.client.post(reverse("fireworks_detect:submit_manual_pending"), {
|
||||||
"occurrences": "4",
|
"occurrences": "4",
|
||||||
|
|||||||
@@ -577,6 +577,7 @@ def submit_manual_pending_event(request):
|
|||||||
latitude=latitude,
|
latitude=latitude,
|
||||||
longitude=longitude,
|
longitude=longitude,
|
||||||
h3_cell=h3_cell or "",
|
h3_cell=h3_cell or "",
|
||||||
|
visually_confirmed=request.POST.get("visually_confirmed") == "on",
|
||||||
direction_degrees=direction_degrees,
|
direction_degrees=direction_degrees,
|
||||||
direction_accuracy_degrees=direction_accuracy_degrees,
|
direction_accuracy_degrees=direction_accuracy_degrees,
|
||||||
direction_source="device_compass" if direction_degrees is not None else "",
|
direction_source="device_compass" if direction_degrees is not None else "",
|
||||||
|
|||||||
Binary file not shown.
BIN
Binary file not shown.
BIN
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.
@@ -1 +0,0 @@
|
|||||||
RIFF0000WAVEdata
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
RIFF0000WAVEdata
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
RIFF0000WAVEdata
|
|
||||||
Binary file not shown.
Binary file not shown.
@@ -1 +0,0 @@
|
|||||||
RIFF0000WAVEdata
|
|
||||||
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.
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.
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.
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.
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.
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.
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.
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.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user