From a80e779743239419d62645fe59422ae1416dcd7b Mon Sep 17 00:00:00 2001 From: Molly Smith Date: Mon, 4 Nov 2024 11:34:04 -0700 Subject: [PATCH] Moved site alert message element to topnav --- .../templates/plotType/plot_type.html | 7 --- .../templates/plotType/plot_type.js | 24 ------- .../mats-common/templates/topnav/top_nav.html | 63 ++++++++----------- .../mats-common/templates/topnav/top_nav.js | 24 +++++++ 4 files changed, 49 insertions(+), 69 deletions(-) diff --git a/meteor_packages/mats-common/templates/plotType/plot_type.html b/meteor_packages/mats-common/templates/plotType/plot_type.html index ac13104d5..fd3f6a029 100644 --- a/meteor_packages/mats-common/templates/plotType/plot_type.html +++ b/meteor_packages/mats-common/templates/plotType/plot_type.html @@ -1,12 +1,5 @@ diff --git a/meteor_packages/mats-common/templates/topnav/top_nav.js b/meteor_packages/mats-common/templates/topnav/top_nav.js index 562018f58..16ca18c5a 100644 --- a/meteor_packages/mats-common/templates/topnav/top_nav.js +++ b/meteor_packages/mats-common/templates/topnav/top_nav.js @@ -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({