editing user redirects to user's page and began to implment ATOM

This commit is contained in:
2025-07-30 00:43:21 +01:00
parent 39eba8fcda
commit 0c43c7315c
12 changed files with 106 additions and 43 deletions

View File

@@ -1,14 +0,0 @@
<!DOCTYPE html>
<html lang="<%= config.language %>
<head>
<%- include("../partials/head") %>
</head>
<body>
<form action="/submit_delete_account" method="POST">
<input placeholder="username" required name="username"><br/>
<input placeholder="password" type="password" required id="password" name="password"><br/>
<label><%- config.string.delete_account_confirmation %>: </label><input type="checkbox" name="agreement" required><br/>
<input type="submit" value="Submit"><br/>
</form>
</body>
</html>

View File

@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="<%= config.language %>
<head>
<%- include("../partials/head") %>
</head>
<body>
<form action="/submit_edit_user" method="POST">
<input name="userID" type="hidden" value="<%= userID %>">
<input placeholder="<%= user.prettyname %>'s password" type="password" required id="password" name="password"><br/>
<input placeholder="Pretty Name" name="prettyname" value="<%= user.prettyname %>"><br/>
<textarea placeholder="Description" name="description"><%= user.description %></textarea><br/>
<label><%- config.string.delete_account_confirmation %>: </label><input type="checkbox" name="agreement"><br/>
<input type="submit" value="Submit"><br/>
</form>
</body>
</html>

View File

@@ -4,7 +4,7 @@
<%- include("../partials/head") %>
</head>
<body>
<form action="/submit_edit" method="POST" onsubmit="sha512password()">
<form action="/submit_edit_post" method="POST" onsubmit="sha512password()">
<input name="userID" type="hidden" value="<%= post['userID'] %>">
<input name="postID" type="hidden" value="<%= post_id %>">
<input placeholder="<%= user['prettyname'] %>'s password" type="password" required id="password" name="password"><br/>

View File

@@ -7,7 +7,6 @@
<a href="<%= config.rss_url %>">RSS Feed</a><br/>
<a href="<%= config.new_post_url %>">New post</a><br/>
<a href="<%= config.signup_url %>">Sign Up</a><br/>
<a href="<%= config.delete_account_url %>">Delete Account</a><br/>
<% if (config.enable_hitcount == true) { %>
Hitcount: <%= hitcount %>
<% } %>

View File

@@ -2,4 +2,5 @@
<%= user.prettyname %>'s posts
</h1>
<p><%- converter.makeHtml(user.description) %></p>
<a href="<%= config.edit_account_base_url %>/<%= userID %>">edit account</a>
<%- config.seperator %>

View File

@@ -0,0 +1,8 @@
<?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><%= new Date() %></updated>
<id><%= config.site_url %></id>
</feed>

View File

@@ -0,0 +1,20 @@
<?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--) { %>
<item>
<title><%= posts[postID]["title"] %></title>
<link><%= config.site_url %>/post/<%= postID %></link>
<description><![CDATA[<%= converter.makeHtml(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>