mirror of
https://git.sr.ht/~roxwize/mipilin
synced 2025-05-07 22:13:07 +00:00
this is the initial commit for my AWESOME website
Signed-off-by: roxwize <rae@roxwize.xyz>
This commit is contained in:
commit
e3c09d7f0d
42 changed files with 5710 additions and 0 deletions
56
views/dashboard.pug
Normal file
56
views/dashboard.pug
Normal file
|
@ -0,0 +1,56 @@
|
|||
extends site.pug
|
||||
|
||||
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
|
||||
for mood of moodHistory
|
||||
li
|
||||
strong= mood.mood
|
||||
|
|
||||
| #{mood.date}
|
||||
|
||||
block content
|
||||
if user.moderator
|
||||
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")
|
||||
//- 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
|
||||
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]
|
||||
script.
|
||||
function disable(form) {
|
||||
const btn = form.querySelector("button");
|
||||
btn.setAttribute("disabled", true);
|
||||
|
||||
setTimeout(() => {
|
||||
btn.removeAttribute("disabled");
|
||||
}, 3000)
|
||||
}
|
30
views/index.pug
Normal file
30
views/index.pug
Normal file
|
@ -0,0 +1,30 @@
|
|||
extends site.pug
|
||||
|
||||
block head
|
||||
style
|
||||
| #content { margin-left: 256px; }
|
||||
|
||||
block page
|
||||
#sidebar
|
||||
h1 MiPilin
|
||||
p(style="margin-top:0;")
|
||||
| Thx for being a part of the MiPilin beta!
|
||||
if session.loggedIn
|
||||
|
|
||||
| If you want to change your mood, update your profile, and see how your friends are doing, visit
|
||||
|
|
||||
a(href="/dashboard") the dashboard
|
||||
| !
|
||||
p
|
||||
strong #{users}
|
||||
|
|
||||
| registered users
|
||||
h2 Recent updates
|
||||
ul(style="list-style:none;padding-inline-start:0;")
|
||||
for update of recentUpdates
|
||||
li
|
||||
a(href=`/users/${update.user}`)= update.user
|
||||
|
||||
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.
|
8
views/login.pug
Normal file
8
views/login.pug
Normal file
|
@ -0,0 +1,8 @@
|
|||
extends site.pug
|
||||
|
||||
block content
|
||||
strong Log in placeholder
|
||||
form(action="/login", method="post")
|
||||
input(type="text", name="name", placeholder="Username")
|
||||
input(type="password", name="pass", placeholder="Password")
|
||||
button(type="submit") Log In
|
12
views/register.pug
Normal file
12
views/register.pug
Normal file
|
@ -0,0 +1,12 @@
|
|||
extends site.pug
|
||||
|
||||
block content
|
||||
strong Sign up placeholder
|
||||
form(action="/register", method="post")
|
||||
input(type="text", name="name", placeholder="Username", maxlength="26", required)
|
||||
br
|
||||
input(type="email", name="email", placeholder="Email", required)
|
||||
br
|
||||
input(type="password", name="pass", placeholder="Password", required)
|
||||
br
|
||||
button(type="submit") Sign Up
|
46
views/site.pug
Normal file
46
views/site.pug
Normal file
|
@ -0,0 +1,46 @@
|
|||
doctype html
|
||||
html(lang="en")
|
||||
head
|
||||
meta(charset="UTF-8")
|
||||
meta(name="viewport", content="width=device-width, initial-scale=1.0")
|
||||
link(rel="stylesheet", href="/css/main.css")
|
||||
block head
|
||||
title #{title} > mipilin
|
||||
body
|
||||
main
|
||||
header
|
||||
a(href="/")
|
||||
img#header-logo(src="/img/logo.svg", alt="logo")
|
||||
nav
|
||||
if session.loggedIn
|
||||
a(href="/dashboard/") Dashboard
|
||||
a(href="/feed/") Feed
|
||||
a(href="/logout/") Log out
|
||||
else
|
||||
a(href="/feed/") Feed
|
||||
a(href="/register/") Sign up
|
||||
a(href="/login") Log in
|
||||
#ticker
|
||||
div
|
||||
if session.loggedIn
|
||||
span
|
||||
a(href=`/users/${session.user}`)= session.user
|
||||
|
|
||||
| is feeling
|
||||
|
|
||||
strong #{currentMood || "nothing...??"}
|
||||
else
|
||||
| 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! <3
|
||||
#page
|
||||
block page
|
||||
#content
|
||||
if flashes
|
||||
#flashes
|
||||
for [type, flashGroup] of Object.entries(flashes)
|
||||
for flash of flashGroup
|
||||
div(class=`flash-${type}`)= flash
|
||||
block content
|
||||
|
30
views/user.pug
Normal file
30
views/user.pug
Normal file
|
@ -0,0 +1,30 @@
|
|||
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
|
||||
h1= user.name
|
||||
if !isSelf
|
||||
form(action=`/users/${user.name}/follow`, method="post")
|
||||
button(type="submit")= isFollowing ? "unfollow" : "follow"
|
||||
br
|
||||
span= user.bio || "[no bio]"
|
||||
if user.website
|
||||
br
|
||||
a(href=user.website)= user.website
|
||||
br
|
||||
br
|
||||
h2 Current mood
|
||||
if userMood
|
||||
span
|
||||
| Feeling
|
||||
|
|
||||
strong
|
||||
if isSelf
|
||||
| #{currentMood}
|
||||
else
|
||||
| #{userMood.mood}
|
||||
br
|
||||
div(style="margin-left:2ch;word-wrap:break-word;")= userMood.desc || "[no mood description]"
|
||||
else
|
||||
span User has not yet set a mood!
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue