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