1
0
Fork 0
mirror of https://git.sr.ht/~roxwize/mipilin synced 2025-02-08 06:22:50 +00:00
mipilin/views/_util.pug

30 lines
1 KiB
Text
Raw Normal View History

mixin feed(feed, hideUser)
if feed.length > 0
#feed
for update of feed
.feed-update
div
a(href=`/users/${update.user}`)
if !hideUser
| #{update.user}
strong= update.mood
div= update.desc || "[no mood description provided]"
.feed-update-footer
.feed-update-actions
if update.user === session.user || session.status & 0b0001
form(action="/mood/delete", method="post")
input(type="number", name="upd", value=update.id, style="display:none;", readonly)
button.button-link(title="Delete this update") x
.feed-update-date(title=update.date.toLocaleString())= update.relativeDate
else
span [no updates]
mixin invite_code_expiration(code)
- const timestamp = code.expires.getTime()
if timestamp === 0
td.subtle never
else if Date.now() >= timestamp
td.error EXPIRED
else
td= code.expiresString