Skip to content

Commit

Permalink
Moved site alert message element to topnav
Browse files Browse the repository at this point in the history
  • Loading branch information
mollybsmith-noaa committed Nov 4, 2024
1 parent 7509eaa commit a80e779
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 69 deletions.
7 changes: 0 additions & 7 deletions meteor_packages/mats-common/templates/plotType/plot_type.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
<template name="plotType">
<div id="plotType" class="container pull-left" style="display: block">
<div
id="alertMessage"
class="row text-center"
style="display:{{alertMessageHidden}}"
>
<span style="color: red; font-size: large">{{alertMessage}}<br /><br /></span>
</div>
<div
class="row well well-sm pull-left"
style="background-color: #b1edff; margin-left: 2px"
Expand Down
24 changes: 0 additions & 24 deletions meteor_packages/mats-common/templates/plotType/plot_type.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,6 @@ Template.plotType.helpers({
// space out the plot type names to be more readable
return plotType.replace(/([A-Z][a-z])/g, " $1").trim();
},
alertMessageHidden() {
if (
matsCollections.Settings === undefined ||
matsCollections.Settings.findOne({}) === undefined
)
return "none";
const alertMessage = matsCollections.Settings.findOne({}).appMessage;
if (alertMessage === undefined || alertMessage === "") {
return "none";
}
return "block";
},
alertMessage() {
if (
matsCollections.Settings === undefined ||
matsCollections.Settings.findOne({}) === undefined
)
return "none";
const alertMessage = matsCollections.Settings.findOne({}).appMessage;
if (alertMessage === undefined || alertMessage === "") {
return "";
}
return alertMessage;
},
});

const matchPlotTypeSelector = function (plotType) {
Expand Down
63 changes: 25 additions & 38 deletions meteor_packages/mats-common/templates/topnav/top_nav.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
<template name="topNav">
<div
id="navbar"
style="
display: block;
height: 100%;
margin-bottom: 0;
margin-top: 0;
padding-top: 0;
padding-bottom: 0;
"
alt="Collection of elements at the top of the MATS page"
style="margin-bottom: 2em"
>
<nav
id="officialUSABanner"
class="navbar navbar-default"
alt="Official USA governemnt website banner"
style="
height: 100%;
margin-bottom: 0;
Expand Down Expand Up @@ -42,13 +37,8 @@
data-toggle="collapse"
>
<div class="col-sm d-flex">
<div class="">
<img
class=""
style="width: 15px"
src="{{flagLogo}}"
alt="U.S. flag"
/>
<div>
<img style="width: 15px" src="{{flagLogo}}" alt="U.S. flag" />
<span
>An official website of the United States government
<button
Expand Down Expand Up @@ -81,7 +71,6 @@
<div style="display: flex; width: 100%">
<div style="width: 50%; padding: 2em">
<img
class=""
style="width: 25px"
src="{{govLogo}}"
alt="Official US Government Icon"
Expand All @@ -93,12 +82,7 @@
>
</div>
<div style="width: 50%; padding: 2em">
<img
class=""
style="width: 25px"
src="{{httpsLogo}}"
alt="Secure Site Icon"
/>
<img style="width: 25px" src="{{httpsLogo}}" alt="Secure Site Icon" />
<small>
<strong>Secure .gov websites use HTTPS</strong>
<br />
Expand All @@ -115,6 +99,7 @@
<nav
id="MATSNavigationBar"
class="navbar navbar-default"
alt="Navigation bar with MATS administative links"
style="
color: white;
background: #000066;
Expand All @@ -126,7 +111,6 @@
"
>
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button
type="button"
Expand Down Expand Up @@ -154,7 +138,7 @@
padding-right: 1em;
"
src="{{transparentGif}}"
alt="NOAA"
alt="NOAA logo"
/></a>
</div>

Expand Down Expand Up @@ -199,23 +183,26 @@
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
<nav
<div
id="disclaimerBar"
class="navbar navbar-default"
style="color: black; background: #dfefff; font-weight: bold; height: 100%"
class="alert alert-info"
alt="Disclaimer about this site being for research purposes"
style="color: black; margin-bottom: 0"
>
<div class="navbar-header">
<div id="disclaimerText" style="margin: 0.5em; text-align: center">
PLEASE NOTE: The information on this website is for RESEARCH PURPOSES ONLY. No
data from this site should be used to make decisions related to the safety of
life and property. There is no guarantee that data will be updated or that any
product will continue to be available.
</div>
</div>
</nav>
PLEASE NOTE: The information on this website is for RESEARCH PURPOSES ONLY. No
data from this site should be used to make decisions related to the safety of life
and property. There is no guarantee that data will be updated or that any product
will continue to be available.
</div>
<div
id="alertBar"
class="alert alert-danger"
alt="Space for app-specific alerts"
style="color: black; margin-bottom: 0; display:{{alertMessageHidden}}"
>
{{alertMessage}}
</div>
</div>
</template>
24 changes: 24 additions & 0 deletions meteor_packages/mats-common/templates/topnav/top_nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,30 @@ Template.topNav.helpers({
}
return false;
},
alertMessageHidden() {
if (
matsCollections.Settings === undefined ||
matsCollections.Settings.findOne({}) === undefined
)
return "none";
const alertMessage = matsCollections.Settings.findOne({}).appMessage;
if (alertMessage === undefined || alertMessage === "") {
return "none";
}
return "block";
},
alertMessage() {
if (
matsCollections.Settings === undefined ||
matsCollections.Settings.findOne({}) === undefined
)
return "none";
const alertMessage = matsCollections.Settings.findOne({}).appMessage;
if (alertMessage === undefined || alertMessage === "") {
return "";
}
return alertMessage;
},
});

Template.topNav.events({
Expand Down

0 comments on commit a80e779

Please sign in to comment.