comparison src/add_server.html.luan @ 11:62dd23f0b549

start add server
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 29 Oct 2023 22:39:31 -0600
parents src/index.html.luan@43814e9f5802
children 3e2cb946d511
comparison
equal deleted inserted replaced
10:ae9ebeb1c246 11:62dd23f0b549
1 local Luan = require "luan:Luan.luan"
2 local error = Luan.error
3 local Html = require "luan:Html.luan"
4 local html_encode = Html.encode or error()
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()
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
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() %>
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
36 <% footer() %>
37 </body>
38 </html>
39 <%
40 end