mirror of
https://git.sr.ht/~roxwize/mipilin
synced 2025-05-07 22:13:07 +00:00
invite cooooddeesss
Signed-off-by: roxwize <rae@roxwize.xyz>
This commit is contained in:
parent
7b563f5c31
commit
5abe0b5fad
22 changed files with 2326 additions and 16 deletions
32
views/admin.pug
Normal file
32
views/admin.pug
Normal file
|
@ -0,0 +1,32 @@
|
|||
extends site.pug
|
||||
|
||||
block content
|
||||
h1 Admin Panel
|
||||
h2 Invite codes
|
||||
form(action="/mod/codes/delete", method="post")
|
||||
table
|
||||
tbody
|
||||
tr
|
||||
th Token
|
||||
th Expires
|
||||
th Creator
|
||||
for code of codes
|
||||
- const timestamp = code.expires.getTime()
|
||||
tr
|
||||
td= code.token
|
||||
if timestamp === 0
|
||||
td.subtle never
|
||||
else if Date.now() >= timestamp
|
||||
td.error EXPIRED
|
||||
else
|
||||
td= code.expiresString
|
||||
td
|
||||
a(href=`/users/${code.uname}`)= code.uname
|
||||
td
|
||||
button(type="submit", name="token", value=code.token) Delete
|
||||
form(action="/mod/codes/prune", method="post")
|
||||
button(type="submit") Prune
|
||||
br
|
||||
form(action="/mod/codes/create", method="post")
|
||||
input(type="datetime-local", name="expiration")
|
||||
button(type="submit") Create
|
|
@ -36,7 +36,7 @@ block content
|
|||
h1(style="margin-top:0.5em;") Feed
|
||||
include _feed.pug
|
||||
+feed(recentUpdates)
|
||||
script.
|
||||
script(nonce=nonce).
|
||||
function disable(form) {
|
||||
const btn = form.querySelector("button");
|
||||
btn.setAttribute("disabled", true);
|
||||
|
|
|
@ -9,4 +9,6 @@ block content
|
|||
br
|
||||
input(type="password", name="pass", placeholder="Password", required)
|
||||
br
|
||||
input(type="text", name="referral", placeholder="Invite Code", maxlength="22", required)
|
||||
br
|
||||
button(type="submit") Sign Up
|
||||
|
|
|
@ -14,6 +14,8 @@ html(lang="en")
|
|||
img#header-logo(src="/img/logo.svg", alt="logo")
|
||||
nav
|
||||
if session.loggedIn
|
||||
if session.moderator
|
||||
a(href="/mod/") Admin
|
||||
a(href="/dashboard/") Dashboard
|
||||
a(href="/journal/") Journal
|
||||
a(href="/logout/") Log out
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue