aboutsummaryrefslogtreecommitdiff
path: root/src/main/resources
diff options
context:
space:
mode:
authorMarvin Borner2019-05-02 22:37:13 +0200
committerMarvin Borner2019-05-02 22:37:13 +0200
commita6fc766d6eb808584c7cebea216f683b53f8e99b (patch)
tree484faadd60a0df0b648a27e130455d800512391d /src/main/resources
parent22797dde022a398b34a91ba24e2bdd89be3f36f8 (diff)
Added user registration via admin
Co-authored-by: LarsVomMars <lars@kroenner.eu>
Diffstat (limited to 'src/main/resources')
-rw-r--r--src/main/resources/views/index.rocker.html5
-rw-r--r--src/main/resources/views/login.rocker.html2
-rw-r--r--src/main/resources/views/register.rocker.html32
3 files changed, 36 insertions, 3 deletions
diff --git a/src/main/resources/views/index.rocker.html b/src/main/resources/views/index.rocker.html
index cab6712..650a4b7 100644
--- a/src/main/resources/views/index.rocker.html
+++ b/src/main/resources/views/index.rocker.html
@@ -7,11 +7,12 @@
<div>
@if(username.length() > 0) {
- <a class="button" href="/logout">Logout</a>
+ <!-- TODO: Fix logout button? -->
+ <a class="button" href="/user/logout">Logout</a>
} else if (!(new DatabaseController()).isSetup()) {
<a class="button" href="/setup">Setup</a>
} else {
- <a class="button" href="/login">Login</a>
+ <a class="button" href="/user/login">Login</a>
}
<a class="button" href="/files/">Files</a>
diff --git a/src/main/resources/views/login.rocker.html b/src/main/resources/views/login.rocker.html
index feddbbc..a8b06be 100644
--- a/src/main/resources/views/login.rocker.html
+++ b/src/main/resources/views/login.rocker.html
@@ -9,7 +9,7 @@
<div class="flex">
<h1>Login</h1>
- <form action="/login" method="post">
+ <form action="/user/login" method="post">
<div>
<label for="username">Username:</label>
<input autocomplete="off" autofocus id="username" name="username" required type="text"/>
diff --git a/src/main/resources/views/register.rocker.html b/src/main/resources/views/register.rocker.html
new file mode 100644
index 0000000..6d314dd
--- /dev/null
+++ b/src/main/resources/views/register.rocker.html
@@ -0,0 +1,32 @@
+@args (String username, String message)
+
+@layout.template("Register", RockerContent.NONE, RockerContent.NONE) -> {
+<div class="flex">
+ <h1>Register</h1>
+
+ <form action="/user/register" method="post">
+ <h3>Please set a password for user "@username"</h3>
+ <div>
+ <input hidden name="username" type="text" value="@username"/>
+ </div>
+ <div>
+ <label for="password">Password:</label>
+ <input id="password" name="password" required type="password"/>
+ </div>
+ <div>
+ <label for="verifyPassword">Verify password:</label>
+ <input id="verifyPassword" name="verifyPassword" required type="password"/>
+ </div>
+
+ <div>
+ @if (message.length() > 0) {
+ <small>@message</small>
+ }
+ </div>
+
+ <div>
+ <button type="submit">Register</button>
+ </div>
+ </form>
+</div>
+}