Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added register button to login page and fixes in AccountController

  • Loading branch information...
commit 7725b817bf010309390c63d5a677a795a71357ca 1 parent bc952bd
tonybaroneee authored
View
17 src/main/java/edu/rit/taskers/controller/AccountController.java
@@ -8,6 +8,7 @@
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
import edu.rit.taskers.command.NewUserCommand;
import edu.rit.taskers.data.NewUser;
@@ -26,13 +27,12 @@
private UserDao userDao;
/**
- * Update the session user's account
- * @return if Account was updated successfully
+ * Create New Account page requested
*/
- @RequestMapping(method = RequestMethod.PUT)
- public boolean updateAccount() {
- //TODO figure out if PUT is the best option
- return true;
+ @RequestMapping(value="/new", method=RequestMethod.GET)
+ public ModelAndView getCreateAccountPage() {
+ ModelAndView newAccountPage = new ModelAndView("newaccount");
+ return newAccountPage;
}
/**
@@ -40,7 +40,7 @@ public boolean updateAccount() {
* @return if Account was created successfully
*/
@RequestMapping(value = "/new", method = RequestMethod.POST)
- public @ResponseBody String createNewTask(@RequestParam(value="login") String login,
+ public @ResponseBody String createNewUser(@RequestParam(value="login") String login,
@RequestParam(value="password") String password,
@RequestParam(value="name") String name,
@RequestParam(value="phone") String phone,
@@ -71,7 +71,8 @@ public boolean updateAccount() {
newuser.setPictureURL(pictureURL);
NewUserCommand command = new NewUserCommand(newuser);
-
+
+ //TODO error checking
command.execute();
return "User successfully created!";
}
View
6 src/main/webapp/login.jsp
@@ -27,9 +27,13 @@
<input type="password" name="j_password" id="password"/>
</div>
- <input type="submit" name="login" value="Submit" data-theme="b" />
+ <input type="submit" name="login" value="Login" data-theme="b" />
</form>
+
+ <p>New to Teamspace?<p>
+ <a href="/account/new" data-role="button" data-theme="b" data-icon="plus" >Get Started</a>
+
</div>
<%@ include file="footer.htm" %>
View
0  src/main/webapp/newuser.jsp → src/main/webapp/newaccount.jsp
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.