annotate unsubscribe/src/private/tools/unsubscribed.html.luan @ 0:8f4df159f06b

start public repo
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 11 Jul 2025 20:57:49 -0600
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1 local Luan = require "luan:Luan.luan"
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
2 local error = Luan.error
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
3 local ipairs = Luan.ipairs or error()
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
4 local Io = require "luan:Io.luan"
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
5 local Http = require "luan:http/Http.luan"
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
6 local Db = require "site:/lib/Db.luan"
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
7
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
8
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9 return function()
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
10 local docs = Db.search("type:unsubscribe",1,1000000)
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
11 Io.stdout = Http.response.text_writer()
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
12 %>
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
13 <!doctype html>
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
14 <html lang="en">
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
15 <head>
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
16 <meta name="viewport" content="width=device-width, initial-scale=1">
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
17 <style>
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
18 @import "tools.css";
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
19
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
20 body {
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
21 margin-top: 0;
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
22 margin-bottom: 0;
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
23 }
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
24 </style>
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
25 </head>
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
26 <body>
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
27 <%
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
28 for _, doc in ipairs(docs) do
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
29 local email = doc.unsubscribe_email or error()
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
30 %>
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
31 <p>
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
32 <a href="/subscribe.html?email=<%= email %>">X</a>
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
33 <%= email %>
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
34 </p>
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
35 <%
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
36 end
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
37 %>
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
38 </body>
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
39 </html>
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
40 <%
8f4df159f06b start public repo
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
41 end