← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8594: Added basic form form user self registration

 

------------------------------------------------------------
revno: 8594
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-10-19 12:20:05 +0200
message:
  Added basic form form user self registration
added:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/account.css
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/useraccount/account.vm
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AccountController.java
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/green/green.css
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/india/india.css
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/light_blue.css
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/vietnam/vietnam.css


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AccountController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AccountController.java	2012-10-19 08:00:36 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/AccountController.java	2012-10-19 10:20:05 +0000
@@ -166,7 +166,7 @@
         }
 
         // ---------------------------------------------------------------------
-        // Create and save user
+        // Create and save user, return 201
         // ---------------------------------------------------------------------
         
         User user = new User();
@@ -196,6 +196,11 @@
     @RequestMapping( value = "/username/{username}", method = RequestMethod.GET, produces = ContextUtils.CONTENT_TYPE_TEXT )
     public @ResponseBody String validateUserName( @PathVariable( "username" ) String username )
     {
+        if ( StringUtils.trimToNull( username ) == null )
+        {
+            return "Username must be specified";
+        }
+        
         UserCredentials credentials = userService.getUserCredentialsByUsername( username );
         
         return credentials == null ? TRUE : "Username is already taken";

=== added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/account.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/account.css	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/account.css	2012-10-19 10:20:05 +0000
@@ -0,0 +1,68 @@
+*
+{
+  font-family: LiberationSansRegular, sans-serif;
+  line-height: 125%;
+  overflow: hidden;
+}
+
+body
+{ 
+  font-size: 11pt;
+  color: #333;
+}
+
+#accountHeader
+{
+  position: absolute; 
+  top: 0;
+  left: 0;
+  width: 100%; 
+  height: 100px; 
+  background-color: #1d5288;
+}
+
+#bannerArea
+{
+  position: relative;
+  top: 30px;
+}
+
+#accountContainer
+{
+  position: relative;
+  width: 800px;
+  height: 760px;
+  margin-left: auto; 
+  margin-right: auto;
+}
+
+#accountInput
+{
+  position: relative;
+  padding-top: 80px;
+}
+
+h3
+{
+  font-weight: normal;
+  font-size: 16pt;
+  color: #222;
+}
+
+input[type=text],input[type=password],textarea
+{
+  border: 1px solid #aaa;
+  padding: 4px;
+  width: 25em;
+}
+
+@font-face {
+    font-family: 'LiberationSansRegular';
+    src: url('../../fonts/LiberationSans-Regular-webfont.eot');
+    src: url('../../fonts/LiberationSans-Regular-webfont.eot?#iefix') format('eot'),
+         url('../../fonts/LiberationSans-Regular-webfont.woff') format('woff'),
+         url('../../fonts/LiberationSans-Regular-webfont.ttf') format('truetype'),
+         url('../../fonts/LiberationSans-Regular-webfont.svg#webfontc8rbNdBe') format('svg');
+    font-weight: normal;
+    font-style: normal;
+}

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/green/green.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/green/green.css	2012-10-16 11:08:57 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/green/green.css	2012-10-19 10:20:05 +0000
@@ -316,42 +316,42 @@
 .page h1 
 {
   font-size: 16pt;
-  font-weight: lighter;
+  font-weight: normal;
   color: #606060;
 }
 
 .page h2 
 {
   font-size: 15pt;
-  font-weight: lighter;
+  font-weight: normal;
   color: #606060;
 }
 
 .page h3 
 {
   font-size: 14pt;
-  font-weight: lighter;
+  font-weight: normal;
   color: #606060;
 }
 
 .page h4 
 {
   font-size: 13pt;
-  font-weight: lighter;
+  font-weight: normal;
   color: #606060;
 }
 
 .page h5 
 {
   font-size: 12pt;
-  font-weight: lighter;
+  font-weight: normal;
   color: #606060;
 }
 
 .page h6 
 {
   font-size: 11pt;
-  font-weight: lighter;
+  font-weight: normal;
   color: #606060;
 }
 

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/india/india.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/india/india.css	2012-10-16 11:08:57 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/india/india.css	2012-10-19 10:20:05 +0000
@@ -334,42 +334,42 @@
 .page h1 
 {
   font-size: 16pt;
-  font-weight: lighter;
+  font-weight: normal;
   color: #606060;
 }
 
 .page h2 
 {
   font-size: 15pt;
-  font-weight: lighter;
+  font-weight: normal;
   color: #606060;
 }
 
 .page h3 
 {
   font-size: 14pt;
-  font-weight: lighter;
+  font-weight: normal;
   color: #606060;
 }
 
 .page h4 
 {
   font-size: 13pt;
-  font-weight: lighter;
+  font-weight: normal;
   color: #606060;
 }
 
 .page h5 
 {
   font-size: 12pt;
-  font-weight: lighter;
+  font-weight: normal;
   color: #606060;
 }
 
 .page h6 
 {
   font-size: 11pt;
-  font-weight: lighter;
+  font-weight: normal;
   color: #606060;
 }
 

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/light_blue.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/light_blue.css	2012-10-16 11:08:57 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/light_blue.css	2012-10-19 10:20:05 +0000
@@ -317,42 +317,42 @@
 .page h1 
 {
   font-size: 16pt;
-  font-weight: lighter;
+  font-weight: normal;
   color: #606060;
 }
 
 .page h2 
 {
   font-size: 15pt;
-  font-weight: lighter;
+  font-weight: normal;
   color: #606060;
 }
 
 .page h3 
 {
   font-size: 14pt;
-  font-weight: lighter;
+  font-weight: normal;
   color: #606060;
 }
 
 .page h4 
 {
   font-size: 13pt;
-  font-weight: lighter;
+  font-weight: normal;
   color: #606060;
 }
 
 .page h5 
 {
   font-size: 12pt;
-  font-weight: lighter;
+  font-weight: normal;
   color: #606060;
 }
 
 .page h6 
 {
   font-size: 11pt;
-  font-weight: lighter;
+  font-weight: normal;
   color: #606060;
 }
 

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/vietnam/vietnam.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/vietnam/vietnam.css	2012-10-16 11:08:57 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/vietnam/vietnam.css	2012-10-19 10:20:05 +0000
@@ -310,42 +310,42 @@
 .page h1 
 {
   font-size: 16pt;
-  font-weight: lighter;
+  font-weight: normal;
   color: #606060;
 }
 
 .page h2 
 {
   font-size: 15pt;
-  font-weight: lighter;
+  font-weight: normal;
   color: #606060;
 }
 
 .page h3 
 {
   font-size: 14pt;
-  font-weight: lighter;
+  font-weight: normal;
   color: #606060;
 }
 
 .page h4 
 {
   font-size: 13pt;
-  font-weight: lighter;
+  font-weight: normal;
   color: #606060;
 }
 
 .page h5 
 {
   font-size: 12pt;
-  font-weight: lighter;
+  font-weight: normal;
   color: #606060;
 }
 
 .page h6 
 {
   font-size: 11pt;
-  font-weight: lighter;
+  font-weight: normal;
   color: #606060;
 }
 

=== added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/useraccount/account.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/useraccount/account.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/useraccount/account.vm	2012-10-19 10:20:05 +0000
@@ -0,0 +1,72 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <title>DHIS 2</title>
+    <script type="text/javascript" src="../javascripts/jQuery/jquery.min.js"></script>
+    <link type="text/css" rel="stylesheet" href="../css/account.css">
+</head>
+<body>
+
+<div id="accountHeader"></div>
+
+<div id="accountContainer">
+
+<div id="bannerArea"><a href="http://dhis2.org";><img src="../security/logo_front.png" style="border:none"></a></div>
+
+<div id="accountInput">
+
+<h3>Create a new account</h3>
+
+<form action="../../api/account" method="post">
+<table>
+    <tr>
+        <td><label for="firstName">$i18n.getString( "name" )</label></td>
+        <td><input type="text" id="firstName" name="firstName" style="width:11.7em; margin-right:7px;" placeholder="First">
+            <input type="text" id="surname" name="surname" style="width:11.7em" placeholder="Last"></td>
+    </tr>
+    <tr>
+        <td style="width:140px"><label for="username">$i18n.getString( "user_name" )</label></td>
+        <td><input type="text" id="username" name="username" autocomplete="off"></td>
+    </tr>
+    <tr>
+        <td><label for="password">$i18n.getString( "password" )</label></td>
+        <td><input type="password" id="password" name="password" autocomplete="off"></td>
+    </tr>
+    <tr>
+        <td><label for="retypePassword">$i18n.getString( "confirm_password" )</label></td>
+        <td><input type="password" id="retypePassword" name="retypePassword" autocomplete="off"></td>
+    </tr>
+    <tr>
+        <td><label for="email">$i18n.getString( "email" )</label></td>
+        <td><input type="text" id="email" name="email"></td>
+    </tr>
+    <tr>
+        <td><label for="phoneNumber">$i18n.getString( "mobile_phone" )</label></td>
+        <td style="padding-bottom: 5px"><input type="text" id="phoneNumber" name="phoneNumber"></td>
+    </tr>
+    <tr>
+    	<td><label>Prove you are not a robot</label></td>
+    	<td style="padding-bottom: 5px">
+		<script type="text/javascript" src="https://www.google.com/recaptcha/api/challenge?k=6LcM6tcSAAAAANwYsFp--0SYtcnze_WdYn8XwMMk";></script>
+		<noscript>
+		  <iframe src="https://www.google.com/recaptcha/api/noscript?k=6LcM6tcSAAAAANwYsFp--0SYtcnze_WdYn8XwMMk";
+		    height="300" width="500" frameborder="0"></iframe><br>
+		  <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
+		  <input type="hidden" name="recaptcha_response_field" value="manual_challenge">
+		</noscript>
+		</td>
+	</tr>
+    <tr>
+    	<td></td>
+    	<td><input type="submit" value="Create" style="width:10em"></td>
+    </tr>
+</table>
+
+</form>
+
+</div>
+
+</div>
+
+</body>
+</html>
\ No newline at end of file