* added "quotes" to the locales

* made all the ejs pages use "postID" as the variable for post indexes
* split up en-GB and en-US
This commit is contained in:
2025-08-27 18:30:26 +01:00
parent c73ce69f93
commit 27b9ee6437
10 changed files with 94 additions and 13 deletions

View File

@@ -18,7 +18,7 @@
<div id="posts">
<% for (let index = posts.length - 1; index >= 0; index--) { %>
<% if (posts[index]["deleted"] != true) { %>
<%- include('../posts/timeline', {post: posts[index], index: index, user: users[posts[index].userID]}); %>
<%- include('../posts/timeline', {post: posts[index], postID: index, user: users[posts[index].userID]}); %>
<% } %>
<% } %>
</div>

View File

@@ -11,7 +11,7 @@
<div id="posts">
<% for (let index = posts.length - 1; index >= 0; index--) { %>
<% if (posts[index].userID == userID) { %>
<%- include('../posts/user', {post: posts[index], index: index, user: user}); %>
<%- include('../posts/user', {post: posts[index], postID: index, user: user}); %>
<% } %>
<% } %>
</div>

View File

@@ -2,7 +2,7 @@
<%= post.title %>
</h3>
<%- func.render_md(post.content) %><br/>
<a href="<%= config.edit_post_base_url %>/<%= post_index %>"><%= locale.edit_post %></a><br/>
<a href="<%= config.edit_post_base_url %>/<%= postID %>"><%= locale.edit_post %></a><br/>
<a href="/post/<%- postID %>"><%= locale.permalink %></a><br/>
<%- func.hyperlink_tags(post.tags) %>
<br/>

View File

@@ -2,8 +2,8 @@
<%= post.title %>
</h3>
<%- func.render_md(post.content) %><br/>
<a href="<%= config.edit_post_base_url %>/<%= post_index %>"><%= locale.edit_post %></a><br/>
<a href="/post/<%- index %>"><%= locale.permalink %></a><br/>
<a href="<%= config.edit_post_base_url %>/<%= postID %>"><%= locale.edit_post %></a><br/>
<a href="/post/<%- postID %>"><%= locale.permalink %></a><br/>
<i>
<%= locale.written_by %> <a href="/user/<%= user.username %>"><%= user.username %></a><br/>
</i>
@@ -11,13 +11,13 @@
<!-- Comment form -->
<form method="POST" action="/submit_comment">
<input type="hidden" name="post_index" value="<%= index %>">
<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"></textarea><br/>
<button type="submit"><%= locale.submit %></button>
</form>
<% comments[index].forEach((comment, index) => { %>
<% comments[postID].forEach((comment, postID) => { %>
<%- include('../partials/comment', {comment: comment}) %>
<% }) %>

View File

@@ -2,19 +2,19 @@
<%= post.title %>
</h3>
<%- func.render_md(post.content) %><br/>
<a href="<%= config.edit_post_base_url %>/<%= post_index %>"><%= locale.edit_post %></a><br/>
<a href="/post/<%- index %>"><%= locale.permalink %></a><br/>
<a href="<%= config.edit_post_base_url %>/<%= postID %>"><%= locale.edit_post %></a><br/>
<a href="/post/<%- postID %>"><%= locale.permalink %></a><br/>
<br/>
<!-- Comment form -->
<form method="POST" action="/submit_comment">
<input type="hidden" name="post_index" value="<%= index %>">
<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"></textarea><br/>
<button type="submit"><%= locale.submit %></button>
</form>
<% comments[index].forEach((comment, index) => { %>
<% comments[postID].forEach((comment, postID) => { %>
<%- include('../partials/comment', {comment: comment}) %>
<% }) %>