added a main id so central section can be styled

This commit is contained in:
2026-06-01 12:46:39 +01:00
parent 9b10188066
commit 1a0b16feb2
11 changed files with 244 additions and 202 deletions
+46 -44
View File
@@ -1,47 +1,49 @@
<!DOCTYPE html>
<html lang="<%= config.charset %>">
<head>
<%- include("../partials/head") %>
</head>
<body>
Misc:<br/>
<a href="<%= config.site_path %>/">Home Page</a><br/>
<a href="<%= config.site_path %><%= config.new_post_url %>">New Post Form</a><br/>
<a href="<%= config.site_path %><%= config.signup_url %>">Signup Form</a><br/>
Indexes:<br/>
<a href="<%= config.site_path %>/index/posts">Posts Index</a><br/>
<a href="<%= config.site_path %>/index/users">Users Index</a><br/>
<a href="<%= config.site_path %>/index/comments">Comments Index</a><br/>
Posts:<br/>
<% for (let postID = 0; postID < posts.length; postID++) { %>
<% 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++) { %>
<% 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++) { %>
<% 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++) { %>
<% 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++) { %>
<% 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>
<head>
<%- include("../partials/head") %>
</head>
<body>
<div id="main">
Misc:<br/>
<a href="<%= config.site_path %>/">Home Page</a><br/>
<a href="<%= config.site_path %><%= config.new_post_url %>">New Post Form</a><br/>
<a href="<%= config.site_path %><%= config.signup_url %>">Signup Form</a><br/>
Indexes:<br/>
<a href="<%= config.site_path %>/index/posts">Posts Index</a><br/>
<a href="<%= config.site_path %>/index/users">Users Index</a><br/>
<a href="<%= config.site_path %>/index/comments">Comments Index</a><br/>
Posts:<br/>
<% for (let postID = 0; postID < posts.length; postID++) { %>
<% 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++) { %>
<% 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++) { %>
<% 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++) { %>
<% 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++) { %>
<% 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 -->
</div>
</body>
</html>
+12 -10
View File
@@ -1,13 +1,15 @@
<!DOCTYPE html>
<html lang="<%= config.charset %>">
<head>
<%- include("../partials/head") %>
</head>
<body>
<% for (let postID = 0; postID < comments.length; postID++) { %>
<% 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>
<head>
<%- include("../partials/head") %>
</head>
<body>
<div id="main">
<% for (let postID = 0; postID < comments.length; postID++) { %>
<% 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/>
<% }; %>
<% }; %>
</div>
</body>
</html>
+12 -10
View File
@@ -1,13 +1,15 @@
<!DOCTYPE html>
<html lang="<%= config.charset %>">
<head>
<%- include("../partials/head") %>
</head>
<body>
<% for (let postID = 0; postID < posts.length; postID++) { %>
<% if (posts[postID]["deleted"] != true) { %>
<a href="<%= config.site_path %>/post/<%= postID %>"><%= posts[postID]["title"] %></a><br/>
<% }; %>
<% }; %>
</body>
<head>
<%- include("../partials/head") %>
</head>
<body>
<div id="main">
<% for (let postID = 0; postID < posts.length; postID++) { %>
<% if (posts[postID]["deleted"] != true) { %>
<a href="<%= config.site_path %>/post/<%= postID %>"><%= posts[postID]["title"] %></a><br/>
<% }; %>
<% }; %>
</div>
</body>
</html>
+12 -10
View File
@@ -1,13 +1,15 @@
<!DOCTYPE html>
<html lang="<%= config.charset %>">
<head>
<%- include("../partials/head") %>
</head>
<body>
<% for (let userID = 0; userID < users.length; userID++) { %>
<% if (users[userID]["deleted"] != true) { %>
<a href="<%= config.site_path %>/user/<%= users[userID]["username"] %>"><%= users[userID]["username"] %></a><br/>
<% }; %>
<% }; %>
</body>
<head>
<%- include("../partials/head") %>
</head>
<body>
<div id="main">
<% for (let userID = 0; userID < users.length; userID++) { %>
<% if (users[userID]["deleted"] != true) { %>
<a href="<%= config.site_path %>/user/<%= users[userID]["username"] %>"><%= users[userID]["username"] %></a><br/>
<% }; %>
<% }; %>
</div>
</body>
</html>
+25 -23
View File
@@ -1,26 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<%- include('../partials/head'); %>
</head>
<body>
<header id="site-header">
<%- include("../headers/site_wide") %>
</header>
<div id="comment">
<%- include("../partials/comment"); %>
</div>
<%- config.seperator %>
<b><%= locale.reply %>:</b>
<div id="post-commentform">
<!-- Comment form -->
<form method="POST" action="/submit_comment">
<input type="hidden" name="post_index" value="<%= postID %>">
<label><%= locale.username %>:</label><br/><input name="name"><br/><br/>
<label><%= locale.comment %>:</label><br/><textarea name="content">>> <%- postID %>-<%- commentID %>
</textarea><br/>
<button type="submit"><%= locale.submit %></button>
</form>
</div>
</body>
<head>
<%- include('../partials/head'); %>
</head>
<body>
<div id="main">
<header id="site-header">
<%- include("../headers/site_wide") %>
</header>
<div id="comment">
<%- include("../partials/comment"); %>
</div>
<%- config.seperator %>
<b><%= locale.reply %>:</b>
<div id="post-commentform">
<!-- Comment form -->
<form method="POST" action="/submit_comment">
<input type="hidden" name="post_index" value="<%= postID %>">
<label><%= locale.username %>:</label><br/><input name="name"><br/><br/>
<label><%= locale.comment %>:</label><br/><textarea name="content">>> <%- postID %>-<%- commentID %>
</textarea><br/>
<button type="submit"><%= locale.submit %></button>
</form>
</div>
</div>
</body>
</html>
+16 -14
View File
@@ -1,17 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<%- include('../partials/head'); %>
</head>
<body>
<header id="site-header">
<%- include("../headers/site_wide") %>
</header>
<div id="posts">
<%- include('../posts/post'); %>
</div>
<footer id='footer'>
<%- include('../partials/footer'); %>
</footer>
</body>
<head>
<%- include('../partials/head'); %>
</head>
<body>
<div id="main">
<header id="site-header">
<%- include("../headers/site_wide") %>
</header>
<div id="posts">
<%- include('../posts/post'); %>
</div>
<footer id='footer'>
<%- include('../partials/footer'); %>
</footer>
</div>
</body>
</html>
+26 -24
View File
@@ -4,34 +4,36 @@
<%- include('../partials/head'); %>
</head>
<body>
<div id='site-header'>
<%- include('../headers/site_wide'); %>
</div>
<div id="main">
<div id='site-header'>
<%- include('../headers/site_wide'); %>
</div>
<div id='advanced-search'>
<form method="GET" action="/search">
<label>Search Term:</label>
<input type='text' placeholder='🔍' name='q' value='<%- search_term %>'><br/>
<div id='advanced-search'>
<form method="GET" action="/search">
<label>Search Term:</label>
<input type='text' placeholder='🔍' name='q' value='<%- search_term %>'><br/>
<label>Search for:</label><br/>
<label>Post:</label>
<input type="checkbox" name="type" value="post" <% if (search_type.includes('post')) {%>checked<% } %>><br/>
<label>User:</label>
<input type="checkbox" name="type" value="user" <% if (search_type.includes('user')) {%>checked<% } %>><br/>
<label>Search for:</label><br/>
<label>Post:</label>
<input type="checkbox" name="type" value="post" <% if (search_type.includes('post')) {%>checked<% } %>><br/>
<label>User:</label>
<input type="checkbox" name="type" value="user" <% if (search_type.includes('user')) {%>checked<% } %>><br/>
<input type="submit" value="Submit">
</form>
</div>
<input type="submit" value="Submit">
</form>
</div>
<%- config.seperator %>
<div id='results'>
<% search_results.posts.forEach((result, index) => { %>
<a href="/post/<%- result.id %>"><%- result.title %></a><br/>
<% }); %>
<% search_results.users.forEach((result, index) => { %>
<a href="/user/<%- result.username %>"><%- result.prettyname %></a><br/>
<% }); %>
<%- config.seperator %>
<div id='results'>
<% search_results.posts.forEach((result, index) => { %>
<a href="/post/<%- result.id %>"><%- result.title %></a><br/>
<% }); %>
<% search_results.users.forEach((result, index) => { %>
<a href="/user/<%- result.username %>"><%- result.prettyname %></a><br/>
<% }); %>
</div>
</div>
</body>
</html>
+27 -25
View File
@@ -1,28 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<%- include('../partials/head'); %>
</head>
<body>
<header id="site-header">
<%- include('../headers/site_wide'); %>
</header>
<header id='page-header'>
<%- include('../headers/tag'); %>
</header>
<div id="posts">
<% for (let index = posts.length - 1; index >= 0; index--) { %>
<% if ( posts[index].deleted != true) { %>
<% posts[index].tags.forEach((current_tag, tag_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'>
<%- include('../partials/footer'); %>
</footer>
</body>
<head>
<%- include('../partials/head'); %>
</head>
<body>
<div id="main">
<header id="site-header">
<%- include('../headers/site_wide'); %>
</header>
<header id='page-header'>
<%- include('../headers/tag'); %>
</header>
<div id="posts">
<% for (let index = posts.length - 1; index >= 0; index--) { %>
<% if ( posts[index].deleted != true) { %>
<% posts[index].tags.forEach((current_tag, tag_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'>
<%- include('../partials/footer'); %>
</footer>
</div>
</body>
</html>
+23 -21
View File
@@ -1,24 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<%- include('../partials/head'); %>
</head>
<body>
<header id="site-header">
<%- include("../headers/site_wide") %>
</header>
<header id='page-header'>
<%- include('../headers/timeline'); %>
</header>
<div id="posts">
<% for (let index = posts.length - 1; index >= 0; 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'>
<%- include('../partials/footer'); %>
</footer>
</body>
<head>
<%- include('../partials/head'); %>
</head>
<body>
<div id="main">
<header id="site-header">
<%- include("../headers/site_wide") %>
</header>
<header id='page-header'>
<%- include('../headers/timeline'); %>
</header>
<div id="posts">
<% for (let index = posts.length - 1; index >= 0; 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'>
<%- include('../partials/footer'); %>
</footer>
</div>
</body>
</html>
+23 -21
View File
@@ -1,24 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<%- include('../partials/head'); %>
</head>
<body>
<header id="site-header">
<%- include("../headers/site_wide") %>
</header>
<header id='page-header'>
<%- include('../headers/user'); %>
</header>
<div id="posts">
<% for (let index = posts.length - 1; index >= 0; index--) { %>
<% if (posts[index].userID == userID) { %>
<%- include('../posts/user', {post: posts[index], postID: index, user: user, comments: comments[index]}); %>
<% } %>
<% } %>
</div>
<footer id='footer'>
<%- include('../partials/footer'); %>
</footer>
</body>
<head>
<%- include('../partials/head'); %>
</head>
<body>
<div id="main">
<header id="site-header">
<%- include("../headers/site_wide") %>
</header>
<header id='page-header'>
<%- include('../headers/user'); %>
</header>
<div id="posts">
<% for (let index = posts.length - 1; index >= 0; index--) { %>
<% if (posts[index].userID == userID) { %>
<%- include('../posts/user', {post: posts[index], postID: index, user: user, comments: comments[index]}); %>
<% } %>
<% } %>
</div>
<footer id='footer'>
<%- include('../partials/footer'); %>
</footer>
</div>
</body>
</html>
+22
View File
@@ -0,0 +1,22 @@
<?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>