A self hosted chat application with end-to-end encrypted messaging.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
5.7 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. <!DOCTYPE html>
  2. <html xmlns:th="http://www.thymeleaf.org">
  3. <head>
  4. <div th:replace="fragments/head :: headFragment">
  5. <title id="pageTitle">Registration</title>
  6. </div>
  7. <script src="https://code.jquery.com/jquery-2.1.4.min.js" th:if="false"></script>
  8. <script src="http://blackpeppersoftware.github.io/thymeleaf-fragment.js/thymeleaf-fragment.js" defer="defer"
  9. th:if="false"></script>
  10. </head>
  11. <body>
  12. <div th:include="fragments/navbar :: navbarFragment"></div>
  13. <header>
  14. <div class="container">
  15. <div class="row">
  16. <div class="col-lg-6 offset-lg-3 py-5">
  17. <!-- <h4 class="display-4 text-center py-2">Chat</h4> -->
  18. <div class="card text-white bg-primary card-form rounded mx-auto p-5" id="registration-card">
  19. <div class="card-body rounded">
  20. <!-- <h4 class="card-title">Chat</h4> -->
  21. <!-- <div class="form-group">
  22. <textarea id="chatTextArea" class="form-control-lg py-2" disabled></textarea>
  23. </div> -->
  24. <!-- <form action="#" th:action="@{/seedstartermng}" th:object="${seedStarter}" method="post"> -->
  25. <!-- th:action="@{/api/chat}" -->
  26. <!-- <label>First Name</label>
  27. <div th:classappend="${#fields.hasErrors('firstName')} ? 'input-icon right' : ''">
  28. <i th:if="${#fields.hasErrors('firstName')}" class="fa fa-exclamation tooltips" data-original-title="please enter a valid first name" data-container="body"></i>
  29. <input type="text" class="form-control" maxlength="32" th:field="*{firstName}" placeholder="Between 1 and 32 characters" />
  30. <span th:if="${#fields.hasErrors('firstName')}" class="help-block" th:errors="*{firstName}"></span>
  31. </div> -->
  32. <div class="card-text">
  33. <h2 class="card-title text-center mb-3">Register</h2>
  34. <form action="#" th:action="@{/perform_registration}" th:object=${userRegistrationDTO}
  35. method="POST">
  36. <div th:if="${param.error}" class="alert alert-danger">
  37. An error occured while creating your account. Please try again.
  38. <div th:if="${param.duplicate}">
  39. User with the given name already exists. Please use another name.
  40. </div>
  41. <div th:if="${param.captchaError}">
  42. Invalid captcha entered. Please try again.
  43. </div>
  44. </div>
  45. <div th:if="${param.success}" class="alert alert-success">
  46. Registration was successful. You may now login.
  47. </div>
  48. <div class="form-group">
  49. <label>Enter username: </label>
  50. <input th:classappend="${#fields.hasErrors('userName')} ? 'is-invalid' : ''" class="form-control" th:field="*{userName}" type="text" name="username" required>
  51. <small class="form-text">Username must be alphanumeric</small>
  52. <span th:if="${#fields.hasErrors('userName')}" class="help-block text-danger" th:errors="*{userName}"></span>
  53. </div>
  54. <div class="form-group">
  55. <label>Enter password: </label>
  56. <input th:classappend="${#fields.hasErrors('password')} ? 'is-invalid' : ''" class="form-control" th:field="*{password}" type="password" name="password" id="password" required>
  57. <span th:if="${#fields.hasErrors('password')}" class="help-block text-danger" th:errors="*{password}"></span>
  58. </div>
  59. <div class="form-group">
  60. <label for="password-repeat">Repeat password: </label>
  61. <input class="form-control" type="password" id="password-repeat" required>
  62. </div>
  63. <input type="hidden" th:value="${userRegistrationDTO.captchaID}" name="captchaID">
  64. <!-- <span th:text="${userRegistrationDTO.captchaText}"></span> -->
  65. <div class="form-group">
  66. <label for="captcha">Enter this captcha:
  67. <img th:src="@{'/img/captcha/' + ${userRegistrationDTO.captchaID}}" />
  68. </label>
  69. <input class="form-control" type="text" id="captcha" th:field="*{captchaInput}" required>
  70. </div>
  71. <div class="form-group">
  72. <input class="form-control btn btn-secondary" type="submit" value="Submit">
  73. </div>
  74. </form>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. </header>
  82. </body>
  83. </html>