From a829a4b709b61a1ac44eb006164d37ead0212b79 Mon Sep 17 00:00:00 2001 From: Justin Cleveland <clevelandj@wustl.edu> Date: Fri, 5 Aug 2016 16:13:47 -0500 Subject: [PATCH] XNAT-4208 - Admin UI needs help indicators or descriptions, XNAT-4248 - passwordExpirationType should be a set of radio buttons, XNAT-1649 - Archive mount point is missing, but system runs without a message --- .../xnat/spawner/site-admin-elements.yaml | 4 +++ src/main/webapp/WEB-INF/tags/page/xnat.tag | 3 ++ src/main/webapp/page/admin/content.jsp | 9 ++++++ .../webapp/scripts/xnat/admin/pwExpType.js | 29 ++++++++++++++++++- src/main/webapp/scripts/xnat/ui/panel.js | 7 +++++ .../xnat-templates/navigations/DefaultTop.vm | 28 +++++++++--------- 6 files changed, 65 insertions(+), 15 deletions(-) diff --git a/src/main/resources/META-INF/xnat/spawner/site-admin-elements.yaml b/src/main/resources/META-INF/xnat/spawner/site-admin-elements.yaml index c1d5acb1..b61ed921 100644 --- a/src/main/resources/META-INF/xnat/spawner/site-admin-elements.yaml +++ b/src/main/resources/META-INF/xnat/spawner/site-admin-elements.yaml @@ -68,6 +68,8 @@ siteDescriptionType: #id: siteDescriptionType #name: siteDescriptionType label: Site Description + info: > + <p>The site description will show up on the login page and can be utilized to describe the purpose of this site, or notify users of important application status messages (ie. "The system is down for maintenance").</p><p>Administrators can opt to display a simple text message, or specify a velocity template reference containing the content to be displayed.</p> contents: info: tag: p @@ -429,6 +431,8 @@ passwords: passwordExpiration: kind: panel.element label: Password Expiration + info: > + <p>A <b>password expiration interval</b> specifies the length of time users have before they must change their passwords (Specified in <a target="_blank" href="http://www.postgresql.org/docs/9.0/static/functions-datetime.html">PostgreSQL interval notation</a>)</p><p>Alternatively, a <b>password expiration date</b> can be configured to expire passwords that were last changed before it. This is useful for purging access to obsolete accounts.</p> contents: info: tag: p diff --git a/src/main/webapp/WEB-INF/tags/page/xnat.tag b/src/main/webapp/WEB-INF/tags/page/xnat.tag index 88f301eb..f7df9f1e 100644 --- a/src/main/webapp/WEB-INF/tags/page/xnat.tag +++ b/src/main/webapp/WEB-INF/tags/page/xnat.tag @@ -155,6 +155,9 @@ <!-- YUI css --> <%--<link rel="stylesheet" type="text/css" href="${SITE_ROOT}/scripts/yui/build/assets/skins/sam/skin.css?v=1.7.0a1">--%> + + <!-- Icon sets --> + <link rel="stylesheet" type="text/css" href="${SITE_ROOT}/style/icons.css?${versionString}"> <!-- xdat.css and xnat.css loaded last to override YUI styles --> <link rel="stylesheet" type="text/css" href="${SITE_ROOT}/style/app.css?${versionString}"> diff --git a/src/main/webapp/page/admin/content.jsp b/src/main/webapp/page/admin/content.jsp index d6e095f4..bf022db3 100755 --- a/src/main/webapp/page/admin/content.jsp +++ b/src/main/webapp/page/admin/content.jsp @@ -82,6 +82,7 @@ var adminTabs = XNAT.spawner.spawn(data); adminTabs.render(XNAT.tabs.container, 500, function(){ + initInfoLinks(); //if (window.location.hash) { // XNAT.ui.tab.select(getUrlHashValue()); //} @@ -94,6 +95,14 @@ }); })(); + + function initInfoLinks(){ + $('.infolink').click(function(e){ + var idx = this.id.substr(9); + var help = infoContent[idx]; + xmodal.message(help.title, help.content); + }); + }; </script> </div> diff --git a/src/main/webapp/scripts/xnat/admin/pwExpType.js b/src/main/webapp/scripts/xnat/admin/pwExpType.js index 029720d5..8e7abe8f 100644 --- a/src/main/webapp/scripts/xnat/admin/pwExpType.js +++ b/src/main/webapp/scripts/xnat/admin/pwExpType.js @@ -13,7 +13,7 @@ fieldDate.datetimepicker({ timepicker:false, format:'m/d/Y', - maxDate:'1970/01/01' // today is max date, disallow future date selection + maxDate:'+1970/01/01' // today is max date, disallow future date selection }); sdtDisabled = $('#passwordExpirationTypeDisabled'); sdtInterval = $('#passwordExpirationTypeInterval'); @@ -22,6 +22,11 @@ sdtInterval.click(changePasswordExpirationType); sdtDate.click(changePasswordExpirationType); changePasswordExpirationType(XNAT.data.siteConfig.passwordExpirationType); + reuseDisabled = $('#passwordReuseTypeDisabled'); + reuseHistorical = $('#passwordReuseTypeHistorical'); + reuseDisabled.click(changePasswordReuseType); + reuseHistorical.click(changePasswordReuseType); + changePasswordReuseType(XNAT.data.siteConfig.passwordReuseRestriction); }, 1); function openCalendar(){ @@ -70,4 +75,26 @@ intervalUnits.hide(); } } + + function changePasswordReuseType(eventOrValue){ + var value = eventOrValue; + if (typeof eventOrValue === 'object') { + if (eventOrValue.target.id == "passwordReuseTypeHistorical") { + value = 'Historical'; + } else { + value = 'Disabled'; + } + } + reuseDisabled.val(value); + reuseHistorical.val(value); + var interval = $('div.input-bundle.reuseInterval'); + if (value == 'Disabled') { + reuseDisabled.prop('checked', true); + interval.val(-1); + interval.hide(); + } else if (value == 'Historical') { + reuseHistorical.prop('checked', true); + interval.show(); + } + } })(); diff --git a/src/main/webapp/scripts/xnat/ui/panel.js b/src/main/webapp/scripts/xnat/ui/panel.js index f185ac63..98b1dc8e 100644 --- a/src/main/webapp/scripts/xnat/ui/panel.js +++ b/src/main/webapp/scripts/xnat/ui/panel.js @@ -651,6 +651,12 @@ var XNAT = getObject(XNAT || {}); // 'contents' will be inserted into the 'target' element _target = spawn('div.element-wrapper'); + // add a help info icon if one is specified + if (opts.info){ + _inner.push(['span#infolink-'+infoId+'.infolink.icon.icon-sm.icon-status.icon-qm','']); + infoContent[infoId++] = {label:opts.label, content:opts.info}; + } + // add the target to the content array _inner.push(_target); @@ -1332,3 +1338,4 @@ var XNAT = getObject(XNAT || {}); })(XNAT, jQuery, window); +var infoId = 0, infoContent = []; diff --git a/src/main/webapp/xnat-templates/navigations/DefaultTop.vm b/src/main/webapp/xnat-templates/navigations/DefaultTop.vm index 33a30d78..0bdf0aa6 100644 --- a/src/main/webapp/xnat-templates/navigations/DefaultTop.vm +++ b/src/main/webapp/xnat-templates/navigations/DefaultTop.vm @@ -65,6 +65,20 @@ }) </script> +#if ($siteConfig.pathErrorWarning != "") + <div id="warning_bar" style="display:none;"> + <span class="close"><img src="$content.getURI('images/close.gif')"></span> + <span> + XNAT System Path Verification Failure: Contact your system administrator + <span class="tip_text">(<i>what does this mean?</i>) + <span class="tip shadowed"> + $siteConfig.pathErrorWarning + </span> + </span> + </span> + </div> +#end + #if ($sessionCount > 1 || $sessionIpCount > 1 ) ##If you want fewer warnings, you can eliminate $sessionCount > 1 so it will not display a warning for multiple sessions on the same IP, or increase it to $sessionCount > X where X is the maximum number of sessions you can have on the same IP before you get a warning. <div id="warning_bar" style="display:none;"> @@ -91,20 +105,6 @@ </div> #end -#if ($siteConfig.pathErrorWarning != "") - <div id="warning_bar" style="display:none;"> - <span class="close"><img src="$content.getURI('images/close.gif')"></span> - <span> - XNAT System Path Verification Failure: Contact your system administrator - <span class="tip_text">(<i>what does this mean?</i>) - <span class="tip shadowed"> - $siteConfig.pathErrorWarning - </span> - </span> - </span> - </div> -#end - <div id="main_nav"> <div class="inner"> -- GitLab