Skip to content

Commit

Permalink
Added official governemtn website banner
Browse files Browse the repository at this point in the history
  • Loading branch information
mollybsmith-noaa committed Nov 1, 2024
1 parent 45730ea commit e027e1d
Show file tree
Hide file tree
Showing 6 changed files with 131 additions and 81 deletions.
3 changes: 3 additions & 0 deletions meteor_packages/mats-common/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ Package.onUse(function (api) {
api.addAssets("public/img/arrow-right.gif", "client");
api.addAssets("public/img/arrow-up.gif", "client");
api.addAssets("public/img/bg.png", "client");
api.addAssets("public/img/us_flag_small.png", "client");
api.addAssets("public/img/icon-dot-gov.svg", "client");
api.addAssets("public/img/icon-https.svg", "client");
api.addAssets("public/img/noaa_transparent.png", "client");
api.addAssets("public/img/spinner.gif", "client");
api.addAssets("public/img/building_spinner.gif", "client");
Expand Down
1 change: 1 addition & 0 deletions meteor_packages/mats-common/public/img/icon-dot-gov.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions meteor_packages/mats-common/public/img/icon-https.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
153 changes: 86 additions & 67 deletions meteor_packages/mats-common/templates/topnav/top_nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
id="topnav"
class="navbar navbar-default"
style="
color: white;
background: #006699;
height: 100%;
margin-bottom: 0;
margin-top: 0;
Expand All @@ -24,54 +22,95 @@
"
>
<div class="container-fluid">
<div class="navbar-header" style="color: cyan; padding-left: 5px">
<button
type="button"
class="navbar-toggle collapsed"
data-toggle="collapse"
data-target="#navbar-collapse-1"
aria-expanded="false"
>
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="{{productLink}}">
<i
style="color: cyan; padding-top: 10px"
class="fa-solid fa-house-chimney fa-2x"
aria-hidden="true"
></i
></a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="navbar-collapse-1">
<ul class="nav navbar-nav">
<li>
<a href="http://www.doc.gov/" target="_blank"
><span style="color: white">U.S. Department of Commerce</span></a
<div
class="row"
style="
height: 100%;
margin-bottom: 0;
margin-top: 0.75em;
padding-left: 2em;
padding-right: 1em;
"
>
<div class="col-12" id="accordion">
<header class="header" id="headingOne">
<div
aria-controls="collapseOne"
aria-expanded="false"
class="collapsed small row"
data-target="#collapseOne"
data-toggle="collapse"
>
</li>
<li>
<a href="http://www.noaa.gov/" target="_blank"
><span style="color: white"
>National Oceanic and Atmospheric Administration</span
></a
>
</li>
{{#unless isMetexpress}}
<li>
<a href="http://research.noaa.gov/" target="_blank"
><span style="color: white">NOAA Research</span></a
<div class="col-sm d-flex">
<div class="">
<img
class=""
style="width: 15px"
src="{{flagLogo}}"
alt="U.S. flag"
/>
<span
>An official website of the United States government
<button
style="
cursor: pointer;
text-transform: none;
border: none;
background-color: inherit;
"
>
<span style="color: #005ea2; text-decoration: underline"
>Here's how you know<i
class="fa-solid fa-caret-down"
style="margin-left: 5px"
></i
></span></button
></span>
</div>
</div>
</div>
</header>
</div>
</div>
<div
aria-labelledby="headingOne"
class="collapse"
data-parent="#accordion"
id="collapseOne"
>
<div style="display: flex; width: 100%">
<div style="width: 50%; padding: 2em;">
<img
class=""
style="width: 25px"
src="{{govLogo}}"
alt="Official US Government Icon"
/>
<small
><strong>Official websites use .gov</strong><br />A
<strong>.gov</strong> website belongs to an official government
organization in the United States.</small
>
</li>
{{/unless}}
</ul>
</div>
<div style="width: 50%; padding: 2em;">
<img
class=""
style="width: 25px"
src="{{httpsLogo}}"
alt="Secure Site Icon"
/>
<small>
<strong>Secure .gov websites use HTTPS</strong>
<br />
A <strong>lock</strong> (
<i class="fa-solid fa-lock"></i>
) or <strong>https://</strong> means you’ve safely connected to the .gov
website. Share sensitive information only on official, secure websites.
</small>
</div>
</div>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
<nav
id="topnav1"
Expand Down Expand Up @@ -104,7 +143,7 @@
<a
style="margin-bottom: 0; margin-top: 0; padding: 0"
class="navbar-brand"
href="https://www.noaa.gov"
href="{{productLink}}"
target="_blank"
><img
style="
Expand Down Expand Up @@ -164,25 +203,5 @@
</div>
<!-- /.container-fluid -->
</nav>
{{#unless isMetexpress}}
<div
style="
background-color: #dddddd;
height: 100%;
margin-bottom: 0;
margin-top: 0;
padding-left: 1em;
padding-right: 0;
"
class="container-fluid"
>
<a
style="font-size: large; font-weight: bold"
href="https://gsl.noaa.gov/research/research-divisions"
target="_blank"
>GSL Modeling</a
>
</div>
{{/unless}}
</div>
</template>
54 changes: 40 additions & 14 deletions meteor_packages/mats-common/templates/topnav/top_nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,49 @@ const getRunEnvironment = function () {
return null;
};

const getBaseURL = function () {
const urlComponents = document.location.href.split("/");
const baseURL =
Meteor.settings.public.home === undefined
? `https://${urlComponents[2]}`
: Meteor.settings.public.home;
const appName =
matsCollections.Settings === undefined ||
matsCollections.Settings.findOne({}) === undefined ||
matsCollections.Settings.findOne({}).appName === undefined
? `${urlComponents[urlComponents.length - 1]}`
: matsCollections.Settings.findOne({}).appName;
return { appName, baseURL };
};

Template.topNav.helpers({
govLogo() {
const urlParams = getBaseURL();
if (urlParams.baseURL.includes("localhost")) {
return `${urlParams.baseURL}/packages/randyp_mats-common/public/img/icon-dot-gov.svg`;
}
return `${urlParams.baseURL}/${urlParams.appName}/packages/randyp_mats-common/public/img/icon-dot-gov.svg`;
},
httpsLogo() {
const urlParams = getBaseURL();
if (urlParams.baseURL.includes("localhost")) {
return `${urlParams.baseURL}/packages/randyp_mats-common/public/img/icon-https.svg`;
}
return `${urlParams.baseURL}/${urlParams.appName}/packages/randyp_mats-common/public/img/icon-https.svg`;
},
flagLogo() {
const urlParams = getBaseURL();
if (urlParams.baseURL.includes("localhost")) {
return `${urlParams.baseURL}/packages/randyp_mats-common/public/img/us_flag_small.png`;
}
return `${urlParams.baseURL}/${urlParams.appName}/packages/randyp_mats-common/public/img/us_flag_small.png`;
},
transparentGif() {
const urlComponents = document.location.href.split("/");
const baseURL =
Meteor.settings.public.home === undefined
? `https://${urlComponents[2]}`
: Meteor.settings.public.home;
const appName =
matsCollections.Settings === undefined ||
matsCollections.Settings.findOne({}) === undefined ||
matsCollections.Settings.findOne({}).appName === undefined
? `${urlComponents[urlComponents.length - 1]}`
: matsCollections.Settings.findOne({}).appName;
if (baseURL.includes("localhost")) {
return `${baseURL}/packages/randyp_mats-common/public/img/noaa_transparent.png`;
const urlParams = getBaseURL();
if (urlParams.baseURL.includes("localhost")) {
return `${urlParams.baseURL}/packages/randyp_mats-common/public/img/noaa_transparent.png`;
}
return `${baseURL}/${appName}/packages/randyp_mats-common/public/img/noaa_transparent.png`;
return `${urlParams.baseURL}/${urlParams.appName}/packages/randyp_mats-common/public/img/noaa_transparent.png`;
},
emailText() {
switch (getRunEnvironment()) {
Expand Down

0 comments on commit e027e1d

Please sign in to comment.