3 . "$_EXEC/cgilite/cgilite.sh"
7 LANGUAGES='' glob="/" depth=-1
8 while [ $# -gt 0 ]; do case $1 in
9 --system) glob_system_pages=true; shift 1;;
10 :*) LANGUAGES="${LANGUAGES}${LANGUAGES:+ }${1#:}"; shift 1;;
11 --depth) depth="$2"; shift 2;;
12 *) glob="$1"; shift 1;;
15 page='' page_abs='' ostamp='' odate='' lstamp='' ldate='' row='' rowstate=''
17 printf '<table class="macro changes"><thead>\n<th>Page</th>'
18 for l in $LANGUAGES; do printf '<th>%s</th>' "$l"; done
19 printf '\n</thead><tbody>\n'
21 page_glob "$glob" "$depth" |while read page; do
22 page_abs="$(page_abs "$page")"
23 acl_read "${page_abs}" || continue
25 read ostamp odate <<-EOF
26 $([ "$REV_PAGES" = true ] \
27 && git -C "$_DATA" log --pretty="format:%at %ai" -- "pages${page_abs}#page.md" \
28 || stat -c "%Y %y" -- "$_DATA/pages${page_abs}#page.md"
31 row="<td><a href=\"$(HTML "$page")\">$(HTML "$page")</a><span class=\"date\">${odate%%[+.]*}</span></td>"
34 for l in $LANGUAGES; do
35 if [ -f "${_DATA}/pages/${page}:${l}/#page.md" ]; then
36 read lstamp ldate <<-EOF
37 $([ "$REV_PAGES" = true ] \
38 && git -C "$_DATA" log --pretty="format:%at %ai" -- "pages$(page_abs "${page_abs}:${l}")/#page.md" \
39 || stat -c "%Y %y" -- "$_DATA/pages$(page_abs "${page_abs}:${l}")/#page.md"
42 if [ $lstamp -lt $ostamp ] 2>&-; then
43 row="${row}<td class=\"outdated\"><a href=\"$(HTML "${page}:${l}")\">outdated</a><span class=\"date\">${ldate%%[+.]*}</span></td>"
44 [ "$rowstate" = "${rowstate%*outdated*}" ] && rowstate="${rowstate}${rowstate:+ }outdated"
46 row="${row}<td class=\"current\" ><a href=\"$(HTML "${page}:${l}")\">current</a ><span class=\"date\">${ldate%%[+.]*}</span></td>"
47 [ "$rowstate" = "${rowstate%*current*}" ] && rowstate="${rowstate}${rowstate:+ }current"
50 row="${row}<td class=\"missing\"><a href=\"$(HTML "${page}:${l}")\">missing</a></td>"
51 [ "$rowstate" = "${rowstate%*missing*}" ] && rowstate="${rowstate}${rowstate:+ }missing"
55 printf '<tr class="%s">%s</tr>\n' "$rowstate" "$row"
58 printf '</tbody></table>'