From 2cf5bf47d34ac27a14a92dc7844e4811742c26c7 Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 13 May 2026 15:32:17 +0000 Subject: [PATCH] refactor(nav): collapse fleet/device pages into one sidebar entry with internal tab strip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The sidebar had 10 entries with 5 of them (Devices, Seismographs, Sound Level Meters, Modems, Pair Devices) all about the physical fleet plus SFM Events as a debug surface. Operators kept asking "where do I find BE11529?" without knowing whether it was a seismograph / SLM / modem. This collapses those 5+1 into a single "Fleet" sidebar entry that opens into a unified tab strip across the top of the four device pages. Each page keeps its existing custom layout (seismograph-specific calibration/deployment columns, SLM live-status panel, modem pairing view, all-devices roster). The strip just provides the navigation + the "Pair Devices" button as an action. Sidebar before (10 items): Dashboard · Devices · Seismographs · SFM Events · Sound Level Meters Modems · Pair Devices · Projects · Job Planner · Settings Sidebar after (5 items): Dashboard · Fleet · Projects · Job Planner · Settings Changes: - templates/partials/fleet_tab_strip.html (new): the shared tab strip. Auto-detects the active tab from request.url.path. 4 tabs (Seismographs / Sound Level Meters / Modems / All Devices) plus a "Pair Devices" button on the right. - templates/{seismographs,sound_level_meters,modems,roster}.html: added {% include 'partials/fleet_tab_strip.html' %} as the first thing inside the content block. No other changes to those templates' existing layouts. - templates/base.html: replaced the 6 device-related sidebar links with one "Fleet" link to /seismographs. The Fleet entry is highlighted when the current URL is any of /seismographs, /sound-level-meters, /modems, /roster, /pair-devices, /unit/*, or /slm/*. - templates/settings.html: SFM Events moved out of the main nav into a new "SFM Admin" card under Settings → Developer. Daily event browsing already lives on project / location / unit pages (Phases 1+2+3); the standalone /sfm page is now admin / cross-project debug surface only. URLs unchanged — all bookmarks / deep links still work. /sfm still serves the standalone page, it's just no longer in the main nav. Mobile bottom-nav unaffected. Co-Authored-By: Claude Opus 4.7 --- templates/base.html | 49 ++++++---------------- templates/modems.html | 1 + templates/partials/fleet_tab_strip.html | 54 +++++++++++++++++++++++++ templates/roster.html | 1 + templates/seismographs.html | 1 + templates/settings.html | 14 +++++++ templates/sound_level_meters.html | 1 + 7 files changed, 85 insertions(+), 36 deletions(-) create mode 100644 templates/partials/fleet_tab_strip.html diff --git a/templates/base.html b/templates/base.html index 4385b0e..c869e0f 100644 --- a/templates/base.html +++ b/templates/base.html @@ -109,45 +109,22 @@ Dashboard - - - - - Devices - - - + {# Fleet — single sidebar entry for all device-type pages. + The tab strip on each underlying page (Seismographs / + Sound Level Meters / Modems / All Devices) handles + navigation between the device-type-specific layouts. + Active when on any /seismographs, /sound-level-meters, + /modems, /roster, /pair-devices, /unit/* page. #} + {% set _is_fleet = ( + request.url.path in ('/seismographs', '/sound-level-meters', '/modems', '/roster', '/pair-devices') + or request.url.path.startswith('/unit/') + or request.url.path.startswith('/slm/') + ) %} + - Seismographs - - - - - - SFM Events - - - - - - - Sound Level Meters - - - - - - - Modems - - - - - - - Pair Devices + Fleet diff --git a/templates/modems.html b/templates/modems.html index 46dce54..a815e9e 100644 --- a/templates/modems.html +++ b/templates/modems.html @@ -3,6 +3,7 @@ {% block title %}Field Modems - Terra-View{% endblock %} {% block content %} +{% include "partials/fleet_tab_strip.html" %}

diff --git a/templates/partials/fleet_tab_strip.html b/templates/partials/fleet_tab_strip.html new file mode 100644 index 0000000..5fb879a --- /dev/null +++ b/templates/partials/fleet_tab_strip.html @@ -0,0 +1,54 @@ +{# Fleet tab strip. + +Shared header for every page under the "Fleet" sidebar section. Each +underlying page (/roster, /seismographs, /sound-level-meters, /modems) +keeps its own custom layout — this partial just provides the tab +navigation across the top so they feel like one logical area. + +The active tab is detected from request.url.path so deep links work. + +Usage at top of any Fleet-section template: + {% include 'partials/fleet_tab_strip.html' %} +#} +{% set _path = request.url.path %} + diff --git a/templates/roster.html b/templates/roster.html index fed2856..bc6ad66 100644 --- a/templates/roster.html +++ b/templates/roster.html @@ -3,6 +3,7 @@ {% block title %}Devices - Seismo Fleet Manager{% endblock %} {% block content %} +{% include "partials/fleet_tab_strip.html" %}
diff --git a/templates/seismographs.html b/templates/seismographs.html index b7c11a7..4cdae1b 100644 --- a/templates/seismographs.html +++ b/templates/seismographs.html @@ -3,6 +3,7 @@ {% block title %}Seismographs - Seismo Fleet Manager{% endblock %} {% block content %} +{% include "partials/fleet_tab_strip.html" %}

Seismographs

Manage and monitor seismograph units

diff --git a/templates/settings.html b/templates/settings.html index caf7e51..445455f 100644 --- a/templates/settings.html +++ b/templates/settings.html @@ -561,6 +561,20 @@
+ +
+
+
SFM Admin
+
+ Raw event database from SFM — cross-project event search, file downloads, debug view. Day-to-day event browsing lives on project / location / unit pages. +
+
+ + Open + +
+
diff --git a/templates/sound_level_meters.html b/templates/sound_level_meters.html index a467dc8..a843612 100644 --- a/templates/sound_level_meters.html +++ b/templates/sound_level_meters.html @@ -3,6 +3,7 @@ {% block title %}Sound Level Meters - Seismo Fleet Manager{% endblock %} {% block content %} +{% include "partials/fleet_tab_strip.html" %}