data.getdata() is fully implemented
I think it all works now... Signed-off-by: deadvey <deadvey@deadvey.com>
This commit is contained in:
@@ -38,19 +38,19 @@ router.get(`${config.edit_account_base_url}/:user_id`, (req,res) => {
|
||||
res.render("forms/edit_account", {
|
||||
config,
|
||||
locale,
|
||||
user: users[userID],
|
||||
user: data.getdata('users', userID),
|
||||
userID
|
||||
});
|
||||
}); // /delete_account
|
||||
router.get(`${config.edit_post_base_url}/:post_id`, (req,res) => {
|
||||
const post_id = req.params.post_id
|
||||
const post = posts[post_id]
|
||||
const user = users[post['userID']]
|
||||
const postID = req.params.post_id
|
||||
const post = data.getdata('posts', postID)
|
||||
const user = data.getdata('users', post.userID)
|
||||
res.render("forms/edit_post", {
|
||||
config,
|
||||
locale,
|
||||
post,
|
||||
post_id,
|
||||
postID,
|
||||
user,
|
||||
});
|
||||
}); // /edit/:post_id
|
||||
|
||||
@@ -9,9 +9,9 @@ const router = express.Router();
|
||||
router.get("/index/pages", (req,res) => {
|
||||
res.render("indexes/all_pages", {
|
||||
config,
|
||||
posts,
|
||||
users,
|
||||
comments: comments.comments,
|
||||
posts: data.getdata('posts'),
|
||||
users: data.getdata('users'),
|
||||
comments: data.getdata('comments'),
|
||||
});
|
||||
}); // /index/posts
|
||||
router.get("/index/posts", (req,res) => {
|
||||
|
||||
@@ -7,6 +7,8 @@ const { fromUnixTime, format, getUnixTime } = require("date-fns") // A date util
|
||||
const router = express.Router();
|
||||
|
||||
///////////////////// Standard Pages //////////////////////
|
||||
|
||||
// Timeline
|
||||
router.get("/", (req,res) => {
|
||||
// Increment the hitcount
|
||||
if (config.enable_hitcount) {
|
||||
@@ -27,6 +29,8 @@ router.get("/", (req,res) => {
|
||||
func,
|
||||
})
|
||||
}); // /
|
||||
|
||||
// Users
|
||||
router.get("/user/:username", (req, res) => {
|
||||
const userID = func.get_userID(req.params.username)
|
||||
let user = data.getdata('users', userID)
|
||||
@@ -53,6 +57,8 @@ router.get("/user/:username", (req, res) => {
|
||||
})
|
||||
}
|
||||
}); // /user/:username
|
||||
|
||||
// Posts
|
||||
router.get("/post/:post_index", (req, res) => {
|
||||
const postID = req.params.post_index
|
||||
let post = data.getdata('posts', postID)
|
||||
@@ -85,6 +91,7 @@ router.get("/post/:post_index", (req, res) => {
|
||||
}); // /post/:post_index
|
||||
|
||||
|
||||
// Tags
|
||||
router.get("/tag/:tag", (req,res) => {
|
||||
const tag = req.params.tag
|
||||
res.render("pages/tag",
|
||||
@@ -101,6 +108,9 @@ router.get("/tag/:tag", (req,res) => {
|
||||
func,
|
||||
})
|
||||
}); // /tag/:tag
|
||||
|
||||
|
||||
// Comments
|
||||
router.get("/comment/:postID-:commentID", (req,res) => {
|
||||
const commentID = req.params.commentID;
|
||||
const postID = req.params.postID;
|
||||
|
||||
@@ -3,6 +3,8 @@ const config = require('../../config')
|
||||
const data = require('../data')
|
||||
const func = require('../functions')
|
||||
|
||||
const { fromUnixTime, format, getUnixTime } = require("date-fns") // A date utility library
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
////////////////////// SYNDICATION ////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user