roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject roller git commit: Converted New User Registration page to use Struts2/Bootstrap plugin.
Date Sun, 18 Feb 2018 23:52:36 GMT
Repository: roller
Updated Branches:
  refs/heads/bootstrap-ui ff5ba855b -> 0ec5df068


Converted New User Registration page to use Struts2/Bootstrap plugin.


Project: http://git-wip-us.apache.org/repos/asf/roller/repo
Commit: http://git-wip-us.apache.org/repos/asf/roller/commit/0ec5df06
Tree: http://git-wip-us.apache.org/repos/asf/roller/tree/0ec5df06
Diff: http://git-wip-us.apache.org/repos/asf/roller/diff/0ec5df06

Branch: refs/heads/bootstrap-ui
Commit: 0ec5df068c34fc210cdf3d001d0d0d304248e016
Parents: ff5ba85
Author: Dave Johnson <snoopdave@gmail.com>
Authored: Sun Feb 18 18:52:32 2018 -0500
Committer: Dave Johnson <snoopdave@gmail.com>
Committed: Sun Feb 18 18:52:32 2018 -0500

----------------------------------------------------------------------
 .../main/webapp/WEB-INF/jsps/core/Profile.jsp   |   7 +-
 .../main/webapp/WEB-INF/jsps/core/Register.jsp  | 275 +++++++++----------
 2 files changed, 132 insertions(+), 150 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/roller/blob/0ec5df06/app/src/main/webapp/WEB-INF/jsps/core/Profile.jsp
----------------------------------------------------------------------
diff --git a/app/src/main/webapp/WEB-INF/jsps/core/Profile.jsp b/app/src/main/webapp/WEB-INF/jsps/core/Profile.jsp
index ce7f13d..4079bca 100644
--- a/app/src/main/webapp/WEB-INF/jsps/core/Profile.jsp
+++ b/app/src/main/webapp/WEB-INF/jsps/core/Profile.jsp
@@ -86,7 +86,7 @@
 
 </s:form>
 
-<script>
+<script type="text/javascript">
 
     var saveButton;
 
@@ -114,7 +114,7 @@
         }
 
         if ( (password && password.trim().length) || (passwordConfirm &&
passwordConfirm.trim().length > 0 )) {
-            if ( password != passwordConfirm ) {
+            if ( password !== passwordConfirm ) {
                 valid = false;
             }
         }
@@ -134,7 +134,4 @@
         return re.test(email);
     }
 
-
 </script>
-
-

http://git-wip-us.apache.org/repos/asf/roller/blob/0ec5df06/app/src/main/webapp/WEB-INF/jsps/core/Register.jsp
----------------------------------------------------------------------
diff --git a/app/src/main/webapp/WEB-INF/jsps/core/Register.jsp b/app/src/main/webapp/WEB-INF/jsps/core/Register.jsp
index 96a8d05..dc91e69 100644
--- a/app/src/main/webapp/WEB-INF/jsps/core/Register.jsp
+++ b/app/src/main/webapp/WEB-INF/jsps/core/Register.jsp
@@ -19,183 +19,168 @@
 
 <p><s:text name="userRegister.prompt" /></p>
 
-<s:form action="register!save" >
+<s:form action="register!save"  theme="bootstrap" cssClass="form-horizontal">
 	<s:hidden name="salt" />
     <s:hidden name="bean.id" />
-    <s:hidden name="bean.enabled" />
-
-<table class="formtable">
-    <tr>
-        <td colspan="3">
-            <h2><s:text name="userRegister.heading.identification" /></h2>
-            <p><s:text name="userRegister.tip.identification" /></p>
-        </td>
-    </tr>
-        
+
+    <h2><s:text name="userRegister.heading.identification" /></h2>
+    <p><s:text name="userRegister.tip.identification" /></p>
+
     <s:if test="authMethod == 'LDAP'">
-        <tr>
-            <td class="label"><label for="userName" /><s:text name="userSettings.username"
/></label></td>
-            <td class="field"><strong><s:property value="bean.userName" /></strong></td>
-            <td class="description"><s:text name="userRegister.tip.userName" /></td>
-        </tr>
+
+        <div class="form-group">
+
+            <label class="col-sm-3 control-label">
+                <s:text name="userSettings.username" />
+            </label>
+
+            <div class="col-sm-9 controls">
+                <p class="form-control-static">
+                    <s:property value="bean.userName"/>
+                </p>
+            </div>
+
+        </div>
+
+        <%-- <s:text name="userRegister.tip.userName" /> --%>
+
     </s:if>
     <s:else>
-        <tr>
-            <td class="label"><label for="userName" /><s:text name="userSettings.username"
/></label></td>
-            <td class="field"><s:textfield name="bean.userName" size="30" maxlength="30"
onkeyup="onChange()" /></td>
-            <td class="description"><s:text name="userRegister.tip.userName" /></td>
-        </tr>
+        <s:textfield label="%{getText('userSettings.username')}"
+                     tooltip="%{getText('userRegister.tip.userName')}"
+                     onkeyup="onChange()"
+                     name="bean.userName" size="30" maxlength="30" />
     </s:else>
-     
-    <tr>
-        <td class="label"><label for="screenName" /><s:text name="userSettings.screenname"
/></label></td>
-        <td class="field"><s:textfield name="bean.screenName" size="30" maxlength="30"
onkeyup="onChange()" /></td>
-        <td class="description"><s:text name="userRegister.tip.screenName" /></td>
-    </tr>
-
-    <tr>
-        <td class="label"><label for="fullName" /><s:text name="userSettings.fullname"
/></label></td>
-        <td class="field"><s:textfield name="bean.fullName" size="30" maxlength="30"
onkeyup="onChange()" /></td>
-        <td class="description"><s:text name="userRegister.tip.fullName" /></td>
-    </tr>
-
-    <tr>
-        <td class="label"><label for="emailAddress" /><s:text name="userSettings.email"
/></label></td>
-        <td class="field"><s:textfield name="bean.emailAddress" size="40" maxlength="40"
onkeyup="onChange()" /></td>
-        <td class="description"><s:text name="userRegister.tip.email" /></td>
-    </tr>
+
+    <s:textfield label="%{getText('userSettings.screenname')}"
+                 tooltip="%{getText('userRegister.tip.screenName')}"
+                 onkeyup="onChange()"
+                 name="bean.screenName" size="30" maxlength="30" />
+
+    <s:textfield label="%{getText('userSettings.fullname')}"
+                 tooltip="%{getText('userRegister.tip.fullName')}"
+                 onkeyup="onChange()"
+                 name="bean.fullName" size="30" maxlength="30" />
+
+    <s:textfield label="%{getText('userSettings.email')}"
+                 tooltip="%{getText('userRegister.tip.email')}"
+                 onkeyup="onChange()"
+                 name="bean.emailAddress" size="40" maxlength="40" />
 
     <s:if test="authMethod != 'LDAP'">
-        <tr>
-            <td colspan="3">
-                <h2><s:text name="userRegister.heading.authentication" /></h2>
-
-                <s:if test="authMethod == 'ROLLERDB'">
-                <p><s:text name="userRegister.tip.openid.disabled" /></p>
                   
-                </s:if>
-
-                <s:if test="authMethod == 'DB_OPENID'">
-                <p><s:text name="userRegister.tip.openid.hybrid" /></p>
                   
-                </s:if>
-
-                <s:if test="authMethod == 'OPENID'">
-                <p><s:text name="userRegister.tip.openid.only" /></p> 
                  
-                </s:if>
-            </td>
-        </tr>
-        
+
+        <h2><s:text name="userRegister.heading.authentication" /></h2>
+
+        <s:if test="authMethod == 'ROLLERDB'">
+            <p><s:text name="userRegister.tip.openid.disabled" /></p>
+        </s:if>
+
+        <s:if test="authMethod == 'DB_OPENID'">
+            <p><s:text name="userRegister.tip.openid.hybrid" /></p>
+        </s:if>
+
+        <s:if test="authMethod == 'OPENID'">
+            <p><s:text name="userRegister.tip.openid.only" /></p>
+        </s:if>
+
         <s:if test="authMethod == 'ROLLERDB' || authMethod == 'DB_OPENID'">
-        <tr>
-            <td class="label"><label for="passwordText" /><s:text name="userSettings.password"
/></label></td>
-            <td class="field">
-               <s:password name="bean.passwordText" size="20" maxlength="20" onkeyup="onChange()"
/>
-               <s:hidden name="bean.password" />
-           </td>
-            <td class="description"><s:text name="userRegister.tip.password" /></td>
-        </tr>
-
-        <tr>
-            <td class="label"><label for="passwordConfirm" /><s:text name="userSettings.passwordConfirm"
/></label></td>
-            <td class="field"><s:password name="bean.passwordConfirm" size="20"
maxlength="20" onkeyup="onChange()" /></td>
-            <td class="description"><s:text name="userRegister.tip.passwordConfirm"
/></td>
-        </tr>
+
+            <s:password label="%{getText('userSettings.password')}"
+                         tooltip="%{getText('userRegister.tip.password')}"
+                         onkeyup="onChange()"
+                         name="bean.passwordText" size="20" maxlength="20" />
+
+            <s:password label="%{getText('userSettings.passwordConfirm')}"
+                         tooltip="%{getText('userRegister.tip.passwordConfirm')}"
+                         onkeyup="onChange()"
+                         name="bean.passwordConfirm" size="20" maxlength="20" />
+
         </s:if>
         <s:else>
             <s:hidden name="bean.password" />
             <s:hidden name="bean.passwordText" />
             <s:hidden name="bean.passwordConfirm" />
         </s:else>
-    
 
         <s:if test="authMethod == 'OPENID' || authMethod == 'DB_OPENID'">
-            <tr>
-                <td class="label"><label for="openIdUrl" /><s:text name="userSettings.openIdUrl"
/></label></td>
-                <td class="field"><s:textfield name="bean.openIdUrl" size="40" maxlength="255"
style="width:75%" id="f_openid_identifier" onkeyup="onChange()"/></td>
-                <td class="description"><s:text name="userRegister.tip.openIdUrl"
/></td>
-            </tr>  
-        </s:if> 
+
+            <s:textfield label="%{getText('userSettings.openIdUrl')}"
+                         tooltip="%{getText('userRegister.tip.openIdUrl')}"
+                         onkeyup="onChange()"
+                         name="bean.openIdUrl" size="40" maxlength="255" />
+        </s:if>
 
     </s:if>
 
-    <tr>
-        <td colspan="3">    
-            <h2><s:text name="userRegister.heading.locale" /></h2>
-            <p><s:text name="userRegister.tip.localeAndTimeZone" /></p>
-        </td>
-    </tr>
+    <h2><s:text name="userRegister.heading.locale" /></h2>
+    <p><s:text name="userRegister.tip.localeAndTimeZone" /></p>
 
-    <tr>
-        <td class="label"><label for="locale" /><s:text name="userSettings.locale"
/></label></td>
-        <td class="field">
-           <s:select name="bean.locale" size="1" list="localesList" listValue="displayName"
/>
-        </td>
-        <td class="description"><s:text name="userRegister.tip.locale" /></td>
-    </tr>
+    <s:select label="%{getText('userSettings.locale')}"
+            tooltip="%{getText('userRegister.tip.locale')}"
+            onkeyup="onChange()"
+            list="localesList" listValue="displayName"
+            name="bean.locale" />
 
-    <tr>
-        <td class="label"><label for="timeZone" /><s:text name="userSettings.timeZone"
/></label></td>
-        <td class="field">
-           <s:select name="bean.timeZone" size="1" list="timeZonesList" />
-        </td>
-        <td class="description"><s:text name="userRegister.tip.timeZone" /></td>
-    </tr>
+    <s:select label="%{getText('userSettings.timeZone')}"
+            tooltip="%{getText('userRegister.tip.timeZone')}"
+            onkeyup="onChange()"
+            list="timeZonesList"
+            name="bean.timeZone" />
 
-</table>
+    <h2><s:text name="userRegister.heading.ready" /></h2>
 
-<br />
+    <p id="readytip"><s:text name="userRegister.tip.ready" /></p>
 
-<h2><s:text name="userRegister.heading.ready" /></h2>
+    <s:submit id="submit" key="userRegister.button.save" cssClass="btn btn-default" />
+    <input type="button" class=btn"
+           value="<s:text name="generic.cancel"/>" onclick="window.location='<s:url
value="/"/>'" />
 
-<p id="readytip"><s:text name="userRegister.tip.ready" /></p>
+</s:form>
 
-<s:submit id="submit" key="userRegister.button.save" />
-<input type="button" value="<s:text name="generic.cancel"/>"
-    onclick="window.location='<s:url value="/"/>'" />
+<script type="text/javascript">
 
-</s:form>
+    function onChange() {
+        var disabled = true;
+        var authMethod    = "<s:property value='authMethod' />";
+        var emailAddress    = document.register['bean.emailAddress'].value;
+        var userName = passwordText = passwordConfirm = openIdUrl = "";
 
-<script>
-function onChange() {
-    var disabled = true;
-    var authMethod    = "<s:property value='authMethod' />";
-    var emailAddress    = document.register['bean.emailAddress'].value;
-    var userName = passwordText = passwordConfirm = openIdUrl = "";
-
-    if (authMethod == 'LDAP') {
-        userName = '<s:property value="bean.userName" />';
-    } else {
-        userName = document.register['bean.userName'].value;
-    }
+        if (authMethod === 'LDAP') {
+            userName = '<s:property value="bean.userName" />';
+        } else {
+            userName = document.register['bean.userName'].value;
+        }
 
-    if (authMethod == "ROLLERDB" || authMethod == "DB_OPENID") {
-        passwordText    = document.register['bean.passwordText'].value;
-        passwordConfirm = document.register['bean.passwordConfirm'].value;
-    }
-    if (authMethod == "OPENID" || authMethod == "DB_OPENID") {
-        openIdUrl = document.register['bean.openIdUrl'].value;
-    }
+        if (authMethod === "ROLLERDB" || authMethod === "DB_OPENID") {
+            passwordText    = document.register['bean.passwordText'].value;
+            passwordConfirm = document.register['bean.passwordConfirm'].value;
+        }
+        if (authMethod === "OPENID" || authMethod === "DB_OPENID") {
+            openIdUrl = document.register['bean.openIdUrl'].value;
+        }
 
-    if (authMethod == "LDAP") {
-        if (emailAddress) disabled = false;
-    } else if (authMethod == "ROLLERDB") {
-        if (emailAddress && userName && passwordText && passwordConfirm)
disabled = false;
-    } else if (authMethod == "OPENID") {
-        if (emailAddress && openIdUrl) disabled = false;
-    } else if (authMethod == "DB_OPENID") {
-        if (emailAddress && ((passwordText && passwordConfirm) || (openIdUrl))
) disabled = false;
-    }
+        if (authMethod === "LDAP") {
+            if (emailAddress) disabled = false;
+        } else if (authMethod === "ROLLERDB") {
+            if (emailAddress && userName && passwordText && passwordConfirm)
disabled = false;
+        } else if (authMethod === "OPENID") {
+            if (emailAddress && openIdUrl) disabled = false;
+        } else if (authMethod === "DB_OPENID") {
+            if (emailAddress && ((passwordText && passwordConfirm) || (openIdUrl))
) disabled = false;
+        }
 
-    if (authMethod != 'LDAP') {
-        if ((passwordText || passwordConfirm) && !(passwordText == passwordConfirm))
{
-            document.getElementById('readytip').innerHTML = '<s:text name="userRegister.error.mismatchedPasswords"
/>';
-            disabled = true;
-        } else if (disabled) {
-            document.getElementById('readytip').innerHTML = '<s:text name="userRegister.tip.ready"
/>'
-        } else {
-            document.getElementById('readytip').innerHTML = '<s:text name="userRegister.success.ready"
/>'
+        if (authMethod !== 'LDAP') {
+            if ((passwordText || passwordConfirm) && !(passwordText === passwordConfirm))
{
+                document.getElementById('readytip').innerHTML = '<s:text name="userRegister.error.mismatchedPasswords"
/>';
+                disabled = true;
+            } else if (disabled) {
+                document.getElementById('readytip').innerHTML = '<s:text name="userRegister.tip.ready"
/>'
+            } else {
+                document.getElementById('readytip').innerHTML = '<s:text name="userRegister.success.ready"
/>'
+            }
         }
+        document.getElementById('submit').disabled = disabled;
     }
-    document.getElementById('submit').disabled = disabled;
-}
-document.getElementById('submit').disabled = true;
+    document.getElementById('submit').disabled = true;
+
 </script>


Mime
View raw message