1
|
1 local Luan = require "luan:Luan.luan"
|
|
2 local error = Luan.error
|
11
|
3 local Html = require "luan:Html.luan"
|
|
4 local html_encode = Html.encode or error()
|
1
|
5 local Io = require "luan:Io.luan"
|
|
6 local Http = require "luan:http/Http.luan"
|
|
7 local Shared = require "site:/lib/Shared.luan"
|
|
8 local head = Shared.head or error()
|
|
9 local header = Shared.header or error()
|
|
10 local footer = Shared.footer or error()
|
|
11
|
|
12
|
|
13 return function()
|
11
|
14 local parameters = Http.request.parameters
|
|
15 local id = parameters.id or error()
|
|
16 local name = parameters.name or error()
|
|
17 local icon = parameters.icon
|
1
|
18 Io.stdout = Http.response.text_writer()
|
|
19 %>
|
|
20 <!doctype html>
|
|
21 <html>
|
|
22 <head>
|
|
23 <% head() %>
|
|
24 <title>Disearch</title>
|
|
25 </head>
|
|
26 <body>
|
|
27 <% header() %>
|
11
|
28
|
|
29 <h1>Add server</h1>
|
|
30
|
|
31 <p><%=html_encode(name)%></p>
|
|
32 <% if icon ~= nil then %>
|
|
33 <p><img src="https://cdn.discordapp.com/icons/<%=id%>/<%=icon%>.png"></p>
|
|
34 <% end %>
|
|
35
|
1
|
36 <% footer() %>
|
|
37 </body>
|
|
38 </html>
|
|
39 <%
|
|
40 end
|