1
0
Fork 0
mirror of https://git.sr.ht/~roxwize/mipilin synced 2025-01-31 02:53:36 +00:00
mipilin/views/user.pug

44 lines
1.3 KiB
Text
Raw Normal View History

extends site.pug
//- Display mood here but keep yourself dry (i.e. dont request user mood if the profile being viewed is the profile of the currently logged-in user)
block content
div(style="display:flex;align-items:center;gap:8px;")
h1= user.name
if !isSelf
form(action=`/users/${user.name}/follow`, method="post")
button(type="submit")= isFollowing ? "unfollow" : "follow"
br
div(style="margin-bottom:1em;")
| Joined
span(title=user.registered.toLocaleString())= user.relativeRegistered
div= user.bio || "[no bio]"
if user.website
a(href=user.website)= user.website
h2(style="margin-top:1em;") Current mood
if userMood
div
| Feeling
|
strong
if isSelf
| #{currentMood}
else
| #{userMood.mood}
div(style="margin-left:2ch;word-wrap:break-word;")= userMood.desc || "[no mood description]"
else
div User has not yet set a mood!
br
h2 Recent journal entries
if userJournalEntries.length > 0
ul
for entry of userJournalEntries
li
a(href=`/journal/${entry.id}`)= entry.title
span.subtle(title=entry.date.toLocaleString()) (#{entry.relativeDate})
else
div [no entries]
br
h2 Recent mood updates
include _feed.pug
+feed(userMoodFeed, true)