mirror of
https://git.sr.ht/~roxwize/mipilin
synced 2025-05-07 22:13:07 +00:00
i dont really know what i added
Signed-off-by: roxwize <rae@roxwize.xyz>
This commit is contained in:
parent
e3c09d7f0d
commit
7b563f5c31
24 changed files with 797 additions and 151 deletions
14
views/_feed.pug
Normal file
14
views/_feed.pug
Normal file
|
@ -0,0 +1,14 @@
|
|||
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]"
|
||||
div= update.date
|
||||
else
|
||||
span [no updates]
|
|
@ -25,8 +25,8 @@ block content
|
|||
details(style="margin-bottom:1em;")
|
||||
summary Moderation
|
||||
p If you're seeing this, you are part of the exclusive club of moderators! You are now entitled to pizza for the rest of your life! And the ability to ban people and create new moods! For FREE!
|
||||
form#dashboard-update-form(action="/update", method="post", onsubmit="disable(this);")
|
||||
select(name="mood")
|
||||
form#dashboard-update-form(action="/update/mood", method="post", onsubmit="disable(this);")
|
||||
select(name="mood", required)
|
||||
//- 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
|
||||
|
@ -34,17 +34,8 @@ block content
|
|||
textarea(name="desc", placeholder="mood description (max 512 chars)", rows="5", maxlength="512")
|
||||
button(type="submit") Update
|
||||
h1(style="margin-top:0.5em;") Feed
|
||||
if recentUpdates.length > 0
|
||||
#dashboard-feed
|
||||
for update of recentUpdates
|
||||
.feed-update
|
||||
div
|
||||
a(href=`/users/${update.user}`)= update.user
|
||||
strong= update.mood
|
||||
div= update.desc || "[no mood description provided]"
|
||||
div= update.date
|
||||
else
|
||||
span [no updates]
|
||||
include _feed.pug
|
||||
+feed(recentUpdates)
|
||||
script.
|
||||
function disable(form) {
|
||||
const btn = form.querySelector("button");
|
||||
|
|
|
@ -15,6 +15,12 @@ block page
|
|||
|
|
||||
a(href="/dashboard") the dashboard
|
||||
| !
|
||||
if session.loggedIn
|
||||
p
|
||||
| You can record your daily thoughts and feelings, public or private, at your
|
||||
|
|
||||
a(href="/journal/") personal journal
|
||||
| .
|
||||
p
|
||||
strong #{users}
|
||||
|
|
||||
|
@ -28,3 +34,7 @@ block page
|
|||
block content
|
||||
p
|
||||
| Hi, this is MiPilin! It lets you tell your friends how you're feeling, as well as keep a journal of your current mood and their trends over time! Due respect goes to imood, from which I borrowed many ideas and basically all of the moods.
|
||||
h1 Global Feed
|
||||
p Look at how all these people are doing!!!
|
||||
include _feed.pug
|
||||
+feed(feedUpdates)
|
||||
|
|
48
views/journal.pug
Normal file
48
views/journal.pug
Normal file
|
@ -0,0 +1,48 @@
|
|||
extends site.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!
|
||||
form#journal-update(action="/update/journal", method="post")
|
||||
.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")
|
||||
.input
|
||||
label(for="description") Journal entry for today
|
||||
textarea(name="description", id="description", placeholder="max 4096 chars", maxlength="4096", cols="60", rows="12")
|
||||
.input
|
||||
span Visibility
|
||||
div#visibility-control
|
||||
input(type="radio", name="visibility", id="visibility-public", value="1", checked)
|
||||
label(for="visibility-public") Public
|
||||
br
|
||||
input(type="radio", name="visibility", id="visibility-private", value="0")
|
||||
label(for="visibility-private") Private
|
||||
br
|
||||
input(type="radio", name="visibility", id="visibility-moodChange-only", value="2")
|
||||
label(for="visibility-moodChange-only") Mood only
|
||||
|
||||
button(type="submit") Submit
|
|
@ -3,6 +3,7 @@ html(lang="en")
|
|||
head
|
||||
meta(charset="UTF-8")
|
||||
meta(name="viewport", content="width=device-width, initial-scale=1.0")
|
||||
meta(name="description", content="Show your mood to the world!")
|
||||
link(rel="stylesheet", href="/css/main.css")
|
||||
block head
|
||||
title #{title} > mipilin
|
||||
|
@ -14,10 +15,9 @@ html(lang="en")
|
|||
nav
|
||||
if session.loggedIn
|
||||
a(href="/dashboard/") Dashboard
|
||||
a(href="/feed/") Feed
|
||||
a(href="/journal/") Journal
|
||||
a(href="/logout/") Log out
|
||||
else
|
||||
a(href="/feed/") Feed
|
||||
a(href="/register/") Sign up
|
||||
a(href="/login") Log in
|
||||
#ticker
|
||||
|
@ -41,6 +41,6 @@ html(lang="en")
|
|||
#flashes
|
||||
for [type, flashGroup] of Object.entries(flashes)
|
||||
for flash of flashGroup
|
||||
div(class=`flash-${type}`)= flash
|
||||
div(class=`flash-${type}`)!= flash
|
||||
block content
|
||||
|
||||
|
|
|
@ -27,4 +27,7 @@ block content
|
|||
div(style="margin-left:2ch;word-wrap:break-word;")= userMood.desc || "[no mood description]"
|
||||
else
|
||||
span User has not yet set a mood!
|
||||
|
||||
br
|
||||
h2 Recent updates
|
||||
include _feed.pug
|
||||
+feed(userMoodFeed, true)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue