From 7eb2c0a3a0b930cd3a8e17221a83e0fc2a805b9f Mon Sep 17 00:00:00 2001
From: Justin Cleveland <clevelandj@wustl.edu>
Date: Thu, 7 Jul 2016 17:05:23 -0500
Subject: [PATCH] Charlie's additional requests for XNAT-4248

---
 .../xnat/spawner/site-admin-elements.yaml         | 15 ++++-----------
 src/main/webapp/scripts/xnat/admin/pwExpType.js   |  5 +++--
 2 files changed, 7 insertions(+), 13 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 f8f947e6..13649cfe 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
@@ -49,9 +49,8 @@ passwordExpirationInterval:
         id: passwordExpirationInterval
         name: passwordExpirationInterval
         label: Password Expiration (Interval)
-    description: >
-                  Interval of time after which unchanged passwords expire and users have to change them. Enter "0" to disable. Uses
-                  <a target="_blank" href="http://www.postgresql.org/docs/9.0/static/functions-datetime.html">PostgreSQL interval notation</a>
+    after: >
+      <p class='description'>Interval of time after which unchanged passwords expire and users have to change them. Uses <a target="_blank" href="http://www.postgresql.org/docs/9.0/static/functions-datetime.html">PostgreSQL interval notation</a></p>
 
 passwordExpirationDate:
     tag: input
@@ -63,9 +62,6 @@ passwordExpirationDate:
         id: passwordExpirationDate
         name: passwordExpirationDate
         label: Password Expiration (Date)
-    description: >
-                  Expire passwords that were last changed before this date and require those users to change them. Enter "0" to disable. Dates must be formatted MM/DD/YYYY
-
 
 siteDescriptionType:
     kind: panel.element
@@ -474,10 +470,6 @@ passwords:
                             content: Date
                 passwordExpirationInterval:
                     tag: div.input-bundle.interval.inline
-                    after:
-                        label:
-                            tag: span#intervalUnits
-                            content: "&nbsp;days"
                     contents:
                         ${passwordExpirationInterval}
                 passwordExpirationDate:
@@ -485,7 +477,8 @@ passwords:
                     after:
                         label:
                             tag: span#datePicker
-                            content: "&nbsp;&nbsp;<span id='openCal-passwordExpirationDate' class='icon icon-sm icon-calendar'/>"
+                            content: >
+                              &nbsp;&nbsp;<span id='openCal-passwordExpirationDate' class='icon icon-sm icon-calendar'></span><br><p class='description'>Expire passwords that were last changed before this date and require those users to change them.</p>
                     contents:
                         ${passwordExpirationDate}
                 pwExpTypeJs:
diff --git a/src/main/webapp/scripts/xnat/admin/pwExpType.js b/src/main/webapp/scripts/xnat/admin/pwExpType.js
index a609160f..d488379e 100644
--- a/src/main/webapp/scripts/xnat/admin/pwExpType.js
+++ b/src/main/webapp/scripts/xnat/admin/pwExpType.js
@@ -4,6 +4,7 @@
     setTimeout(function(){
       fieldInterval = $('#passwordExpirationInterval');
       fieldDate = $('#passwordExpirationDate');
+      fieldDate.attr('placeholder', 'MM/DD/YYYY');
       openCal = $('#openCal-passwordExpirationDate');
       openCal.click(openCalendar);
       fieldInterval[0].style.width = '40px';
@@ -13,8 +14,8 @@
       fieldDate[0].style.marginTop='10px';
       fieldDate.datetimepicker({
         timepicker:false,
-        format:'d/m/Y',
-        minDate:'-1970/01/01' // today is minimum date
+        format:'m/d/Y',
+//        minDate:'-1970/01/01' // today is minimum date
       });
       sdtDisabled = $('#passwordExpirationTypeDisabled');
       sdtInterval = $('#passwordExpirationTypeInterval');
-- 
GitLab