Partly working security: registration form, authorisaztion, simple authentication
[proteocache.git] / webapp / view / Register.jsp
diff --git a/webapp/view/Register.jsp b/webapp/view/Register.jsp
new file mode 100644 (file)
index 0000000..77584c2
--- /dev/null
@@ -0,0 +1,128 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+
+<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
+<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
+
+<html>
+<jsp:include page="fragments/header.jsp" />
+<body>
+       <div class="container">
+       <jsp:include page="fragments/publicmenu.jsp" />
+       <spring:url value="/register/do" var="query"/>
+
+       <div class="panel panel-default">
+               <div class="panel-heading">
+                       <div style="font-weight:bold;">Create a new user account</div>
+               </div>
+               <div class="panel-body">
+
+               <form:form method="POST" modelAttribute="user" action="${query}">
+                       <div class="col-xs-4"><!-- make the field shorter -->
+                               <c:choose>
+                               <c:when test="${error == null}">
+                               <div class="form-group">
+                                       <form:input class="form-control" type="text" path="fullName" placeholder="Full name (3-50 symbols)" />
+                                       <p></p>
+                                       <form:input class="form-control" type="text" path="email" placeholder="Email (used as account name)" />
+                                       <p></p>
+                                       <form:input class="form-control" type="password" path="password" placeholder="Password (at least 6 symbols)" />
+                                       <p></p>
+                                       <form:input class="form-control" type="text" path="position" placeholder="Your position" />
+                                       <p></p>
+                                       <form:input class="form-control" type="text" path="organisation" placeholder="Your organisation (3-250 symbols)" />
+                                       <p></p>
+                                       <form:checkbox path="updateByEmail"/>
+                                       <form:label path="updateByEmail" >Subscribe to ProteoCache mailing list</form:label>
+                                       <p></p>
+                                       <button type="submit" class="btn btn-default">Login</button>
+                               </div>
+                               </c:when>
+                               <c:otherwise>
+                                       <div class="form-group has-error">
+                                       <form:input class="form-control" type="text" path="fullName" placeholder="Full name" />
+                                       <form:errors path="fullName" cssClass="error" />
+                                       <p></p>
+                                       <form:input class="form-control" type="text" path="email" placeholder="Email, used as account name" />
+                                       <form:errors path="email" cssClass="error" />
+                                       <p></p>
+                                       <form:input class="form-control" type="password" path="password" placeholder="Password" />
+                                       <form:errors path="password" cssClass="error" />
+                                       <p></p>
+                                       <form:input class="form-control" type="text" path="position" placeholder="Your position" />
+                                       <form:errors path="position" cssClass="error" />
+                                       <p></p>
+                                       <form:input class="form-control" type="text" path="organisation" placeholder="Your organisation" />
+                                       <form:errors path="organisation" cssClass="error" />
+                                       <p></p>
+                                       <form:checkbox path="updateByEmail"/>
+                                       <form:label path="updateByEmail" >Subscribe to ProteoCache mailing list</form:label>
+                                       <p></p>
+                                       <button type="submit" class="btn btn-default">Login</button>
+                               </div>
+                               </c:otherwise>
+                               </c:choose>
+                       </div>
+               </form:form>
+
+<!--
+       <sf:form method="POST" modelAttribute="user" action="/register/do">
+       <fieldset> 
+       <table cellspacing="0">
+               <tr>
+                       <td><sf:input path="fullName" size="15"/>
+                                <sf:errors path="fullName" cssClass="error" />
+                       </td>
+               </tr>
+               <tr>
+                       <td><sf:input path="email" size="30"/>
+                               <small>the email address is used as your JABAWS download username</small><br/> 
+                               <sf:errors path="email" cssClass="error" />
+                       </td>
+               </tr>
+               <tr>
+                       <th><sf:label path="password">Enter a password for JABAWS:</sf:label></th>
+                       <td><sf:password path="password" size="30" showPassword="true"/> 
+                               <small>6 characters or more</small><br/>
+                               
+                       </td>
+               </tr>
+               <tr>
+                       <th><sf:label path="position">Position:</sf:label></th>
+                       <td><sf:input path="position" size="20" maxlength="200" />
+                               <small>postdoc, PI, Staff scientists, Industry, etc</small><br/>
+                               <sf:errors path="position" cssClass="error" />
+                       </td>
+               </tr>
+               <tr>
+                       <th><sf:label path="organisation">Organisation:</sf:label></th>
+                       <td><sf:input path="organisation" size="20" maxlength="200" />
+                               <small>your organisation</small><br/>
+                               <sf:errors path="organisation" cssClass="error" />
+                       </td>
+               </tr>
+               <tr>
+                       <th></th>
+                       <td>
+                               <sf:checkbox path="updateByEmail"/>
+                               <sf:label path="updateByEmail" >Subscribe to ProteoCache mailing list</sf:label>
+                               <br/>
+                       </td>
+               </tr>
+               <tr>
+                       <th></th>
+                       <td><input name="commit" type="submit" value="I accept. Create my account." /></td>
+               </tr>
+               </table>
+       </fieldset>
+       </sf:form>
+-->
+
+               </div>
+       </div>
+       <jsp:include page="fragments/footer.jsp"/>
+       </div>
+</body>
+</html>
\ No newline at end of file