modular design
[confetti] / cards / main.cgi
1 #!/bin/sh
2
3 if [ "$_PATH" = "/cards/cards.css" ]; then
4   . $_EXEC/cgilite/file.sh
5   FILE $_EXEC/cards/cards.css
6   return 0
7 fi
8
9 . $_EXEC/pdiread.sh
10 . $_EXEC/cards/l10n.sh
11 . $_EXEC/cards/widgets.sh
12 . $_EXEC/cards/list.sh
13
14 filter="$(GET f)"
15 order="$(GET o)"
16 edit="$(GET e)"
17 [ "$order" ] || order=firstname
18
19 { w_filter_diag
20
21   printf '
22   [form class="newcard" action="cards/new_card.sh" method="POST"
23     [button type="submit" %s]
24   ]' "$(l10n newcard)"
25
26   [ "$edit" ] && edit_card "$edit"
27   list_cards
28 } | yield_page cards /cards/cards.css