0
|
1 local Luan = require "luan:Luan.luan"
|
|
2 local error = Luan.error
|
|
3 local Io = require "luan:Io.luan"
|
|
4 local Http = require "luan:http/Http.luan"
|
|
5 local Shared = require "site:/lib/Shared.luan"
|
|
6 local head = Shared.head or error()
|
|
7 local header = Shared.header or error()
|
5
|
8 local Utils = require "site:/lib/Utils.luan"
|
|
9 local base_url = Utils.base_url or error()
|
|
10 local User = require "site:/lib/User.luan"
|
|
11 local current_user = User.current_required or error()
|
0
|
12
|
|
13
|
|
14 return function()
|
5
|
15 local user = current_user()
|
|
16 if user == nil then return end
|
0
|
17 Io.stdout = Http.response.text_writer()
|
|
18 %>
|
|
19 <!doctype html>
|
|
20 <html>
|
|
21 <head>
|
|
22 <% head() %>
|
|
23 </head>
|
|
24 <body>
|
|
25 <% header() %>
|
|
26 <div content>
|
3
|
27 <h1>Your Account</h1>
|
4
|
28 <p><a href="chat.html">Your Chats</a></p>
|
5
|
29 <p>Your URL: <%= base_url() %>/chat.html?with=<%=user.email%></p>
|
6
|
30 <p><a href="javascript:ajax('delete_user.js')">Delete account</a></p>
|
3
|
31 <p><a href="javascript:logout()">Logout</a></p>
|
0
|
32 </div>
|
|
33 </body>
|
|
34 </html>
|
|
35 <%
|
|
36 end
|