Browse Source

Add UI for creating and using invites

Getty Ritter 4 years ago
parent
commit
16a0513dbd
2 changed files with 60 additions and 0 deletions
  1. 20 0
      templates/add_user.mustache
  2. 40 0
      templates/config.mustache

+ 20 - 0
templates/add_user.mustache

@@ -0,0 +1,20 @@
+<div class="config-pane">
+  Sign up using invite code {{token}}.
+  <form name="new-user" method="POST">
+    <div>
+      <label for="username">Username</label>
+      <input name="username" type="text" />
+    </div>
+    <div>
+      <label for="n1">Password</label>
+      <input name="n1" type="password" />
+    </div>
+    <div>
+      <label for="n2">Retype password</label>
+      <input name="n2" type="password" />
+    </div>
+    <div>
+      <input type="submit" value="Sign up" />
+    </div>
+  </form>
+</div>

+ 40 - 0
templates/config.mustache

@@ -0,0 +1,40 @@
+<div class="config-pane">
+  Change password:
+  <form name="password-change" action="/u/{{username}}/password" method="POST">
+    <div>
+      <label for="old">Old password</label>
+      <input name="old" type="password" />
+    </div>
+    <div>
+      <label for="n1">New password</label>
+      <input name="n1" type="password" />
+    </div>
+    <div>
+      <label for="n2">Retype password</label>
+      <input name="n2" type="password" />
+    </div>
+    <div>
+      <input type="submit" value="Change Password" />
+    </div>
+  </form>
+</div>
+{{#admin_pane}}
+  <div class="config-pane">
+    User Invites:
+    <ul>
+      {{#invites}}
+        {{#claimed}}
+          <li>Token {{token}} claimed by <a href="/u/{{claimant}}">{{claimant}}</a></li>
+        {{/claimed}}
+        {{^claimed}}
+          <li>Token <a href="/u?token={{token}}">{{token}}</a></li>
+        {{/claimed}}
+      {{/invites}}
+    </ul>
+    <form name="new-invite" action="/u/{{username}}/invite" method="POST">
+      <div>
+        <input type="submit" value="Create invite link" />
+      </div>
+    </form>
+  </div>
+{{/admin_pane}}