From bfcb91e60f662fe741764e37c544840d83affef7 Mon Sep 17 00:00:00 2001 From: Jessica Lawshe Date: Wed, 19 Sep 2018 15:37:57 -0500 Subject: [PATCH] Hide content page links in nav when on dash --- services/web/app/views/layout/navbar.pug | 10 +++++++++- services/web/app/views/project/list.pug | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/services/web/app/views/layout/navbar.pug b/services/web/app/views/layout/navbar.pug index 0b162b27d2..4dff727167 100644 --- a/services/web/app/views/layout/navbar.pug +++ b/services/web/app/views/layout/navbar.pug @@ -27,8 +27,16 @@ nav.navbar.navbar-default.navbar-main // loop over header_extras each item in nav.header_extras + - + if ((item.only_when_logged_in && getSessionUser()) + || (item.only_when_logged_out && (!getSessionUser())) + || (!item.only_when_logged_out && !item.only_when_logged_in && !item.only_content_pages) + || (item.only_content_pages && (typeof(suppressNavContentLinks) == "undefined" || !suppressNavContentLinks)) + ){ + var showNavItem = true + } - if ((item.only_when_logged_in && getSessionUser()) || (item.only_when_logged_out && (!getSessionUser())) || (!item.only_when_logged_out && !item.only_when_logged_in)) + if showNavItem if item.dropdown li.dropdown(class=item.class, dropdown) a.dropdown-toggle(href, dropdown-toggle) diff --git a/services/web/app/views/project/list.pug b/services/web/app/views/project/list.pug index 984e304d1a..0fec00cb55 100644 --- a/services/web/app/views/project/list.pug +++ b/services/web/app/views/project/list.pug @@ -1,5 +1,8 @@ extends ../layout +block vars + - var suppressNavContentLinks = true + block content //- We need to do .replace(/\//g, '\\/') do that '' -> '<\/script>' //- and doesn't prematurely end the script tag.