1
0
Fork 0
mirror of https://git.sr.ht/~roxwize/mipilin synced 2025-05-07 22:13:07 +00:00

Today is Journal Day

Signed-off-by: roxwize <rae@roxwize.xyz>
This commit is contained in:
Rae 5e 2025-03-01 13:17:13 -05:00
parent f7e44cddca
commit 927193c102
Signed by: rae
GPG key ID: 5B1A0FAB9BAB81EE
14 changed files with 742 additions and 55 deletions

View file

@ -17,7 +17,7 @@ mixin feed(feed, hideUser)
button.button-link(title="Delete this update") x
.feed-update-date(title=update.date.toLocaleString())= update.relativeDate
else
span [no updates]
span [no mood updates]
mixin invite_code_expiration(code)
- const timestamp = code.expires.getTime()
@ -27,3 +27,37 @@ mixin invite_code_expiration(code)
td.error EXPIRED
else
td= code.expiresString
mixin journal_entry_suffix(entry)
span.subtle(title=entry.date.toLocaleString())
| (#{entry.relativeDate}
if entry.visibility !== 1
| ,
if entry.visibility === 0
| private
if entry.visibility === 2
| mood-only
| )
mixin ovm(entry)
- const e = entry?.mood
#ovm
input.ovm-input(type="radio", name="moodDelta", id="moodDelta-mb", value="2", required checked=(e === 2))
label.ovm-input(for="moodDelta-mb", title="Much better")
img(src="/img/upup.svg", alt="Much better")
input.ovm-input(type="radio", name="moodDelta", id="moodDelta-b", value="1", required checked=(e === 1))
label.ovm-input(for="moodDelta-b", title="Better")
img(src="/img/up.svg", alt="Better")
input.ovm-input(type="radio", name="moodDelta", id="moodDelta-nc", value="0", required checked=(!entry || e === 0))
label.ovm-input(for="moodDelta-nc", title="About the same")
img(src="/img/line.svg", alt="About the same")
input.ovm-input(type="radio", name="moodDelta", id="moodDelta-w", value="-1", required checked=(e === -1))
label.ovm-input(for="moodDelta-w", title="Worse")
img(src="/img/down.svg", alt="Worse")
input.ovm-input(type="radio", name="moodDelta", id="moodDelta-mw", value="-2", required checked=(e === -2))
label.ovm-input(for="moodDelta-mw", title="Much worse")
img(src="/img/downdown.svg", alt="Much worse")

View file

@ -48,6 +48,13 @@ block content
button(type="submit") Update
h1#feed(style="margin-top:0.5em;") Feed
if recentJournalUpdates.length > 0
.feed-journal-entries
for entry of recentJournalUpdates
.feed-journal-entry
a(href=`/journal/${entry.id}`)= entry.title
+journal_entry_suffix(entry, session.user === entry.user)
hr
+feed(recentUpdates)
h1#invite-codes(style="margin-top:1em;") Invite codes

View file

@ -1,52 +1,43 @@
extends site.pug
include _util.pug
block head
link(rel="stylesheet", href="/css/dashboard.css")
script(type="module", src="https://cdn.jsdelivr.net/npm/chart.js@4.4.6/dist/chart.umd.min.js", nonce=nonce)
block content
h1 Your Journal
p This is where you can log your overall mood every day, and get a glimpse at how your life is going so far!
p In the near future there will be a magnificient graph that will let you visualize your past entries and your mood trends. You must tay stuned.
form#journal-update(action="/journal/update", method="post")
if edit
h1 Edit #{entry.title}
else
h1 Your Journal
p This is where you can log your overall mood every day, and get a glimpse at how your life is going so far!
p In the near future there will be a magnificient graph that will let you visualize your past entries and your mood trends. You must tay stuned.
form#journal-update(action=edit ? `/journal/${id}/edit` : "/journal/update", method="post")
if edit
input(type="hidden", name="action", value="edit", readonly)
.input
span Overall mood change (how do you feel compared to yesterday?)
#ovm
input.ovm-input(type="radio", name="moodDelta", id="moodDelta-mb", value="2", required)
label.ovm-input(for="moodDelta-mb", title="Much better")
img(src="/img/upup.svg", alt="Much better")
input.ovm-input(type="radio", name="moodDelta", id="moodDelta-b", value="1", required)
label.ovm-input(for="moodDelta-b", title="Better")
img(src="/img/up.svg", alt="Better")
input.ovm-input(type="radio", name="moodDelta", id="moodDelta-nc", value="0", required checked)
label.ovm-input(for="moodDelta-nc", title="About the same")
img(src="/img/line.svg", alt="About the same")
input.ovm-input(type="radio", name="moodDelta", id="moodDelta-w", value="-1", required)
label.ovm-input(for="moodDelta-w", title="Worse")
img(src="/img/down.svg", alt="Worse")
input.ovm-input(type="radio", name="moodDelta", id="moodDelta-mw", value="-2", required)
label.ovm-input(for="moodDelta-mw", title="Much worse")
img(src="/img/downdown.svg", alt="Much worse")
+ovm(entry)
.input
label(for="title") Title
input(type="text", name="title", id="title", placeholder="max 64 chars", maxlength="64")
input(type="text", name="title", id="title", placeholder="max 64 chars", maxlength="64", value=edit ? entry.title : "")
.input
label(for="description") Journal entry for today
textarea(name="description", id="description", placeholder="max 4096 chars", maxlength="4096", cols="60", rows="12")
if edit
| #{entry.entry}
.input
span Visibility
- const v = entry?.visibility ?? 1
div#visibility-control
input(type="radio", name="visibility", id="visibility-public", value="1", checked)
input(type="radio", name="visibility", id="visibility-public", value="1", checked=(v === 1))
label(for="visibility-public") Public
br
input(type="radio", name="visibility", id="visibility-private", value="0")
input(type="radio", name="visibility", id="visibility-private", value="0", checked=(v === 0))
label(for="visibility-private") Private
br
input(type="radio", name="visibility", id="visibility-moodChange-only", value="2")
input(type="radio", name="visibility", id="visibility-moodChange-only", value="2", checked=(v === 2))
label(for="visibility-moodChange-only") Mood only
button(type="submit") Submit
button(type="submit")= edit ? "Edit" : "Submit"

View file

@ -1,5 +0,0 @@
extends site.pug
block content
p God i fucking hate myself
textarea(name="description", id="description", placeholder="max 4096 chars", maxlength="4096", cols="60", rows="12")

View file

@ -14,10 +14,13 @@ block content
a(href=`/users/${entry.uname}`)= entry.uname
|
span(title=entry.date.toLocaleString()) #{entryTimestamp}
if entry.updated
span(title=entry.updated.toLocaleString()) (last updated #{updatedTimestamp})
br
br
div
| Mood:
strong= entry.moodString
br
//- I dont know why i made this unsafe but its probably for some markdown thing i was planning on doing
div!= entry.content

View file

@ -39,7 +39,7 @@ html(lang="en")
| You should log in! It's FUN!!
span#ticker-marquee
marquee
| The beta is still a thing that is happening! If something fucks up plz let me know! &lt;3
| 01 03 25: A word from Rae Mipilin herself: Listen to Patricia Taxxon PLEASE / The beta is still a thing that is happening! If something fucks up plz let me know! &lt;3
#page
block page
#content

View file

@ -35,15 +35,7 @@ block content
for entry of userJournalEntries
li
a(href=`/journal/${entry.id}`)= entry.title
span.subtle(title=entry.date.toLocaleString())
| (#{entry.relativeDate}
if entry.visibility !== 1
| ,
if entry.visibility === 0
| private
if entry.visibility === 2
| mood-only
| )
+journal_entry_suffix(entry)
else
div [no entries]
br