diff --git a/src/models/user.js b/src/models/user.js index cad2bd3..dbdc944 100644 --- a/src/models/user.js +++ b/src/models/user.js @@ -9,7 +9,8 @@ const UserSchema = new Schema({ username: { type: String, required: true, index: { unique: true } }, password: { type: String, required: true }, realname: { type: String, required: true }, - author: { type: Boolean, default: false } + author: { type: Boolean, default: false }, + avatar: { type: String, default: 'default.jpg' } }); diff --git a/src/routes/a/[slug].json.js b/src/routes/a/[slug].json.js index 48a706e..22b1771 100644 --- a/src/routes/a/[slug].json.js +++ b/src/routes/a/[slug].json.js @@ -6,14 +6,14 @@ export async function get(req, res, next) { const { slug } = req.params; const article = await Article.findOne({ slug }).populate({ path: 'author', - select: 'realname' + select: 'realname avatar' }).populate({ path: 'category' }); if (article) { article.set({ views: article.views + 1 }); - article.save(); + await article.save(); res.writeHead(200, { 'Content-Type': 'application/json' }); diff --git a/src/routes/a/[slug].svelte b/src/routes/a/[slug].svelte index 70fc58e..5d38884 100644 --- a/src/routes/a/[slug].svelte +++ b/src/routes/a/[slug].svelte @@ -82,6 +82,10 @@ margin: 0 0 0.5em 0; } + .content :global(img) { + max-width: 100%; + } + @media (min-width: 800px) { .content { width: 75vw; @@ -154,7 +158,7 @@
{#if comment.author_user} {comment.author_user.realname} (verified) - {new Date(comment.created_at).toLocaleString()} diff --git a/src/routes/a/[slug]/comments.js b/src/routes/a/[slug]/comments.js index 8bd731c..f49329d 100644 --- a/src/routes/a/[slug]/comments.js +++ b/src/routes/a/[slug]/comments.js @@ -4,7 +4,7 @@ export async function get(req, res) { const { slug } = req.params; const article = await Article.findOne({ slug }).populate({ path: 'comments.author_user', - select: 'realname' + select: 'realname avatar' }); if (article) { res.writeHead(200, { @@ -25,7 +25,7 @@ export async function post(req, res) { const { slug } = req.params; let article = await Article.findOne({ slug }).populate({ path: 'comments.author_user', - select: 'realname' + select: 'realname avatar' }); if (article) { @@ -63,7 +63,7 @@ export async function post(req, res) { } else { article.comments.push({ author, content }); } - article.save(); + await article.save(); res.writeHead(200, { 'Content-Type': 'application/json' }); diff --git a/src/routes/cms/index.svelte b/src/routes/cms/index.svelte index 5df595c..8b5a522 100644 --- a/src/routes/cms/index.svelte +++ b/src/routes/cms/index.svelte @@ -24,6 +24,8 @@
Publish a new article
Edit an existing articleComing soon!Delete an article
+Account Settings
+Change your avatar
{:else}Welcome to your account. Contact the webmaster if your account needs publisher privileges.
{/if} diff --git a/src/routes/contact.svelte b/src/routes/contact.svelte index 7c3bf24..6662c93 100644 --- a/src/routes/contact.svelte +++ b/src/routes/contact.svelte @@ -17,7 +17,7 @@Myles C. Linden
-Creative Operations Director
+Director of Financial Growth and Prosperity
FemboyFinancial Holdings Co., Ltd. (USA LLC)
1198 South 6th Streetdiff --git a/src/routes/me/avatar.svelte b/src/routes/me/avatar.svelte new file mode 100644 index 0000000..ac4daf3 --- /dev/null +++ b/src/routes/me/avatar.svelte @@ -0,0 +1,70 @@ + + +
Change Avatar
++ + ← This is you, you ugly piece of shit. God, no wonder you're an incel. +
+ +Or better yet, erase your wretched face from this site entirely:
+