2024-11-14 03:51:08 +00:00
extends site.pug
2025-01-28 04:34:46 +00:00
include _util.pug
2024-11-14 03:51:08 +00:00
block head
link(rel="stylesheet", href="/css/dashboard.css")
style
| #content { margin-left: 256px; }
block page
#sidebar
h1 Profile
form#dashboard-profile(action=`/users/${user.name}/edit`, method="post")
textarea(placeholder="bio (max 1024 chars)", maxlength="1024", name="bio", rows=5)= user.bio
input(type="url", name="website", placeholder="website", value=user.website)
button(type="submit") Edit
h1(style="margin-top:1em;") Mood history
ul#dashboard-mood-history
2025-01-28 22:05:54 +00:00
if moodHistory.length < 1
span [no updates]
2024-11-14 03:51:08 +00:00
for mood of moodHistory
li
strong= mood.mood
|
| #{mood.date}
2025-01-28 22:05:54 +00:00
h1(style="margin-top:1em;") Follows
table
tbody
for follow of followed
tr
td
a(href=`/users/${follow.uname}`)= follow.uname
td
form(action=`/users/${follow.uname}/follow`, method="post")
button Unfollow
2024-11-14 03:51:08 +00:00
block content
2024-12-25 23:44:29 +00:00
p
a(href="#feed") Feed
| /
a(href="#invite-codes") Invite codes
2025-01-28 04:34:46 +00:00
p This is where you "MIPILIN"! That is all you need to know!!!
p If onlookers notice your actions and inquire about what you are doing, you MUST tell them that you are mipilining all over the place, and then PROMPTLY SCROLL DOWN AND GENERATE AN INVITE CODE SO THAT THEY CAN MIPILIN TOO. If you do not do this I will cry.
2024-11-17 19:16:27 +00:00
form#dashboard-update-form(action="/update/mood", method="post", onsubmit="disable(this);")
select(name="mood", required)
2024-11-14 03:51:08 +00:00
//- Maybe put the index of the mood in the value of the option element
//- so that indexOf (slow) wont have to be used everytime mood is updated
for mood of moodsSorted
option= mood
textarea(name="desc", placeholder="mood description (max 512 chars)", rows="5", maxlength="512")
button(type="submit") Update
2024-12-25 23:44:29 +00:00
h1#feed(style="margin-top:0.5em;") Feed
2024-11-17 19:16:27 +00:00
include _feed.pug
+feed(recentUpdates)
2024-12-25 23:44:29 +00:00
h1#invite-codes(style="margin-top:1em;") Invite codes
2025-01-28 22:05:54 +00:00
p If you're a trusted user, you can invite your friends to the mipilin beta! You can create up to five invite codes every month, and they all expire within a week.
2024-12-25 23:44:29 +00:00
p
| Your current invite codes (
strong= codesUsed
| /5):
if codes.length > 0
table
tbody
tr
th Token
th Expires
for code of codes
tr
td= code.token
2025-01-28 04:34:46 +00:00
+invite_code_expiration(code)
2024-12-25 23:44:29 +00:00
else
.subtle You have no currently active invite codes.
br
form(action="/codes/create", method="post")
2025-01-28 22:05:54 +00:00
button(type="submit", disabled=codesUsed>=5 || !isTrusted) Generate
if codesUsed >= 5
p You've generated the maximum amount of codes this month.
if !isTrusted
p You need be manually marked as "trusted" to generate codes.
2024-12-11 03:27:43 +00:00
script(nonce=nonce).
2024-11-14 03:51:08 +00:00
function disable(form) {
const btn = form.querySelector("button");
2025-01-28 22:05:54 +00:00
btn.setAttribute("disabled", "");
2024-11-14 03:51:08 +00:00
setTimeout(() => {
btn.removeAttribute("disabled");
}, 3000)
}