|
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() %>
|
|
40
|
24 <style>
|
|
|
25 input[name=email] {
|
|
|
26 width: 300px;
|
|
|
27 max-width: 100%;
|
|
|
28 }
|
|
|
29 </style>
|
|
0
|
30 </head>
|
|
|
31 <body>
|
|
|
32 <% header() %>
|
|
|
33 <div content>
|
|
3
|
34 <h1>Login / Register</h1>
|
|
|
35 <p>A link to login will be emailed to you.</p>
|
|
|
36 <form page onsubmit="ajaxForm('/login.js',this)" action="javascript:">
|
|
5
|
37 <% for _, email in ipairs(with) do %>
|
|
|
38 <input type=hidden name=with value="<%=html_encode(email)%>">
|
|
|
39 <% end %>
|
|
3
|
40 <p>
|
|
|
41 <label prompt>Your email address</label>
|
|
|
42 <input type=email name=email required autofocus>
|
|
|
43 </p>
|
|
|
44 <p>
|
|
|
45 <input type=submit>
|
|
|
46 </p>
|
|
|
47 </form>
|
|
44
|
48 <p><a href="manual_login.html">Password Login</a></p>
|
|
51
|
49 <p><a href="about.html">About Luan Chat</a></p>
|
|
0
|
50 </div>
|
|
|
51 </body>
|
|
|
52 </html>
|
|
|
53 <%
|
|
|
54 end
|