Compare commits
7 Commits
9b10188066
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 0cfb3f6e60 | |||
| 46e7394a6f | |||
| 736edee1b0 | |||
| 63ca617895 | |||
| 9aff454ec2 | |||
| 5a14b125d2 | |||
| 1a0b16feb2 |
@@ -9,7 +9,9 @@
|
|||||||
"ejs": "^3.1.10",
|
"ejs": "^3.1.10",
|
||||||
"express": "^5.2.1",
|
"express": "^5.2.1",
|
||||||
"express-router": "^0.0.1",
|
"express-router": "^0.0.1",
|
||||||
|
"highlight.js": "^11.11.1",
|
||||||
"markdown-it": "^14.1.0",
|
"markdown-it": "^14.1.0",
|
||||||
|
"markdown-it-named-code-blocks": "^1.1.0",
|
||||||
"mssql": "^12.2.0",
|
"mssql": "^12.2.0",
|
||||||
"package.json": "^2.0.1"
|
"package.json": "^2.0.1"
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-6
@@ -14,7 +14,7 @@ export function increment_hitcount(postID = -1) { // -1 Means it will increment
|
|||||||
writedata('hitcount', hitcount);
|
writedata('hitcount', hitcount);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let post = getdata('posts','id', postID);
|
let post = getdata('posts','id', postID)[0];
|
||||||
if (post == 1) // Does not exist
|
if (post == 1) // Does not exist
|
||||||
{
|
{
|
||||||
return 1
|
return 1
|
||||||
@@ -86,18 +86,19 @@ export function getdata(table_name, key=-1, value=-1) {
|
|||||||
{ // id is the index
|
{ // id is the index
|
||||||
if (value < result.length && value >= 0)
|
if (value < result.length && value >= 0)
|
||||||
{
|
{
|
||||||
return result[value]
|
return [result[value]]
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
console.log("No object of this ID exists for the selected table")
|
console.log("No object of this ID exists for the selected table", table_name)
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result[func.find_key_value_pair(result, key, value)]
|
let return_value = func.find_key_value_pair(result, key, value)
|
||||||
return -1 // This index doesn't exist
|
return return_value
|
||||||
}
|
}
|
||||||
return result.slice(- config['data_request_limit'])
|
let return_value = result.slice(- config['data_request_limit'])
|
||||||
|
return return_value
|
||||||
break;
|
break;
|
||||||
case 'hitcount':
|
case 'hitcount':
|
||||||
result = func.require_module('../data/data.json') // This file is actually called data.json
|
result = func.require_module('../data/data.json') // This file is actually called data.json
|
||||||
|
|||||||
@@ -127,6 +127,8 @@ export function render_comment(comment_content)
|
|||||||
export function render_md(content)
|
export function render_md(content)
|
||||||
{
|
{
|
||||||
const markdownit = require("markdown-it")
|
const markdownit = require("markdown-it")
|
||||||
|
const hljs = require("highlight.js");
|
||||||
|
const namedCodeBlocks = require("markdown-it-named-code-blocks");
|
||||||
const md = markdownit
|
const md = markdownit
|
||||||
({ // this is just defining some options for markdown-it, should I add this to config.json?
|
({ // this is just defining some options for markdown-it, should I add this to config.json?
|
||||||
html: false,
|
html: false,
|
||||||
@@ -135,11 +137,26 @@ export function render_md(content)
|
|||||||
linkify: false,
|
linkify: false,
|
||||||
typographer: true,
|
typographer: true,
|
||||||
quotes: locale.quotes,
|
quotes: locale.quotes,
|
||||||
|
highlight: function (content, lang) {
|
||||||
|
if (lang && hljs.getLanguage(lang)) {
|
||||||
|
return (
|
||||||
|
'<pre class="hljs"><code>' +
|
||||||
|
hljs.highlight(content, { language: lang, ignoreIllegals: true }).value +
|
||||||
|
"</code></pre>"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
'<pre class="hljs"><code>' + md.utils.escapeHtml(content) + "</code></pre>"
|
||||||
|
);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
.use(namedCodeBlocks)
|
||||||
.disable('image');
|
.disable('image');
|
||||||
return md.render(content)
|
return md.render(content)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
export function find_key_value_pair(data_array, key, value) {
|
export function find_key_value_pair(data_array, key, value) {
|
||||||
for (let i = 0; i < data_array.length; i++) {
|
for (let i = 0; i < data_array.length; i++) {
|
||||||
if (data_array[i][key] == value) {
|
if (data_array[i][key] == value) {
|
||||||
@@ -148,3 +165,18 @@ export function find_key_value_pair(data_array, key, value) {
|
|||||||
}
|
}
|
||||||
return -1
|
return -1
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Returns a list of matches
|
||||||
|
export function find_key_value_pair(data_array, key, value) {
|
||||||
|
let return_list = []
|
||||||
|
for (let i = 0; i < data_array.length; i++) {
|
||||||
|
let element = data_array[i][key]
|
||||||
|
if (element == value
|
||||||
|
|| (Array.isArray(element) && element.includes(value))) {
|
||||||
|
return_list.push(data_array[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return return_list
|
||||||
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ router.post(`${config.site_path}/submit_post`, (req,res) => {
|
|||||||
fs.writeFileSync(`../data/posts.json`, `${JSON.stringify(posts)}`, 'utf-8');
|
fs.writeFileSync(`../data/posts.json`, `${JSON.stringify(posts)}`, 'utf-8');
|
||||||
comments.push({'id': id, 'comments': []})
|
comments.push({'id': id, 'comments': []})
|
||||||
fs.writeFileSync(`../data/comments.json`, `${JSON.stringify(comments)}`)
|
fs.writeFileSync(`../data/comments.json`, `${JSON.stringify(comments)}`)
|
||||||
res.redirect(302, config.site_path);
|
res.redirect(302, `${config.sitr_path}/post/${id}`);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
res.render("partials/message", {
|
res.render("partials/message", {
|
||||||
|
|||||||
+11
-4
@@ -5,12 +5,15 @@ const func = require('../functions')
|
|||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
|
|
||||||
///////////////////// Form pages ////////////////////////////
|
///////////////////// Form pages ////////////////////////////
|
||||||
|
// new post
|
||||||
router.get(`${config.site_path}/${config.new_post_url}`, (req,res) => {
|
router.get(`${config.site_path}/${config.new_post_url}`, (req,res) => {
|
||||||
res.render("forms/new_post", {
|
res.render("forms/new_post", {
|
||||||
config,
|
config,
|
||||||
locale,
|
locale,
|
||||||
});
|
});
|
||||||
}); // /post
|
}); // /post
|
||||||
|
|
||||||
|
// signup
|
||||||
router.get(`${config.site_path}/${config.signup_url}`, (req,res) => {
|
router.get(`${config.site_path}/${config.signup_url}`, (req,res) => {
|
||||||
// if the server does allow signup
|
// if the server does allow signup
|
||||||
if (config.allow_signup == true) {
|
if (config.allow_signup == true) {
|
||||||
@@ -29,24 +32,28 @@ router.get(`${config.site_path}/${config.signup_url}`, (req,res) => {
|
|||||||
}
|
}
|
||||||
// If allow_signup is undefined or not a boolean, error
|
// If allow_signup is undefined or not a boolean, error
|
||||||
else {
|
else {
|
||||||
res.redirect(301,"/")
|
res.redirect(301,config.site_path)
|
||||||
console.log("Error, invalid value for allow_signup (bool)")
|
console.log("Error, invalid value for allow_signup (bool)")
|
||||||
}
|
}
|
||||||
}); // /signup
|
}); // /signup
|
||||||
|
|
||||||
|
// edit account
|
||||||
router.get(`${config.site_path}/${config.edit_account_base_url}/:user_id`, (req,res) => {
|
router.get(`${config.site_path}/${config.edit_account_base_url}/:user_id`, (req,res) => {
|
||||||
const userID = parseInt(req.params.user_id);
|
const userID = parseInt(req.params.user_id);
|
||||||
res.render("forms/edit_account",
|
res.render("forms/edit_account",
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
locale,
|
locale,
|
||||||
user: data.getdata('users', 'id', userID),
|
user: data.getdata('users', 'id', userID)[0],
|
||||||
userID
|
userID
|
||||||
});
|
});
|
||||||
}); // /delete_account
|
}); // /delete_account
|
||||||
|
|
||||||
|
// edit post
|
||||||
router.get(`${config.site_path}/${config.edit_post_base_url}/:post_id`, (req,res) => {
|
router.get(`${config.site_path}/${config.edit_post_base_url}/:post_id`, (req,res) => {
|
||||||
const postID = req.params.post_id
|
const postID = req.params.post_id
|
||||||
const post = data.getdata('posts','id', postID)
|
const post = data.getdata('posts','id', postID)[0]
|
||||||
const user = data.getdata('users', 'id', post.userID)
|
const user = data.getdata('users', 'id', post.userID)[0]
|
||||||
res.render("forms/edit_post",
|
res.render("forms/edit_post",
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
|
|||||||
@@ -33,16 +33,17 @@ router.get(config.site_path, (req,res) => {
|
|||||||
// Users
|
// Users
|
||||||
router.get(`${config.site_path}/user/:username`, (req, res) => {
|
router.get(`${config.site_path}/user/:username`, (req, res) => {
|
||||||
const userID = func.get_userID(req.params.username)
|
const userID = func.get_userID(req.params.username)
|
||||||
let user = data.getdata('users', 'id', userID)
|
let posts = data.getdata('posts', 'userID', userID);
|
||||||
|
let user = data.getdata('users', 'id', userID)[0];
|
||||||
if (userID != -1) {
|
if (userID != -1) {
|
||||||
res.render("pages/user",
|
res.render("pages/user",
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
locale,
|
locale,
|
||||||
posts: data.getdata('posts'),
|
posts,
|
||||||
user,
|
user,
|
||||||
userID: userID,
|
userID: userID,
|
||||||
comments: data.getdata('comments'),
|
comments: data.getdata('comments', 'postID'),
|
||||||
fromUnixTime,
|
fromUnixTime,
|
||||||
format,
|
format,
|
||||||
getUnixTime,
|
getUnixTime,
|
||||||
@@ -61,7 +62,7 @@ router.get(`${config.site_path}/user/:username`, (req, res) => {
|
|||||||
// Posts
|
// Posts
|
||||||
router.get(`${config.site_path}/post/:post_index`, (req, res) => {
|
router.get(`${config.site_path}/post/:post_index`, (req, res) => {
|
||||||
const postID = parseInt(req.params.post_index)
|
const postID = parseInt(req.params.post_index)
|
||||||
let post = data.getdata('posts','id', postID)
|
let post = data.getdata('posts','id', postID)[0]
|
||||||
if (post == 1) { // data.getdata returns error code 1 if nothing is available
|
if (post == 1) { // data.getdata returns error code 1 if nothing is available
|
||||||
res.render("partials/message", {
|
res.render("partials/message", {
|
||||||
message: locale.post_doesnt_exist,
|
message: locale.post_doesnt_exist,
|
||||||
@@ -78,8 +79,8 @@ router.get(`${config.site_path}/post/:post_index`, (req, res) => {
|
|||||||
locale,
|
locale,
|
||||||
post,
|
post,
|
||||||
postID,
|
postID,
|
||||||
user: data.getdata('users','id', post.userID),
|
user: data.getdata('users','id', post.userID)[0],
|
||||||
comments: data.getdata('comments','id', postID),
|
comments: data.getdata('comments','id', postID)[0]["comments"],
|
||||||
fromUnixTime,
|
fromUnixTime,
|
||||||
format,
|
format,
|
||||||
getUnixTime,
|
getUnixTime,
|
||||||
@@ -88,7 +89,7 @@ router.get(`${config.site_path}/post/:post_index`, (req, res) => {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
console.log("Error loading page")
|
console.log("Error loading page")
|
||||||
res.redirect(301,"/")
|
res.redirect(301,config.site_path)
|
||||||
}
|
}
|
||||||
}); // /post/:post_index
|
}); // /post/:post_index
|
||||||
|
|
||||||
@@ -117,7 +118,7 @@ router.get(`${config.site_path}/comment/:postID-:commentID`, (req,res) => {
|
|||||||
const commentID = parseInt(req.params.commentID);
|
const commentID = parseInt(req.params.commentID);
|
||||||
const postID = parseInt(req.params.postID);
|
const postID = parseInt(req.params.postID);
|
||||||
|
|
||||||
let posts_comments = data.getdata('comments', 'id', postID)["comments"]
|
let posts_comments = data.getdata('comments', 'id', postID)[0]["comments"]
|
||||||
let comment = 1
|
let comment = 1
|
||||||
// For loop to find the comment with matching ID
|
// For loop to find the comment with matching ID
|
||||||
posts_comments.forEach((current_comment, index) => {
|
posts_comments.forEach((current_comment, index) => {
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ router.get(`${config.site_path}/rss`, (req,res) => {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
res.setHeader('content-type', 'application/rss+xml');
|
res.setHeader('content-type', 'application/rss+xml');
|
||||||
res.render("syndication/global_rss", {
|
res.render("syndication/rss", {
|
||||||
|
users: data.getdata('users'),
|
||||||
config,
|
config,
|
||||||
posts: data.getdata('posts'),
|
posts: data.getdata('posts'),
|
||||||
func,
|
func,
|
||||||
@@ -26,9 +27,10 @@ router.get(`${config.site_path}/rss`, (req,res) => {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
// user RSS protocol gets
|
// user RSS protocol gets
|
||||||
|
// TODO specific title field and descriptions??
|
||||||
router.get(`${config.site_path}/user/:username/rss`, (req,res) => {
|
router.get(`${config.site_path}/user/:username/rss`, (req,res) => {
|
||||||
const username = req.params.username;
|
const username = req.params.username;
|
||||||
const userID = func.get_userID(username);
|
const user = data.getdata('users','username',username)[0]; // Get the user data
|
||||||
if (config.rss == false) {
|
if (config.rss == false) {
|
||||||
res.render("partials/message", {
|
res.render("partials/message", {
|
||||||
message: locale.rss_disabled,
|
message: locale.rss_disabled,
|
||||||
@@ -37,11 +39,11 @@ router.get(`${config.site_path}/user/:username/rss`, (req,res) => {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
res.setHeader('content-type', 'application/rss+xml');
|
res.setHeader('content-type', 'application/rss+xml');
|
||||||
res.render("syndication/user_rss", {
|
res.render("syndication/rss", {
|
||||||
|
users: [user],
|
||||||
config,
|
config,
|
||||||
posts: data.getdata('posts'),
|
posts: data.getdata('posts','id',user['id']),
|
||||||
func,
|
func,
|
||||||
userID,
|
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@@ -55,7 +57,7 @@ router.get(`${config.site_path}/atom`, (req,res) => {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
res.setHeader('content-type', 'application/rss+xml');
|
res.setHeader('content-type', 'application/rss+xml');
|
||||||
res.render("syndication/global_atom", {
|
res.render("syndication/atom", {
|
||||||
config,
|
config,
|
||||||
posts: data.getdata('posts'),
|
posts: data.getdata('posts'),
|
||||||
func,
|
func,
|
||||||
@@ -66,7 +68,6 @@ router.get(`${config.site_path}/atom`, (req,res) => {
|
|||||||
// user ATOM protocol gets
|
// user ATOM protocol gets
|
||||||
router.get(`${config.site_path}/user/:username/atom`, (req,res) => {
|
router.get(`${config.site_path}/user/:username/atom`, (req,res) => {
|
||||||
const username = req.params.username;
|
const username = req.params.username;
|
||||||
const userID = func.get_userID(username);
|
|
||||||
if (config.atom == false) {
|
if (config.atom == false) {
|
||||||
res.render("partials/message", {
|
res.render("partials/message", {
|
||||||
message: locale.atom_disabled,
|
message: locale.atom_disabled,
|
||||||
@@ -75,11 +76,10 @@ router.get(`${config.site_path}/user/:username/atom`, (req,res) => {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
res.setHeader('content-type', 'application/rss+xml');
|
res.setHeader('content-type', 'application/rss+xml');
|
||||||
res.render("syndication/user_atom", {
|
res.render("syndication/atom", {
|
||||||
config,
|
config,
|
||||||
posts: data.getdata('posts'),
|
posts: data.getdata('posts'),
|
||||||
func,
|
func,
|
||||||
userID,
|
|
||||||
getUnixTime,
|
getUnixTime,
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|||||||
+4
-1
@@ -50,6 +50,9 @@ function perform_checks()
|
|||||||
exit_flag = false
|
exit_flag = false
|
||||||
required_values = ['site_admin','seperator','site_name','site_url','locale','port','cache_data','allow_signup','site_description','request_data_limit','enable_hitcount','charset','root_path','edit_account_base_url','new_post_url','signup_url','default_commenter_username','rss','atom','date_format','time_zone','css']
|
required_values = ['site_admin','seperator','site_name','site_url','locale','port','cache_data','allow_signup','site_description','request_data_limit','enable_hitcount','charset','root_path','edit_account_base_url','new_post_url','signup_url','default_commenter_username','rss','atom','date_format','time_zone','css']
|
||||||
// Perform some standard checks:
|
// Perform some standard checks:
|
||||||
|
if (config.site_path.slice(-1) == "/") { // cut off a trailing /
|
||||||
|
config.site_path = config.site_path.substring(0,config.site_path.length-1);
|
||||||
|
}
|
||||||
|
|
||||||
// data_storage
|
// data_storage
|
||||||
switch (config.data_storage)
|
switch (config.data_storage)
|
||||||
@@ -83,6 +86,6 @@ function perform_checks()
|
|||||||
perform_checks()
|
perform_checks()
|
||||||
|
|
||||||
app.listen(config.port, () => {
|
app.listen(config.port, () => {
|
||||||
console.log(`Server is running at http://localhost:${config.port} webroot: ${config.root_path}`);
|
console.log(`Server is running at http://localhost:${config.port}${config.site_path} webroot: ${config.root_path}`);
|
||||||
console.log("Running in: ", __dirname)
|
console.log("Running in: ", __dirname)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,22 +1,27 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="<%= config.language %">
|
<html lang="<%= config.language %>">
|
||||||
<head>
|
<head>
|
||||||
<%- include("../partials/head") %>
|
<%- include("../partials/head") %>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<form action="<%= config.site_path %>/submit_edit_user" method="POST">
|
<div id="main">
|
||||||
<input name="userID" type="hidden" value="<%= userID %>">
|
<header id="site-header">
|
||||||
<label><%= locale.password %>:</label><br/>
|
<%- include("../headers/site_wide") %>
|
||||||
<input type="password" required id="password" name="password"><br/><br/>
|
</header>
|
||||||
|
<form action="<%= config.site_path %>/submit_edit_user" method="POST">
|
||||||
|
<input name="userID" type="hidden" value="<%= userID %>">
|
||||||
|
<label><%= locale.password %>:</label><br/>
|
||||||
|
<input type="password" required id="password" name="password"><br/><br/>
|
||||||
|
|
||||||
<label><%= locale.prettyname %>:</label><br/>
|
<label><%= locale.prettyname %>:</label><br/>
|
||||||
<input name="prettyname" value="<%= user.prettyname %>"><br/><br/>
|
<input name="prettyname" value="<%= user.prettyname %>"><br/><br/>
|
||||||
|
|
||||||
<label><%= locale.description %>:</label><br/>
|
<label><%= locale.description %>:</label><br/>
|
||||||
<textarea name="description"><%= user.description %></textarea><br/><br/>
|
<textarea name="description"><%= user.description %></textarea><br/><br/>
|
||||||
|
|
||||||
<label><%- locale.delete_account_confirmation %>: </label><input type="checkbox" name="agreement"><br/>
|
<label><%- locale.delete_account_confirmation %>: </label><input type="checkbox" name="agreement"><br/>
|
||||||
<input type="submit" value="Submit"><br/>
|
<input type="submit" value="Submit"><br/>
|
||||||
</form>
|
</form>
|
||||||
</body>
|
</div>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+24
-19
@@ -1,27 +1,32 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="<%= config.language %>">
|
<html lang="<%= config.language %>">
|
||||||
<head>
|
<head>
|
||||||
<%- include("../partials/head") %>
|
<%- include("../partials/head") %>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<form action="<%= config.site_path %>/submit_edit_post" method="POST" onsubmit="sha512password()">
|
<div id="main">
|
||||||
<input name="userID" type="hidden" value="<%= post['userID'] %>">
|
<header id="site-header">
|
||||||
<input name="postID" type="hidden" value="<%= postID %>">
|
<%- include("../headers/site_wide") %>
|
||||||
|
</header>
|
||||||
|
<form action="<%= config.site_path %>/submit_edit_post" method="POST" onsubmit="sha512password()">
|
||||||
|
<input name="userID" type="hidden" value="<%= post['userID'] %>">
|
||||||
|
<input name="postID" type="hidden" value="<%= postID %>">
|
||||||
|
|
||||||
<label><%= locale.password %>:</label><br/>
|
<label><%= locale.password %>:</label><br/>
|
||||||
<input type="password" required id="password" name="password"><br/><br/>
|
<input type="password" required id="password" name="password"><br/><br/>
|
||||||
|
|
||||||
<label><%= locale.title %>:</label><br/>
|
<label><%= locale.title %>:</label><br/>
|
||||||
<input value="<%=post['title'] %>" required name="title"><br/><br/>
|
<input value="<%=post['title'] %>" required name="title"><br/><br/>
|
||||||
|
|
||||||
<label><%= locale.post_content %>:</label><br/>
|
<label><%= locale.post_content %>:</label><br/>
|
||||||
<textarea required name="content"><%= post['content'] %></textarea><br/><br/>
|
<textarea required name="content"><%= post['content'] %></textarea><br/><br/>
|
||||||
|
|
||||||
<label><%= locale.tags %>:</label><br/>
|
<label><%= locale.tags %>:</label><br/>
|
||||||
<input value="<%= post['tags'] %>" name="tags"><br/><br/>
|
<input value="<%= post['tags'] %>" name="tags"><br/><br/>
|
||||||
|
|
||||||
<label>Delete forever (no undo): </label><input name="delete" type="checkbox"><br/>
|
<label>Delete forever (no undo): </label><input name="delete" type="checkbox"><br/>
|
||||||
<input type="submit" value="Submit"><br/>
|
<input type="submit" value="Submit"><br/>
|
||||||
</form>
|
</form>
|
||||||
</body>
|
</div>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+20
-14
@@ -4,22 +4,28 @@
|
|||||||
<%- include('../partials/head.ejs') %>
|
<%- include('../partials/head.ejs') %>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<form action="<%= config.site_path %>/submit_post" method="POST">
|
<div id="main">
|
||||||
<label><%= locale.username %>:</label><br/>
|
<header id="site-header">
|
||||||
<input required name="username"><br/><br/>
|
<%- include("../headers/site_wide") %>
|
||||||
|
</header>
|
||||||
|
<form action="<%= config.site_path %>/submit_post" method="POST">
|
||||||
|
<label><%= locale.username %>:</label><br/>
|
||||||
|
<input required name="username"><br/><br/>
|
||||||
|
|
||||||
<label><%= locale.password %>:</label><br/>
|
<label><%= locale.password %>:</label><br/>
|
||||||
<input type="password" required id="password" name="password"><br/><br/>
|
<input type="password" required id="password" name="password"><br/><br/>
|
||||||
|
|
||||||
<label><%= locale.title %>:</label><br/>
|
<label><%= locale.title %>:</label><br/>
|
||||||
<input required name="title"><br/><br/>
|
<input required name="title"><br/><br/>
|
||||||
|
|
||||||
<label><%= locale.post_content %>:</label><br/>
|
<label><%= locale.post_content %>:</label><br/>
|
||||||
<textarea required name="content"></textarea><br/><br/>
|
<textarea required name="content"></textarea><br/><br/>
|
||||||
|
|
||||||
<label><%= locale.tags %>:</label><br/>
|
<label><%= locale.tags %>:</label><br/>
|
||||||
<input name="tags"><br/><br/>
|
<input name="tags"><br/><br/>
|
||||||
|
|
||||||
<input type="submit" value="Submit"><br/>
|
<input type="submit" value="Submit"><br/>
|
||||||
</body>
|
</form>
|
||||||
</form></html>
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|||||||
+22
-17
@@ -1,24 +1,29 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
</html lang="<%= config.language %>">
|
</html lang="<%= config.language %>">
|
||||||
<head>
|
<head>
|
||||||
<%- include("../partials/head") %>
|
<%- include("../partials/head") %>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<form action="<%= config.site_path %>/submit_signup" method="POST">
|
<div id="main">
|
||||||
<label><%= locale.username %></label><br/>
|
<header id="site-header">
|
||||||
<input required name="username"><br/><br/>
|
<%- include("../headers/site_wide") %>
|
||||||
|
</header>
|
||||||
|
<form action="<%= config.site_path %>/submit_signup" method="POST">
|
||||||
|
<label><%= locale.username %></label><br/>
|
||||||
|
<input required name="username"><br/><br/>
|
||||||
|
|
||||||
<label><%= locale.prettyname %></label><br/>
|
<label><%= locale.prettyname %></label><br/>
|
||||||
<input required name="prettyname"><br/><br/>
|
<input required name="prettyname"><br/><br/>
|
||||||
|
|
||||||
<label><%= locale.password %></label><br/>
|
<label><%= locale.password %></label><br/>
|
||||||
<input type="password" required id="password" name="password"><br/><br/>
|
<input type="password" required id="password" name="password"><br/><br/>
|
||||||
|
|
||||||
<label><%= locale.description %></label><br/>
|
<label><%= locale.description %></label><br/>
|
||||||
<textarea id="description" name="description"></textarea><br/><br/>
|
<textarea id="description" name="description"></textarea><br/><br/>
|
||||||
|
|
||||||
<label><%- locale.signup_agreement %>: </label><input type="checkbox" name="agreement" required><br/>
|
<label><%- locale.signup_agreement %>: </label><input type="checkbox" name="agreement" required><br/>
|
||||||
<input type="submit" value="Submit"><br/>
|
<input type="submit" value="Submit"><br/>
|
||||||
</form>
|
</form>
|
||||||
</body>
|
</div>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+46
-44
@@ -1,47 +1,49 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="<%= config.charset %>">
|
<html lang="<%= config.charset %>">
|
||||||
<head>
|
<head>
|
||||||
<%- include("../partials/head") %>
|
<%- include("../partials/head") %>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
Misc:<br/>
|
<div id="main">
|
||||||
<a href="<%= config.site_path %>/">Home Page</a><br/>
|
Misc:<br/>
|
||||||
<a href="<%= config.site_path %><%= config.new_post_url %>">New Post Form</a><br/>
|
<a href="<%= config.site_path %>/">Home Page</a><br/>
|
||||||
<a href="<%= config.site_path %><%= config.signup_url %>">Signup Form</a><br/>
|
<a href="<%= config.site_path %><%= config.new_post_url %>">New Post Form</a><br/>
|
||||||
Indexes:<br/>
|
<a href="<%= config.site_path %><%= config.signup_url %>">Signup Form</a><br/>
|
||||||
<a href="<%= config.site_path %>/index/posts">Posts Index</a><br/>
|
Indexes:<br/>
|
||||||
<a href="<%= config.site_path %>/index/users">Users Index</a><br/>
|
<a href="<%= config.site_path %>/index/posts">Posts Index</a><br/>
|
||||||
<a href="<%= config.site_path %>/index/comments">Comments Index</a><br/>
|
<a href="<%= config.site_path %>/index/users">Users Index</a><br/>
|
||||||
Posts:<br/>
|
<a href="<%= config.site_path %>/index/comments">Comments Index</a><br/>
|
||||||
<% for (let postID = 0; postID < posts.length; postID++) { %>
|
Posts:<br/>
|
||||||
<% if (posts[postID]["deleted"] != true) { %>
|
<% for (let postID = 0; postID < posts.length; postID++) { %>
|
||||||
<a href="<%= config.site_path %>/post/<%= postID %>"><%= posts[postID]["title"] %></a><br/>
|
<% if (posts[postID]["deleted"] != true) { %>
|
||||||
<% }; %>
|
<a href="<%= config.site_path %>/post/<%= postID %>"><%= posts[postID]["title"] %></a><br/>
|
||||||
<% }; %>
|
<% }; %>
|
||||||
Comments:<br/>
|
<% }; %>
|
||||||
<% for (let postID = 0; postID < comments.length; postID++) { %>
|
Comments:<br/>
|
||||||
<% for (let comment_index = 0; comment_index < comments[postID]['comments'].length; comment_index++) { %>
|
<% for (let postID = 0; postID < comments.length; postID++) { %>
|
||||||
<a href="<%= config.site_path %>/comment/<%= postID %>-<%= comment_index %>"><%= postID %>-<%= comment_index %></a><br/>
|
<% for (let comment_index = 0; comment_index < comments[postID]['comments'].length; comment_index++) { %>
|
||||||
<% }; %>
|
<a href="<%= config.site_path %>/comment/<%= postID %>-<%= comment_index %>"><%= postID %>-<%= comment_index %></a><br/>
|
||||||
<% }; %>
|
<% }; %>
|
||||||
Users:<br/>
|
<% }; %>
|
||||||
<% for (let userID = 0; userID < users.length; userID++) { %>
|
Users:<br/>
|
||||||
<% if (users[userID]["deleted"] != true) { %>
|
<% for (let userID = 0; userID < users.length; userID++) { %>
|
||||||
<a href="<%= config.site_path %>/user/<%= users[userID]["username"] %>"><%= users[userID]["username"] %></a><br/>
|
<% if (users[userID]["deleted"] != true) { %>
|
||||||
<% }; %>
|
<a href="<%= config.site_path %>/user/<%= users[userID]["username"] %>"><%= users[userID]["username"] %></a><br/>
|
||||||
<% }; %>
|
<% }; %>
|
||||||
Edit Posts:<br/>
|
<% }; %>
|
||||||
<% for (let postID = 0; postID < posts.length; postID++) { %>
|
Edit Posts:<br/>
|
||||||
<% if (posts[postID]["deleted"] != true) { %>
|
<% for (let postID = 0; postID < posts.length; postID++) { %>
|
||||||
<a href="<%= config.site_path %><%= config.edit_post_base_url %>/<%= postID %>">Edit <%= posts[postID]["title"] %></a><br/>
|
<% if (posts[postID]["deleted"] != true) { %>
|
||||||
<% }; %>
|
<a href="<%= config.site_path %><%= config.edit_post_base_url %>/<%= postID %>">Edit <%= posts[postID]["title"] %></a><br/>
|
||||||
<% }; %>
|
<% }; %>
|
||||||
Edit Users:<br/>
|
<% }; %>
|
||||||
<% for (let userID = 0; userID < users.length; userID++) { %>
|
Edit Users:<br/>
|
||||||
<% if (users[userID]["deleted"] != true) { %>
|
<% for (let userID = 0; userID < users.length; userID++) { %>
|
||||||
<a href="<%= config.site_path %><%= config.edit_account_base_url %>/<%= users[userID]["username"] %>">Edit <%= users[userID]["username"] %></a><br/>
|
<% if (users[userID]["deleted"] != true) { %>
|
||||||
<% }; %>
|
<a href="<%= config.site_path %><%= config.edit_account_base_url %>/<%= users[userID]["username"] %>">Edit <%= users[userID]["username"] %></a><br/>
|
||||||
<% }; %>
|
<% }; %>
|
||||||
<!-- TODO add tags -->
|
<% }; %>
|
||||||
</body>
|
<!-- TODO add tags -->
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+12
-10
@@ -1,13 +1,15 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="<%= config.charset %>">
|
<html lang="<%= config.charset %>">
|
||||||
<head>
|
<head>
|
||||||
<%- include("../partials/head") %>
|
<%- include("../partials/head") %>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<% for (let postID = 0; postID < comments.length; postID++) { %>
|
<div id="main">
|
||||||
<% for (let comment_index = 0; comment_index < comments[postID]['comments'].length; comment_index++) { %>
|
<% for (let postID = 0; postID < comments.length; postID++) { %>
|
||||||
<a href="<%= config.site_path %>/comment/<%= postID %>-<%= comment_index %>"><%= postID %>-<%= comment_index %></a><br/>
|
<% for (let comment_index = 0; comment_index < comments[postID]['comments'].length; comment_index++) { %>
|
||||||
<% }; %>
|
<a href="<%= config.site_path %>/comment/<%= postID %>-<%= comment_index %>"><%= postID %>-<%= comment_index %></a><br/>
|
||||||
<% }; %>
|
<% }; %>
|
||||||
</body>
|
<% }; %>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+12
-10
@@ -1,13 +1,15 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="<%= config.charset %>">
|
<html lang="<%= config.charset %>">
|
||||||
<head>
|
<head>
|
||||||
<%- include("../partials/head") %>
|
<%- include("../partials/head") %>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<% for (let postID = 0; postID < posts.length; postID++) { %>
|
<div id="main">
|
||||||
<% if (posts[postID]["deleted"] != true) { %>
|
<% for (let postID = 0; postID < posts.length; postID++) { %>
|
||||||
<a href="<%= config.site_path %>/post/<%= postID %>"><%= posts[postID]["title"] %></a><br/>
|
<% if (posts[postID]["deleted"] != true) { %>
|
||||||
<% }; %>
|
<a href="<%= config.site_path %>/post/<%= postID %>"><%= posts[postID]["title"] %></a><br/>
|
||||||
<% }; %>
|
<% }; %>
|
||||||
</body>
|
<% }; %>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+12
-10
@@ -1,13 +1,15 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="<%= config.charset %>">
|
<html lang="<%= config.charset %>">
|
||||||
<head>
|
<head>
|
||||||
<%- include("../partials/head") %>
|
<%- include("../partials/head") %>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<% for (let userID = 0; userID < users.length; userID++) { %>
|
<div id="main">
|
||||||
<% if (users[userID]["deleted"] != true) { %>
|
<% for (let userID = 0; userID < users.length; userID++) { %>
|
||||||
<a href="<%= config.site_path %>/user/<%= users[userID]["username"] %>"><%= users[userID]["username"] %></a><br/>
|
<% if (users[userID]["deleted"] != true) { %>
|
||||||
<% }; %>
|
<a href="<%= config.site_path %>/user/<%= users[userID]["username"] %>"><%= users[userID]["username"] %></a><br/>
|
||||||
<% }; %>
|
<% }; %>
|
||||||
</body>
|
<% }; %>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+25
-23
@@ -1,26 +1,28 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<%- include('../partials/head'); %>
|
<%- include('../partials/head'); %>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header id="site-header">
|
<div id="main">
|
||||||
<%- include("../headers/site_wide") %>
|
<header id="site-header">
|
||||||
</header>
|
<%- include("../headers/site_wide") %>
|
||||||
<div id="comment">
|
</header>
|
||||||
<%- include("../partials/comment"); %>
|
<div id="comment">
|
||||||
</div>
|
<%- include("../partials/comment"); %>
|
||||||
<%- config.seperator %>
|
</div>
|
||||||
<b><%= locale.reply %>:</b>
|
<%- config.seperator %>
|
||||||
<div id="post-commentform">
|
<b><%= locale.reply %>:</b>
|
||||||
<!-- Comment form -->
|
<div id="post-commentform">
|
||||||
<form method="POST" action="/submit_comment">
|
<!-- Comment form -->
|
||||||
<input type="hidden" name="post_index" value="<%= postID %>">
|
<form method="POST" action="/submit_comment">
|
||||||
<label><%= locale.username %>:</label><br/><input name="name"><br/><br/>
|
<input type="hidden" name="post_index" value="<%= postID %>">
|
||||||
<label><%= locale.comment %>:</label><br/><textarea name="content">>> <%- postID %>-<%- commentID %>
|
<label><%= locale.username %>:</label><br/><input name="name"><br/><br/>
|
||||||
</textarea><br/>
|
<label><%= locale.comment %>:</label><br/><textarea name="content">>> <%- postID %>-<%- commentID %>
|
||||||
<button type="submit"><%= locale.submit %></button>
|
</textarea><br/>
|
||||||
</form>
|
<button type="submit"><%= locale.submit %></button>
|
||||||
</div>
|
</form>
|
||||||
</body>
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+16
-14
@@ -1,17 +1,19 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<%- include('../partials/head'); %>
|
<%- include('../partials/head'); %>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header id="site-header">
|
<div id="main">
|
||||||
<%- include("../headers/site_wide") %>
|
<header id="site-header">
|
||||||
</header>
|
<%- include("../headers/site_wide") %>
|
||||||
<div id="posts">
|
</header>
|
||||||
<%- include('../posts/post'); %>
|
<div id="posts">
|
||||||
</div>
|
<%- include('../posts/post'); %>
|
||||||
<footer id='footer'>
|
</div>
|
||||||
<%- include('../partials/footer'); %>
|
<footer id='footer'>
|
||||||
</footer>
|
<%- include('../partials/footer'); %>
|
||||||
</body>
|
</footer>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+26
-24
@@ -4,34 +4,36 @@
|
|||||||
<%- include('../partials/head'); %>
|
<%- include('../partials/head'); %>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id='site-header'>
|
<div id="main">
|
||||||
<%- include('../headers/site_wide'); %>
|
<div id='site-header'>
|
||||||
</div>
|
<%- include('../headers/site_wide'); %>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id='advanced-search'>
|
<div id='advanced-search'>
|
||||||
<form method="GET" action="/search">
|
<form method="GET" action="/search">
|
||||||
<label>Search Term:</label>
|
<label>Search Term:</label>
|
||||||
<input type='text' placeholder='🔍' name='q' value='<%- search_term %>'><br/>
|
<input type='text' placeholder='🔍' name='q' value='<%- search_term %>'><br/>
|
||||||
|
|
||||||
<label>Search for:</label><br/>
|
<label>Search for:</label><br/>
|
||||||
<label>Post:</label>
|
<label>Post:</label>
|
||||||
<input type="checkbox" name="type" value="post" <% if (search_type.includes('post')) {%>checked<% } %>><br/>
|
<input type="checkbox" name="type" value="post" <% if (search_type.includes('post')) {%>checked<% } %>><br/>
|
||||||
<label>User:</label>
|
<label>User:</label>
|
||||||
<input type="checkbox" name="type" value="user" <% if (search_type.includes('user')) {%>checked<% } %>><br/>
|
<input type="checkbox" name="type" value="user" <% if (search_type.includes('user')) {%>checked<% } %>><br/>
|
||||||
|
|
||||||
<input type="submit" value="Submit">
|
<input type="submit" value="Submit">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%- config.seperator %>
|
<%- config.seperator %>
|
||||||
|
|
||||||
<div id='results'>
|
<div id='results'>
|
||||||
<% search_results.posts.forEach((result, index) => { %>
|
<% search_results.posts.forEach((result, index) => { %>
|
||||||
<a href="/post/<%- result.id %>"><%- result.title %></a><br/>
|
<a href="/post/<%- result.id %>"><%- result.title %></a><br/>
|
||||||
<% }); %>
|
<% }); %>
|
||||||
<% search_results.users.forEach((result, index) => { %>
|
<% search_results.users.forEach((result, index) => { %>
|
||||||
<a href="/user/<%- result.username %>"><%- result.prettyname %></a><br/>
|
<a href="/user/<%- result.username %>"><%- result.prettyname %></a><br/>
|
||||||
<% }); %>
|
<% }); %>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+27
-25
@@ -1,28 +1,30 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<%- include('../partials/head'); %>
|
<%- include('../partials/head'); %>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header id="site-header">
|
<div id="main">
|
||||||
<%- include('../headers/site_wide'); %>
|
<header id="site-header">
|
||||||
</header>
|
<%- include('../headers/site_wide'); %>
|
||||||
<header id='page-header'>
|
</header>
|
||||||
<%- include('../headers/tag'); %>
|
<header id='page-header'>
|
||||||
</header>
|
<%- include('../headers/tag'); %>
|
||||||
<div id="posts">
|
</header>
|
||||||
<% for (let index = posts.length - 1; index >= 0; index--) { %>
|
<div id="posts">
|
||||||
<% if ( posts[index].deleted != true) { %>
|
<% for (let index = posts.length - 1; index >= 0; index--) { %>
|
||||||
<% posts[index].tags.forEach((current_tag, tag_index) => { %>
|
<% if ( posts[index].deleted != true) { %>
|
||||||
<% if (current_tag.toLowerCase() == tag.toLowerCase()) { %>
|
<% posts[index].tags.forEach((current_tag, tag_index) => { %>
|
||||||
<%- include('../posts/tag', {post: posts[index], postID: index, user: users[posts[index].userID], comments: comments[index]}); %>
|
<% if (current_tag.toLowerCase() == tag.toLowerCase()) { %>
|
||||||
<% } %>
|
<%- include('../posts/tag', {post: posts[index], postID: index, user: users[posts[index].userID], comments: comments[index]}); %>
|
||||||
<% }) %>
|
<% } %>
|
||||||
<% } %>
|
<% }) %>
|
||||||
<% } %>
|
<% } %>
|
||||||
</div>
|
<% } %>
|
||||||
<footer id='footer'>
|
</div>
|
||||||
<%- include('../partials/footer'); %>
|
<footer id='footer'>
|
||||||
</footer>
|
<%- include('../partials/footer'); %>
|
||||||
</body>
|
</footer>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+23
-21
@@ -1,24 +1,26 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<%- include('../partials/head'); %>
|
<%- include('../partials/head'); %>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header id="site-header">
|
<div id="main">
|
||||||
<%- include("../headers/site_wide") %>
|
<header id="site-header">
|
||||||
</header>
|
<%- include("../headers/site_wide") %>
|
||||||
<header id='page-header'>
|
</header>
|
||||||
<%- include('../headers/timeline'); %>
|
<header id='page-header'>
|
||||||
</header>
|
<%- include('../headers/timeline'); %>
|
||||||
<div id="posts">
|
</header>
|
||||||
<% for (let index = posts.length - 1; index >= 0; index--) { %>
|
<div id="posts">
|
||||||
<% if (posts[index]["deleted"] != true) { %>
|
<% for (let index = posts.length - 1; index >= 0; index--) { %>
|
||||||
<%- include('../posts/timeline', {post: posts[index], postID: index, user: users[posts[index].userID], comments: comments[index]}); %>
|
<% if (posts[index]["deleted"] != true) { %>
|
||||||
<% } %>
|
<%- include('../posts/timeline', {post: posts[index], postID: index, user: users[posts[index].userID], comments: comments[index]}); %>
|
||||||
<% } %>
|
<% } %>
|
||||||
</div>
|
<% } %>
|
||||||
<footer id='footer'>
|
</div>
|
||||||
<%- include('../partials/footer'); %>
|
<footer id='footer'>
|
||||||
</footer>
|
<%- include('../partials/footer'); %>
|
||||||
</body>
|
</footer>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+23
-21
@@ -1,24 +1,26 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<%- include('../partials/head'); %>
|
<%- include('../partials/head'); %>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header id="site-header">
|
<div id="main">
|
||||||
<%- include("../headers/site_wide") %>
|
<header id="site-header">
|
||||||
</header>
|
<%- include("../headers/site_wide") %>
|
||||||
<header id='page-header'>
|
</header>
|
||||||
<%- include('../headers/user'); %>
|
<header id='page-header'>
|
||||||
</header>
|
<%- include('../headers/user'); %>
|
||||||
<div id="posts">
|
</header>
|
||||||
<% for (let index = posts.length - 1; index >= 0; index--) { %>
|
<div id="posts">
|
||||||
<% if (posts[index].userID == userID) { %>
|
<% for (let index = posts.length - 1; index >= 0; index--) { %>
|
||||||
<%- include('../posts/user', {post: posts[index], postID: index, user: user, comments: comments[index]}); %>
|
<% if (posts[index].userID == userID) { %>
|
||||||
<% } %>
|
<%- include('../posts/user', {post: posts[index], postID: index, user: user, comments: comments[index]}); %>
|
||||||
<% } %>
|
<% } %>
|
||||||
</div>
|
<% } %>
|
||||||
<footer id='footer'>
|
</div>
|
||||||
<%- include('../partials/footer'); %>
|
<footer id='footer'>
|
||||||
</footer>
|
<%- include('../partials/footer'); %>
|
||||||
</body>
|
</footer>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<meta charset="<%- config.charset %>">
|
<meta charset="<%- config.charset %>">
|
||||||
<meta name='robots' content='noindex'>
|
<meta name='robots' content='noindex'>
|
||||||
<title><%= config.site_path %></title>
|
<title><%= config.site_name %></title>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="<%= config.charset %>" ?>
|
||||||
|
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||||
|
<title><%= config.site_name %></title>
|
||||||
|
<link><%= config.site_url %></title>
|
||||||
|
<description><%= config.site_description %></description>
|
||||||
|
<updated><%= func.unix_time_to_date_format(getUnixTime(new Date()),"yyyy-MM-dd'T'HH:mm:ss'Z'") %></updated>
|
||||||
|
<id><%= config.site_url %></id>
|
||||||
|
<% for (let postID = posts.length-1; postID >= 0; postID--) { %>
|
||||||
|
<% if (posts[postID]["deleted"] != true) { %>
|
||||||
|
<entry>
|
||||||
|
<title><%= posts[postID]["title"] %></title>
|
||||||
|
<link><%= config.site_url %>/post/<%= postID %></link>
|
||||||
|
<summary><![CDATA[<%- (posts[postID]["content"]) %>]]></summary>
|
||||||
|
<guid isPermaLink="true"><%= config.site_url %>/post/<%= postID %></guid>
|
||||||
|
<pubDate><%# func.unix_time_to_date_format(posts[postID]['pubdate'],"yyyy-MM-dd'T'HH:mm:ss'Z'") %></pubDate>
|
||||||
|
<% for (let tag_index = 0; tag_index < posts[postID]['tags'].length; tag_index++) { %>
|
||||||
|
<category><![CDATA[<%= posts[postID]['tags'][tag_index] %>]]></category>
|
||||||
|
<% } %>
|
||||||
|
</entry>
|
||||||
|
<% } %>
|
||||||
|
<% } %>
|
||||||
|
</feed>
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="<%= config.charset %>" ?>
|
|
||||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
|
||||||
<title><%= config.site_name %></title>
|
|
||||||
<link><%= config.site_url %></title>
|
|
||||||
<description><%= config.site_description %></description>
|
|
||||||
<updated><%= func.unix_time_to_atom_date(getUnixTime(new Date())) %></updated>
|
|
||||||
<id><%= config.site_url %></id>
|
|
||||||
<% for (let postID = posts.length-1; postID >= 0; postID--) { %>
|
|
||||||
<% if (posts[postID]["deleted"] != true) { %>
|
|
||||||
<entry>
|
|
||||||
<title><%= posts[postID]["title"] %></title>
|
|
||||||
<link><%= config.site_url %>/post/<%= postID %></link>
|
|
||||||
<summary><![CDATA[<%- func.render_md(posts[postID]["content"]) %>]]></summary>
|
|
||||||
<guid isPermaLink="true"><%= config.site_url %>/post/<%= postID %></guid>
|
|
||||||
<pubDate><%# func.unix_time_to_atom_date(posts[postID]['pubdate']) %></pubDate>
|
|
||||||
<% for (let tag_index = 0; tag_index < posts[postID]['tags'].length; tag_index++) { %>
|
|
||||||
<category><![CDATA[<%= posts[postID]['tags'][tag_index] %>]]></category>
|
|
||||||
<% } %>
|
|
||||||
</entry>
|
|
||||||
<% } %>
|
|
||||||
<% } %>
|
|
||||||
</feed>
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="<%= config.charset %>" ?>
|
|
||||||
<rss version="2.0">
|
|
||||||
<channel>
|
|
||||||
<title><%= config.site_name %></title>
|
|
||||||
<link><%= config.site_url %></title>
|
|
||||||
<description><%= config.site_description %></description>
|
|
||||||
<% for (let postID = posts.length-1; postID >= 0; postID--) { %>
|
|
||||||
<% if (posts[postID]["deleted"] != true) { %>
|
|
||||||
<item>
|
|
||||||
<title><%= posts[postID]["title"] %></title>
|
|
||||||
<link><%= config.site_url %>/post/<%= postID %></link>
|
|
||||||
<description><![CDATA[<%- func.render_md(posts[postID]["content"]) %>]]></description>
|
|
||||||
<guid isPermaLink="true"><%= config.site_url %>/post/<%= postID %></guid>
|
|
||||||
<pubDate><%= func.unix_time_to_rss_date(posts[postID]['pubdate']) %></pubDate>
|
|
||||||
<% for (let tag_index = 0; tag_index < posts[postID]['tags'].length; tag_index++) { %>
|
|
||||||
<category><![CDATA[<%= posts[postID]['tags'][tag_index] %>]]></category>
|
|
||||||
<% } %>
|
|
||||||
</item>
|
|
||||||
<% } %>
|
|
||||||
<% } %>
|
|
||||||
</channel>
|
|
||||||
</rss>
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="<%= config.charset %>" ?>
|
||||||
|
<rss version="2.0">
|
||||||
|
<channel>
|
||||||
|
<title><%= config.site_name %></title>
|
||||||
|
<link><%= config.site_url %></link>
|
||||||
|
<description><%= config.site_description %></description>
|
||||||
|
<% for (let postID = posts.length-1; postID >= 0; postID--) { %>
|
||||||
|
<% if (posts[postID]["deleted"] != true) { %>
|
||||||
|
<item>
|
||||||
|
<title><%= posts[postID]["title"] %></title>
|
||||||
|
<link><%= config.site_url %>/post/<%= postID %></link>
|
||||||
|
<description><![CDATA[<%- (posts[postID]["content"]) %>]]></description>
|
||||||
|
<guid isPermaLink="true"><%= config.site_url %>/post/<%= postID %></guid>
|
||||||
|
<pubDate><%= func.unix_time_to_date_format(posts[postID]['pubdate'],'EEE, dd MMM yyyy HH:mm:ss') %></pubDate>
|
||||||
|
<author><%= users[posts[postID]['userID']]['prettyname'] %></author>
|
||||||
|
<% for (let tag_index = 0; tag_index < posts[postID]['tags'].length; tag_index++) { %>
|
||||||
|
<category><![CDATA[<%= posts[postID]['tags'][tag_index] %>]]></category>
|
||||||
|
<% } %>
|
||||||
|
</item>
|
||||||
|
<% } %>
|
||||||
|
<% } %>
|
||||||
|
</channel>
|
||||||
|
</rss>
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="<%= config.charset %>" ?>
|
|
||||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
|
||||||
<title><%= config.site_name %></title>
|
|
||||||
<link><%= config.site_url %></title>
|
|
||||||
<description><%= config.site_description %></description>
|
|
||||||
<updated><%= func.unix_time_to_atom_date(getUnixTime(new Date())) %></updated>
|
|
||||||
<id><%= config.site_url %></id>
|
|
||||||
<% for (let postID = posts.length-1; postID >= 0; postID--) { %>
|
|
||||||
<% if (posts[postID]["userID"] == userID) { %>
|
|
||||||
<% if (posts[postID]["deleted"] != true) { %>
|
|
||||||
<entry>
|
|
||||||
<title><%= posts[postID]["title"] %></title>
|
|
||||||
<link><%= config.site_url %>/post/<%= postID %></link>
|
|
||||||
<summary><![CDATA[<%- func.render_md(posts[postID]["content"]) %>]]></summary>
|
|
||||||
<guid isPermaLink="true"><%= config.site_url %>/post/<%= postID %></guid>
|
|
||||||
<pubDate><%# func.unix_time_to_atom_date(posts[postID]['pubdate']) %></pubDate>
|
|
||||||
<% for (let tag_index = 0; tag_index < posts[postID]['tags'].length; tag_index++) { %>
|
|
||||||
<category><![CDATA[<%= posts[postID]['tags'][tag_index] %>]]></category>
|
|
||||||
<% } %>
|
|
||||||
</entry>
|
|
||||||
<% } %>
|
|
||||||
<% } %>
|
|
||||||
<% } %>
|
|
||||||
</feed>
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="<%= config.charset %>" ?>
|
|
||||||
<rss version="2.0">
|
|
||||||
<channel>
|
|
||||||
<title><%= config.site_name %></title>
|
|
||||||
<link><%= config.site_url %></title>
|
|
||||||
<description><%= config.site_description %></description>
|
|
||||||
<% for (let postID = posts.length-1; postID >= 0; postID--) { %>
|
|
||||||
<% if (posts[postID]["userID"] == userID) { %>
|
|
||||||
<% if (posts[postID]["deleted"] != true) { %>
|
|
||||||
<item>
|
|
||||||
<title><%= posts[postID]["title"] %></title>
|
|
||||||
<link><%= config.site_url %>/post/<%= postID %></link>
|
|
||||||
<description><![CDATA[<%- func.render_md(posts[postID]["content"]) %>]]></description>
|
|
||||||
<guid isPermaLink="true"><%= config.site_url %>/post/<%= postID %></guid>
|
|
||||||
<pubDate><%= func.unix_time_to_rss_date(posts[postID]['pubdate']) %></pubDate>
|
|
||||||
<% for (let tag_index = 0; tag_index < posts[postID]['tags'].length; tag_index++) { %>
|
|
||||||
<category><![CDATA[<%= posts[postID]['tags'][tag_index] %>]]></category>
|
|
||||||
<% } %>
|
|
||||||
</item>
|
|
||||||
<% } %>
|
|
||||||
<% } %>
|
|
||||||
<% } %>
|
|
||||||
</channel>
|
|
||||||
</rss>
|
|
||||||
+6
-2
@@ -30,7 +30,6 @@ a {
|
|||||||
border: none;
|
border: none;
|
||||||
border-radius: 0px;
|
border-radius: 0px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
a:hover {
|
a:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
@@ -56,7 +55,9 @@ a:hover {
|
|||||||
.comment:nth-child(even) {
|
.comment:nth-child(even) {
|
||||||
background: #1E1E1E;
|
background: #1E1E1E;
|
||||||
}
|
}
|
||||||
|
.named-fence-filename {
|
||||||
|
border: 1px white solid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-color-scheme: light) {
|
@media (prefers-color-scheme: light) {
|
||||||
@@ -70,4 +71,7 @@ a:hover {
|
|||||||
.comment:nth-child(even) {
|
.comment:nth-child(even) {
|
||||||
background: #EEEEEE;
|
background: #EEEEEE;
|
||||||
}
|
}
|
||||||
|
.named-fence-filename {
|
||||||
|
border: 1px black solid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user