Mercurial Hosting > chat
diff src/lib/Shared.luan @ 79:b5a316575e64
reply
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 10 Mar 2025 21:41:53 -0600 |
parents | a63faf49e1d7 |
children | a47036fd0158 |
line wrap: on
line diff
--- a/src/lib/Shared.luan Sun Mar 09 22:20:36 2025 -0600 +++ b/src/lib/Shared.luan Mon Mar 10 21:41:53 2025 -0600 @@ -17,6 +17,8 @@ local Utils = require "site:/lib/Utils.luan" local base_url = Utils.base_url or error() local Db = require "site:/lib/Db.luan" +local Post = require "site:/lib/Post.luan" +local get_post_by_id = Post.get_by_id or error() local Logging = require "luan:logging/Logging.luan" local logger = Logging.logger "Shared" @@ -121,8 +123,10 @@ local user = current_user() or error() local author = get_user_by_id(author_id) local id = post.id + local reply = post.reply + reply = reply and get_post_by_id(reply) %> - <div post="<%=id%>" author="<%=author.id%>" fix> + <div post="<%=id%>" author="<%=author.id%>" id="p<%=id%>" fix> <div who> <span author><%=author.name_html()%></span> <span right> @@ -130,6 +134,12 @@ <span pulldown></span> </span> </div> +<% if reply ~= nil then %> + <div quote> + <blockquote><%= html_encode(reply.content) %></blockquote> + <div><a when href="#p<%=reply.id%>"><%=reply.date%></a></div> + </div> +<% end %> <div text><%= html_encode(post.content) %></div> </div> <%