payment: note that Stripe has instituted an additional 1% fee for non-US cards
[hcoop/portal.git] / apt.sml
CommitLineData
18eeb749
AC
1structure Apt = RequestH(struct
2 val table = "Apt"
3 val adminGroup = "server"
4 fun subject _ = "Apt package installation request"
5 val template = "apt"
6 val descr = "packages"
5da9f4a9 7
18eeb749
AC
8 fun body {node, mail, data = pkgs} =
9 let
10 val pkgs = String.tokens Char.isSpace pkgs
11 val infos = map (valOf o (fn x => AptQuery.query {node = node, pkg = x})) pkgs
5da9f4a9 12
18eeb749
AC
13 fun rightJustify (n, s) =
14 let
15 fun pad n =
16 if n <= 0 then
17 ()
18 else
19 (Mail.mwrite (mail, " ");
20 pad (n-1))
21 in
22 pad (n - size s);
23 Mail.mwrite (mail, s)
24 end
25 in
26 app (fn info =>
27 (rightJustify (10, #name info);
28 Mail.mwrite (mail, " ");
29 Mail.mwrite (mail, #descr info);
30 Mail.mwrite (mail, "\n"))) infos
31 end
32 end)