Skip to content

Commit

Permalink
add navbar links to Incidents and Field Reports (#1580)
Browse files Browse the repository at this point in the history
This makes it much easier to navigate around IMS.
These links will style badly if the event name is very long, but there's
no problem at all for 4-character names, which are all that really
matter.

This commit also makes a few other minor style tweaks.
  • Loading branch information
srabraham authored Feb 6, 2025
1 parent 6bb671e commit 78c7e32
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ class FieldReportTemplatePage(Page):
"""

name: str = title
hideH1: bool = True
2 changes: 1 addition & 1 deletion src/ims/element/incident/report_template/template.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<!-- Identifiers -->

<div class="row">
<div class="row py-1">
<div class="col-sm-4">
<div class="py-1 input-group">
<label for="field_report_number" class="control-label input-group-text">FR #</label>
Expand Down
13 changes: 12 additions & 1 deletion src/ims/element/page/nav/template.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,23 @@
</ul>
</li>
</ul>

<!-- Links to Incidents and Field Reports for current event -->
<ul class="navbar-nav">
<li class="nav-item">
<a id="active-event-incidents" class="nav-link hidden" href="">Incidents</a>
</li>
<li class="nav-item">
<a id="active-event-field-reports" class="nav-link hidden" href="">Field Reports</a>
</li>
</ul>

<!-- this keeps the nav_login thing on the right when the events dropdown is hidden -->
<ul class="navbar-nav me-auto"/>

<!-- Theme dropdown -->
<ul class="navbar-nav">
<li class="nav-item dropdown">
<li class="nav-item dropdown" title="Color scheme">
<button class="btn btn-link nav-link py-2 px-0 px-lg-2 dropdown-toggle d-flex align-items-center"
id="bd-theme" type="button" aria-expanded="false" data-bs-toggle="dropdown"
data-bs-display="static" aria-label="Toggle theme (auto)">
Expand Down
8 changes: 8 additions & 0 deletions src/ims/element/static/ims.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,14 @@ function loadBody(success) {
if (typeof eventID !== "undefined") {
$(".event-id").text(eventID);
$(".event-id").addClass("active-event");

const eventIncidents = document.getElementById("active-event-incidents");
eventIncidents.setAttribute("href", urlReplace(url_viewIncidents));
eventIncidents.classList.remove("hidden");

const eventFieldReports = document.getElementById("active-event-field-reports");
eventFieldReports.setAttribute("href", urlReplace(url_viewFieldReports));
eventFieldReports.classList.remove("hidden");
}

if (success) {
Expand Down
1 change: 1 addition & 0 deletions src/ims/element/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

.navbar-brand {
--bs-navbar-brand-font-size: 1rem;
--bs-navbar-brand-margin-end: 0.5rem;
padding-bottom: 0;
}

Expand Down

0 comments on commit 78c7e32

Please sign in to comment.