Skip to content

Commit

Permalink
Merge branch 'release/3.1.42'
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelekm committed Jan 18, 2024
2 parents 8d4ca82 + e23d08c commit 976f037
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 7 additions & 3 deletions python/cac_tripplanner/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,18 @@
jQuery.noConflict(); // because JotForms.
// Hide top alert banner across pages on close
jQuery(document).ready(function ($) {
const hideBanner = localStorage.getItem('hide-top-alert-banner') || false;
if(!hideBanner){
// update this for every new alert to match id in alert-banner.html
var alertId = 'gophillygo-alert-2024-01-12',
hasAlertMessage = jQuery('.alert-body').text().trim(),
wasAlreadyHidden = localStorage.getItem(alertId) || false,
shouldShowBanner = hasAlertMessage && !wasAlreadyHidden;
if(shouldShowBanner){
jQuery('.nav-banner').removeClass('hidden');
};

jQuery('.nav-banner').on('click', function(e) {
e.stopPropagation();
localStorage.setItem('hide-top-alert-banner', true);
localStorage.setItem(alertId, true);
jQuery('.nav-banner').addClass('hidden');
});
});
Expand Down
6 changes: 5 additions & 1 deletion python/cac_tripplanner/templates/partials/alert-banner.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<div class="nav-banner alert-warning hidden">
<div class="alert-body">Message for all of our Android app users: after January 1, 2024, we will no longer be supporting the app, but the GoPhillyGo mobile website will continue to be available across all devices.</div>
<div class="alert-body">
<!-- Alert ID gophillygo-alert-2024-01-12 -->
<!-- Add text here and update the Alert ID comment above to match
alertId in base.html. Will show an alert at the top of the page. -->
</div>
<button title="Dismiss this message" name="close"
class="btn-dismiss-nav-banner"><i class="icon-cancel"></i>
</button>
Expand Down

0 comments on commit 976f037

Please sign in to comment.