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 $(git -C "$_DATA" log --pretty="format:%at %ai" -- "pages${page_abs}#page.md")
28 row="<td><a href=\"$(HTML "$page")\">$(HTML "$page")</a><span class=\"date\">${odate%% +*}</span></td>"
31 for l in $LANGUAGES; do
32 if [ -f "${_DATA}/pages/${page}:${l}/#page.md" ]; then
33 read lstamp ldate <<-EOF
34 $(git -C "$_DATA" log --pretty="format:%at %ai" -- "pages$(page_abs "${page_abs}:${l}")/#page.md")
36 if [ $lstamp -lt $ostamp ] 2>&-; then
37 row="${row}<td class=\"outdated\"><a href=\"$(HTML "${page}:${l}")\">outdated</a><span class=\"date\">${ldate%% +*}</span></td>"
38 [ "$rowstate" = "${rowstate%*outdated*}" ] && rowstate="${rowstate}${rowstate:+ }outdated"
40 row="${row}<td class=\"current\" ><a href=\"$(HTML "${page}:${l}")\">current</a ><span class=\"date\">${ldate%% +*}</span></td>"
41 [ "$rowstate" = "${rowstate%*current*}" ] && rowstate="${rowstate}${rowstate:+ }current"
44 row="${row}<td class=\"missing\"><a href=\"$(HTML "${page}:${l}")\">missing</a></td>"
45 [ "$rowstate" = "${rowstate%*missing*}" ] && rowstate="${rowstate}${rowstate:+ }missing"
49 printf '<tr class="%s">%s</tr>\n' "$rowstate" "$row"
52 printf '</tbody></table>'