|
0
|
1 local Luan = require "luan:Luan.luan"
|
|
|
2 local error = Luan.error
|
|
5
|
3 local ipairs = Luan.ipairs or error()
|
|
|
4 local Html = require "luan:Html.luan"
|
|
|
5 local html_encode = Html.encode or error()
|
|
0
|
6 local Io = require "luan:Io.luan"
|
|
|
7 local Http = require "luan:http/Http.luan"
|
|
|
8 local Shared = require "site:/lib/Shared.luan"
|
|
|
9 local head = Shared.head or error()
|
|
|
10 local header = Shared.header or error()
|
|
5
|
11 local Utils = require "site:/lib/Utils.luan"
|
|
|
12 local to_list = Utils.to_list or error()
|
|
0
|
13
|
|
|
14
|
|
|
15 return function()
|
|
5
|
16 local with = Http.request.parameters.with
|
|
|
17 with = to_list(with)
|
|
0
|
18 Io.stdout = Http.response.text_writer()
|
|
|
19 %>
|
|
|
20 <!doctype html>
|
|
|
21 <html>
|
|
|
22 <head>
|
|
|
23 <% head() %>
|
|
|
24 </head>
|
|
|
25 <body>
|
|
|
26 <% header() %>
|
|
|
27 <div content>
|
|
3
|
28 <h1>Login / Register</h1>
|
|
|
29 <p>A link to login will be emailed to you.</p>
|
|
|
30 <form page onsubmit="ajaxForm('/login.js',this)" action="javascript:">
|
|
5
|
31 <% for _, email in ipairs(with) do %>
|
|
|
32 <input type=hidden name=with value="<%=html_encode(email)%>">
|
|
|
33 <% end %>
|
|
3
|
34 <p>
|
|
|
35 <label prompt>Your email address</label>
|
|
|
36 <input type=email name=email required autofocus>
|
|
|
37 </p>
|
|
|
38 <p>
|
|
|
39 <input type=submit>
|
|
|
40 </p>
|
|
|
41 </form>
|
|
0
|
42 </div>
|
|
|
43 </body>
|
|
|
44 </html>
|
|
|
45 <%
|
|
|
46 end
|