. "$_EXEC/tools.sh"
. "$_EXEC/acl.sh"
-LANGUAGES=''
-
-glob="/" depth=-1
+LANGUAGES='' glob="/" depth=-1
while [ $# -gt 0 ]; do case $1 in
--system) glob_system_pages=true; shift 1;;
:*) LANGUAGES="${LANGUAGES}${LANGUAGES:+ }${1#:}"; shift 1;;
*) glob="$1"; shift 1;;
esac; done
-printf '<table><thead>\n<th>Page</th>'
+page='' page_abs='' ostamp='' odate='' lstamp='' ldate='' row='' rowstate=''
+
+printf '<table class="macro changes"><thead>\n<th>Page</th>'
for l in $LANGUAGES; do printf '<th>%s</th>' "$l"; done
printf '\n</thead><tbody>\n'
page_glob "$glob" "$depth" |while read page; do
- acl_read "$page" || continue
+ page_abs="$(page_abs "$page")"
+ acl_read "${page_abs}" || continue
- printf '<tr>'
read ostamp odate <<-EOF
- $(git -C "$_DATA" log --pretty="format:%at %ar" -- "pages/${page}#page.md")
+ $(git -C "$_DATA" log --pretty="format:%at %ai" -- "pages${page_abs}#page.md")
EOF
- printf '<td><a href="%s">%s</a><span>%s</span></td>' "$(HTML "$page")" "$(HTML "$page")" "${odate}"
+ row="<td><a href=\"$(HTML "$page")\">$(HTML "$page")</a><span class=\"date\">${odate%% +*}</span></td>"
+ rowstate=''
for l in $LANGUAGES; do
if [ -f "${_DATA}/pages/${page}:${l}/#page.md" ]; then
read lstamp ldate <<-EOF
- $(git -C "$_DATA" log --pretty="format:%at %ar" -- "pages/${page}:${l}/#page.md")
+ $(git -C "$_DATA" log --pretty="format:%at %ai" -- "pages$(page_abs "${page_abs}:${l}")/#page.md")
EOF
- if [ $lstamp -lt $ostamp ]; then
- printf '<td><a href="%s">outdated</a><span>%s</span></td>' "$(HTML "${page}:${l}")" "$ldate"
+ if [ $lstamp -lt $ostamp ] 2>&-; then
+ row="${row}<td class=\"outdated\"><a href=\"$(HTML "${page}:${l}")\">outdated</a><span class=\"date\">${ldate%% +*}</span></td>"
+ [ "$rowstate" = "${rowstate%*outdated*}" ] && rowstate="${rowstate}${rowstate:+ }outdated"
else
- printf '<td><a href="%s">current</a><span>%s</span></td>' "$(HTML "${page}:${l}")" "$ldate"
+ row="${row}<td class=\"current\" ><a href=\"$(HTML "${page}:${l}")\">current</a ><span class=\"date\">${ldate%% +*}</span></td>"
+ [ "$rowstate" = "${rowstate%*current*}" ] && rowstate="${rowstate}${rowstate:+ }current"
fi
else
- printf '<td><a href="%s">missing</a></td>' "$(HTML "${page}:${l}")"
+ row="${row}<td class=\"missing\"><a href=\"$(HTML "${page}:${l}")\">missing</a></td>"
+ [ "$rowstate" = "${rowstate%*missing*}" ] && rowstate="${rowstate}${rowstate:+ }missing"
fi
done
- printf '</tr>\n'
+ printf '<tr class="%s">%s</tr>\n' "$rowstate" "$row"
done
printf '</tbody></table>'
.macro.toc li.h5 { margin-left: 5em; }
.macro.toc li.h6 { margin-left: 6.25em; }
+
.macro.gallery {
text-align: center;
margin: 2em 0;
max-height: 9em;
margin: 0 .25em;
}
+
+
+.macro.changes td .date {
+ display: block;
+ font-size: .75em;
+}
+.macro.changes td.outdated,
+.macro.changes td.current,
+.macro.changes td.missing {
+ text-align: center;
+}
+.macro.changes th { background-color: #EEF; }
+.macro.changes td { background-color: #DFF; }
+.macro.changes td.outdated { background-color: #FFD; }
+.macro.changes td.current { background-color: #DFD; }
+.macro.changes td.missing { background-color: #FDD; }