manual submission redesign phase A
This commit is contained in:
@@ -1,16 +1,21 @@
|
||||
{% load i18n %}
|
||||
<section class="manual-report" aria-labelledby="manual-report-title">
|
||||
<p class="eyebrow">{% trans "Recording optional" %}</p>
|
||||
<header class="manual-report__header">
|
||||
<p class="eyebrow">{% trans "Quick report" %}</p>
|
||||
<h2 class="manual-report__title" id="manual-report-title">{% trans "Report fireworks now" %}</h2>
|
||||
<p class="manual-report__intro">{% trans "Choose how many times you heard fireworks, then send it straight to Pending. The report is timestamped now." %}</p>
|
||||
</header>
|
||||
<form id="manual-report-form" action="{% url "fireworks_detect:submit_manual_pending" %}" method="post" enctype="multipart/form-data" hx-post="{% url "fireworks_detect:submit_manual_pending" %}" hx-target="#manual-submission" hx-swap="outerHTML">
|
||||
{% csrf_token %}
|
||||
<label class="manual-report__label" for="manual-occurrences">{% trans "Number of occurrences" %}</label>
|
||||
<input id="manual-latitude" name="latitude" type="hidden">
|
||||
<input id="manual-longitude" name="longitude" type="hidden">
|
||||
<input id="manual-direction-degrees" name="direction_degrees" type="hidden">
|
||||
<input id="manual-direction-accuracy" name="direction_accuracy_degrees" type="hidden">
|
||||
<div class="manual-report__primary">
|
||||
<div class="manual-report__quantity">
|
||||
<label class="manual-report__label" for="manual-occurrences">{% trans "Number of occurrences" %}</label>
|
||||
<input id="manual-occurrences" name="occurrences" type="number" min="1" max="1000" value="1" required inputmode="numeric">
|
||||
</div>
|
||||
<div class="manual-direction-panel" id="manual-direction-panel" hidden>
|
||||
<strong class="manual-direction-panel__heading">{% trans "Direction" %} <span>({% trans "optional" %})</span></strong>
|
||||
<p class="manual-direction-panel__copy">{% trans "Point the top of your phone toward the fireworks, then capture a single compass reading." %}</p>
|
||||
@@ -18,6 +23,9 @@
|
||||
<div id="manual-direction-status" class="manual-direction-panel__status" aria-live="polite"></div>
|
||||
</div>
|
||||
<button id="manual-submit" class="manual-report__submit" type="button">{% trans "I heard fireworks — send to Pending" %}</button>
|
||||
</div>
|
||||
<section class="manual-report__supporting" aria-labelledby="manual-listening-title">
|
||||
<h3 id="manual-listening-title">{% trans "Automatic detection" %}</h3>
|
||||
<div class="burst-listener">
|
||||
<button id="burst-start" class="burst-listener__button" type="button">{% trans "Listen for next bang" %}</button>
|
||||
<div id="burst-panel" class="burst-listener__panel" hidden>
|
||||
@@ -33,6 +41,7 @@
|
||||
</div>
|
||||
<p id="burst-error" role="alert" hidden></p>
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
||||
<div id="manual-submission" class="manual-report__submission" aria-live="polite"></div>
|
||||
<div id="manual-compass" class="manual-compass" role="img" aria-label="{% trans 'Compass direction' %}" hidden>
|
||||
|
||||
@@ -4,6 +4,7 @@ import "../styles/pages/map.css";
|
||||
import "../styles/pages/dashboard.css";
|
||||
import "../styles/components/burst-listener.css";
|
||||
import "../styles/components/manual-compass.css";
|
||||
import "../styles/components/manual-report-structure.css";
|
||||
import "../styles/theme.css";
|
||||
import "../scripts/theme.js";
|
||||
import "../scripts/manual-report.js";
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import "../styles/pages/home.css";
|
||||
import "../styles/components/burst-listener.css";
|
||||
import "../styles/components/manual-compass.css";
|
||||
import "../styles/components/manual-report-structure.css";
|
||||
import "../styles/theme.css";
|
||||
import "../scripts/theme.js";
|
||||
import "../scripts/manual-report.js";
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
.manual-report__header {
|
||||
max-width: 42rem;
|
||||
}
|
||||
|
||||
.manual-report__primary {
|
||||
display: grid;
|
||||
gap: 1rem;
|
||||
max-width: 36rem;
|
||||
}
|
||||
|
||||
.manual-report__quantity {
|
||||
padding: 1rem;
|
||||
border: 1px solid #584891;
|
||||
border-radius: 1rem;
|
||||
background: #151932;
|
||||
}
|
||||
|
||||
.manual-report__quantity #manual-occurrences {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.manual-report__primary .manual-direction-panel {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.manual-report__primary .manual-report__submit {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.manual-report__supporting {
|
||||
max-width: 36rem;
|
||||
margin-top: 1.5rem;
|
||||
padding-top: 1.25rem;
|
||||
border-top: 1px solid #584891;
|
||||
}
|
||||
|
||||
.manual-report__supporting h3 {
|
||||
margin: 0;
|
||||
color: #d8cffd;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.manual-report__supporting .burst-listener {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
:root[data-theme="light"] .manual-report__quantity {
|
||||
border-color: #d9b4d8;
|
||||
background: #fff8fb;
|
||||
}
|
||||
|
||||
:root[data-theme="light"] .manual-report__supporting {
|
||||
border-color: #d9b4d8;
|
||||
}
|
||||
|
||||
:root[data-theme="light"] .manual-report__supporting h3 {
|
||||
color: #492846;
|
||||
}
|
||||
Reference in New Issue
Block a user