X-Git-Url: http://git.plutz.net/?p=serve0;a=blobdiff_plain;f=list.sh;h=2d9dff832cd480ab70f29cacc5e6dfa209ee36ba;hp=1a5a6cf05fce903418d04d1e956da3fce4609031;hb=1b79a90402ee3fe450575085470b3ec6d084d78b;hpb=4fa45dcb5617057ce673d3db42b941aae9f66271 diff --git a/list.sh b/list.sh index 1a5a6cf..2d9dff8 100644 --- a/list.sh +++ b/list.sh @@ -25,18 +25,20 @@ list_item() { name="$(list_fullname "$(UNSTRING "${name%${CR}}")")" fi if [ -f "$_DATA/$ITEM/$name" ]; then - display="$(HTML "$name")" link="$(URL "$ITEM/$name")" + name="$(HTML "$ITEM/$name")" printf '[div .list .file [a href="%s" [img src="%s?a=thumbnail"]][label %s] [span .time %i:%imin] [span .dim %ix%i] %s [checkbox "select" "%s" id="select_%s"][label for="select_%s" +] ]' \ - "$link" "$link" "$name" \ + "$link" "$link" "${name##*/}" \ "$((length / 60))" "$((length % 60))" \ "$width" "$height" \ - "$(UNSTRING "${tags#tags=}" |tr , '\0' |xargs -r0 printf ' [span .tag %s]')" \ - "$link" "$link" "$link" + "$(printf '%s\n' "${tags#tags=}" \ + | sed -r "$UNSTRING"' s;^;,;; s;,+;,;g; s;,$;;; + :X s;,([^,]+)(,|$); [span .tag \1]\2;; tX;' + )" "$name" "$link" "$link" else printf 'Canning record for nonexist file: %s\n' "$name" >&2 # meta_purge "$_DATA/$ITEM/$name"