1
|
1 local Luan = require "luan:Luan.luan"
|
|
2 local error = Luan.error
|
17
|
3 local ipairs = Luan.ipairs or error()
|
|
4 local Time = require "luan:Time.luan"
|
|
5 local time_now = Time.now or error()
|
|
6 local Html = require "luan:Html.luan"
|
|
7 local html_encode = Html.encode or error()
|
1
|
8 local Io = require "luan:Io.luan"
|
|
9 local Http = require "luan:http/Http.luan"
|
|
10 local Shared = require "site:/lib/Shared.luan"
|
|
11 local head = Shared.head or error()
|
|
12 local header = Shared.header or error()
|
|
13 local footer = Shared.footer or error()
|
17
|
14 local ago = Shared.ago or error()
|
|
15 local Server = require "site:/lib/Server.luan"
|
|
16 local search_servers = Server.search or error()
|
1
|
17
|
|
18
|
|
19 return function()
|
17
|
20 local servers = search_servers("type:server","server_bumped desc")
|
1
|
21 Io.stdout = Http.response.text_writer()
|
|
22 %>
|
|
23 <!doctype html>
|
|
24 <html>
|
|
25 <head>
|
|
26 <% head() %>
|
|
27 <title>Disearch</title>
|
|
28 </head>
|
|
29 <body>
|
17
|
30 <% header()
|
|
31 local now = time_now()
|
|
32 for _, server in ipairs(servers) do
|
|
33 %>
|
|
34 <p>
|
|
35 <%=html_encode(server.name)%>
|
|
36 <% server.write_img_html() %>
|
|
37 <a href="<%=server.invite_url()%>">invite</a>
|
|
38 bumped <% ago( now - server.bumped ) %>
|
|
39 </p>
|
|
40 <%
|
|
41 end
|
|
42 footer() %>
|
1
|
43 </body>
|
|
44 </html>
|
|
45 <%
|
|
46 end
|