5 path="$(HTML "$ITEM/$1")"
7 if [ -d "$_DATA/$ITEM/$1" ]; then
8 printf '[a .list .dir href="%s" %s]' \
11 printf '[div .list .file [a href="%s" [img src="%s?a=thumbnail"] %s]]' \
12 "$path" "$path" "$name"
17 [ "$ITEM" ] && printf '..\n'
19 find ./ -type d -mindepth 1 -maxdepth 1 \
20 -exec stat -c '%Y %n' '{}' +
22 | { [ "$(GET o)" = Date ] && sort -rn || sort -k 2; } \
28 find ./ -type f -mindepth 1 -maxdepth 1 \
29 -exec stat -c '%Y %n' "${f#./}" '{}' + 2>&-
31 | { [ "$(GET o)" = Date ] && sort -rn || sort -k 2; } \
38 -exec stat -c '%Y %n' '{}' +
40 | { [ "$(GET o)" = Date ] && sort -rn || sort -k 2; } \
45 page="$(GET p |grep -xE '[0-9]+' || printf 1)"
47 printf '[div .itemlist '
50 if [ $c -lt $page ]; then
52 elif [ $c -lt $((LISTSIZE + page)) ]; then
58 printf '[div .pagination'
59 for n in $(seq 1 $((c / LISTSIZE + 1)) ); do
60 printf '[a .page href="%s" %s]' \
61 "?p=$(( (n - 1) * LISTSIZE + 1))" "$n"
66 printf 'Content-Type: text/html;charset=utf-8\r\n\r\n'
68 "$_EXEC/cgilite/html-sh.sed" <<-EOF
70 [html [head [title Listing]
71 [link rel=stylesheet href="/style.css" ]
74 [input type=checkbox #t_prefs .toggle ][label for=t_prefs ⚙]
76 $(if [ "$(COOKIE mode)" = index ]; then