Mercurial Hosting > lang
diff src/index.html.luan @ 15:49e9138b5460
add list.html
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 29 Jul 2025 20:59:47 -0600 |
parents | b1adec083e44 |
children | 19901d6fb56f |
line wrap: on
line diff
--- a/src/index.html.luan Tue Jul 29 00:12:05 2025 -0600 +++ b/src/index.html.luan Tue Jul 29 20:59:47 2025 -0600 @@ -1,6 +1,5 @@ local Luan = require "luan:Luan.luan" local error = Luan.error -local ipairs = Luan.ipairs or error() local Io = require "luan:Io.luan" local Http = require "luan:http/Http.luan" local Shared = require "site:/lib/Shared.luan" @@ -8,17 +7,10 @@ local header = Shared.header or error() local User = require "site:/lib/User.luan" local current_user = User.current or error() -local Chat = require "site:/lib/Chat.luan" -local chat_search = Chat.search or error() return function() local user = current_user() - if user == nil then - Http.response.send_redirect("/login.html") - return - end - local chats = chat_search( "chat_user_id:"..user.id, "chat_updated desc" ) Io.stdout = Http.response.text_writer() %> <!doctype html> @@ -30,10 +22,12 @@ <% header() %> <div content> <h1>Lang</h1> -<% for _, chat in ipairs(chats) do %> - <p><a href="chat.html?chat=<%=chat.id%>"><%= chat.name_html() %></a></p> +<% if user == nil then %> + <p><a href="login.html">Register / Login</a> to use this.</p> +<% else %> + <p><a href="list.html">See your chats</a></p> <% end %> - <p><a href="chat.html">new chat</a></p> + <p>More later...</p> </div> </body> </html>