Mercurial Hosting > freedit
view src/reply.html.luan @ 22:d87a8f9f43d7
tinymce work
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 17 Jul 2022 21:47:55 -0600 |
parents | 24668255cede |
children |
line wrap: on
line source
local Luan = require "luan:Luan.luan" local error = Luan.error local Io = require "luan:Io.luan" local Http = require "luan:http/Http.luan" local Shared = require "site:/lib/Shared.luan" local head = Shared.head or error() local header = Shared.header or error() local footer = Shared.footer or error() local Forum = require "site:/lib/Forum.luan" local forum_title = Forum.title or error() local Post = require "site:/lib/Post.luan" local User = require "site:/lib/User.luan" local Bbcode = require "site:/lib/Bbcode.luan" local bbcode_preprocess = Bbcode.preprocess or error() return function() local user = User.current_required() if user==nil then return end local parent_id = Http.request.parameters.parent or error() local parent = Post.get_by_id(parent_id) or error() if Http.request.method == "POST" then local content = Http.request.parameters.content or error() content = bbcode_preprocess(content) local post = parent.reply(user,content) Http.response.send_redirect("/thread.html?root="..post.root_id) return end Io.stdout = Http.response.text_writer() %> <!doctype html> <html> <head> <% head() %> <title><%=forum_title%>: reply</title> </head> <body> <% header() %> <div content> <h1>reply to: <%=parent.root.subject_html%></h1> <p>This page will almost certainly be replaced by ajax, but whatever. Hack for now.</p> <form method=post> <p><textarea name=content></textarea></p> <p><input type=submit></p> </form> </div> <% footer() %> </body> </html> <% end