Mercurial Hosting > chat
comparison src/login.html.luan @ 5:a49866b52cc2
login to chat
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Tue, 29 Oct 2024 13:10:47 -0600 |
| parents | 2c63b10781e1 |
| children | 5a56297713a3 |
comparison
equal
deleted
inserted
replaced
| 4:2da10ece826f | 5:a49866b52cc2 |
|---|---|
| 1 local Luan = require "luan:Luan.luan" | 1 local Luan = require "luan:Luan.luan" |
| 2 local error = Luan.error | 2 local error = Luan.error |
| 3 local ipairs = Luan.ipairs or error() | |
| 4 local Html = require "luan:Html.luan" | |
| 5 local html_encode = Html.encode or error() | |
| 3 local Io = require "luan:Io.luan" | 6 local Io = require "luan:Io.luan" |
| 4 local Http = require "luan:http/Http.luan" | 7 local Http = require "luan:http/Http.luan" |
| 5 local Shared = require "site:/lib/Shared.luan" | 8 local Shared = require "site:/lib/Shared.luan" |
| 6 local head = Shared.head or error() | 9 local head = Shared.head or error() |
| 7 local header = Shared.header or error() | 10 local header = Shared.header or error() |
| 11 local Utils = require "site:/lib/Utils.luan" | |
| 12 local to_list = Utils.to_list or error() | |
| 8 | 13 |
| 9 | 14 |
| 10 return function() | 15 return function() |
| 16 local with = Http.request.parameters.with | |
| 17 with = to_list(with) | |
| 11 Io.stdout = Http.response.text_writer() | 18 Io.stdout = Http.response.text_writer() |
| 12 %> | 19 %> |
| 13 <!doctype html> | 20 <!doctype html> |
| 14 <html> | 21 <html> |
| 15 <head> | 22 <head> |
| 19 <% header() %> | 26 <% header() %> |
| 20 <div content> | 27 <div content> |
| 21 <h1>Login / Register</h1> | 28 <h1>Login / Register</h1> |
| 22 <p>A link to login will be emailed to you.</p> | 29 <p>A link to login will be emailed to you.</p> |
| 23 <form page onsubmit="ajaxForm('/login.js',this)" action="javascript:"> | 30 <form page onsubmit="ajaxForm('/login.js',this)" action="javascript:"> |
| 31 <% for _, email in ipairs(with) do %> | |
| 32 <input type=hidden name=with value="<%=html_encode(email)%>"> | |
| 33 <% end %> | |
| 24 <p> | 34 <p> |
| 25 <label prompt>Your email address</label> | 35 <label prompt>Your email address</label> |
| 26 <input type=email name=email required autofocus> | 36 <input type=email name=email required autofocus> |
| 27 </p> | 37 </p> |
| 28 <p> | 38 <p> |
