Mercurial Hosting > lang
view src/private/tools/chat.html.luan @ 9:46097e607701
romaji
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 21 Jul 2025 15:16:47 -0600 |
parents | 255c36830154 |
children | 0fb3488a017d |
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 started = Shared.started or error() local Chat = require "site:/lib/Chat.luan" local get_chat_by_id = Chat.get_by_id or error() return function() local chat_id = Http.request.parameters.chat or error() local process_markdown = Http.request.parameters.markdown ~= nil local chat = get_chat_by_id(chat_id) or error() Io.stdout = Http.response.text_writer() %> <!doctype html> <html lang="en"> <head> <% head() %> <style> <% if not process_markdown then %> [markdown] { white-space-collapse: preserve; } <% end %> </style> </head> <body> <% header() %> <div content> <h1>Chat <%=chat_id%></h1> <h3 name><%= chat.name_html() %></h3> <div messages> <% chat.output_messages_html() %> </div> </div> <% if process_markdown then %> <script> handleMarkdown(); </script> <% end %> </body> </html> <% end