]> git.plutz.net Git - confetti/blobdiff - cards/index.cgi
changed some code layout, handle categories in separate directory
[confetti] / cards / index.cgi
diff --git a/cards/index.cgi b/cards/index.cgi
new file mode 100755 (executable)
index 0000000..6f44168
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+if [ "$_PATH" = "/cards/cards.css" ]; then
+  . $_EXEC/cgilite/file.sh
+  FILE $_EXEC/cards/cards.css
+  return 0
+fi
+
+. $_EXEC/pdiread.sh
+. $_EXEC/cards/l10n.sh
+. $_EXEC/cards/widgets.sh
+. $_EXEC/cards/list.sh
+
+unescape() { [ $# = 0 ] && sed -E 's;\\(.);\1;g' || printf %s "$*" |sed -E 's;\\(.);\1;g'; }
+upcase=' y;abcdefghijklmnopqrstuvwxyzäöüé;ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜÉ;; '
+
+filter="$(GET f)"
+order="$(GET o)"
+edit="$(GET e)"
+[ "$order" ] || order=firstname
+
+{ w_filter_diag
+
+  printf '
+  [form class="newcard" action="/cards/new_card.sh" method="POST"
+    [button type="submit" %s]
+  ]' "$(l10n newcard)"
+
+  [ "$edit" ] && edit_card "$edit"
+  list_cards
+} | yield_page cards /cards/cards.css