Split the registration form into three sections based on the type of user.

This commit is contained in:
Andrew Lalis 2019-05-29 11:48:02 +02:00 committed by andrewlalis
parent ee7026d59d
commit 153df56a89
4 changed files with 42 additions and 51 deletions

View File

@ -12,58 +12,19 @@
</div>
<div class="row justify-content-center">
<form th:action="@{/register}" method="post" th:object="${newUserRegistration}">
<div class="form-row">
<div class="col">
<label for="first_name_input">First Name</label>
<input id="first_name_input" class="form-control" type="text" th:field="*{firstName}" required/>
</div>
<div class="col">
<label for="last_name_input">Last Name</label>
<input id="last_name_input" class="form-control" type="text" th:field="*{lastName}" required/>
</div>
</div>
<h3>I am a ...</h3>
</div>
<div class="form-row">
<div class="col">
<label for="email_input">Email</label>
<input id="email_input" class="form-control" type="text" th:field="*{emailAddress}" required/>
</div>
</div>
<div class="form-row">
<div class="col">
<label for="username_input">Username</label>
<input id="username_input" class="form-control" type="text" th:field="*{username}" required/>
</div>
</div>
<div class="form-row">
<div class="col">
<label for="role_select">I am a</label>
<select id="role_select" class="form-control" th:field="*{selectedPersonType}">
<option th:each="personType: ${newUserRegistration.getAvailablePersonTypes()}" th:text="${personType}" th:value="${personType}"></option>
</select>
</div>
</div>
<div class="form-row">
<div class="col">
<label for="password_input">Password</label>
<input id="password_input" class="form-control" type="password" th:field="*{password}" required/>
</div>
<div class="col">
<label for="password_confirm_input">Confirm Password</label>
<input id="password_confirm_input" class="form-control" type="password" th:field="*{passwordConfirm}" required/>
</div>
</div>
<div class="form-row mt-1">
<div class="col">
<input class="btn btn-primary" type="submit" value="Submit"/>
</div>
</div>
</form>
<div class="row justify-content-center">
<div class="col text-center">
<a class="btn btn-primary" th:href="@{/register/student}">Student</a>
</div>
<div class="col text-center">
<a class="btn btn-primary" th:href="@{/register/teaching_assistant}">Teaching Assistant</a>
</div>
<div class="col text-center">
<a class="btn btn-primary" th:href="@{/register/administrator}">Administrator</a>
</div>
</div>
</section>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>