]> git.plutz.net Git - serve0/blobdiff - list.sh
list styling
[serve0] / list.sh
diff --git a/list.sh b/list.sh
index 9abf0e9d9e27fc23af9a34b35405b3c6c9af7b3a..ddf111136381418fcf3db8a342906325c5680555 100644 (file)
--- a/list.sh
+++ b/list.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-list_item(){
+list_item() {
   name="$(HTML "$1")"
   path="$(HTML "$ITEM/$1")"
   meta="$_DATA/$ITEM/.index/meta"
@@ -12,21 +12,21 @@ list_item(){
     read -r length width height tags comment n <<-EOF
        $(grep -m1 -F " $1" "$meta")
        EOF
-     printf '[div .list .file
-               [a href="%s" [img src="%s?a=thumbnail"] %s]
-               [span .time %i:%imin] [span .dim %ix%i] %s
-             ]' \
-       "$path" "$path" "$name" \
-       "$((length / 60))" "$((length % 60))" \
-       "$width" "$height" \
-       "$(printf %s\\n "${tags#tags=}" |tr , ' ' |xargs printf '[span .tag %s]')"
+    printf '[div .list .file
+              [a href="%s" [img src="%s?a=thumbnail"][label %s]]
+              [span .time %i:%imin] [span .dim %ix%i] %s
+            ]' \
+      "$path" "$path" "$name" \
+      "$((length / 60))" "$((length % 60))" \
+      "$width" "$height" \
+      "$(printf %s\\n "${tags#tags=}" |tr , ' ' |xargs printf '[span .tag %s]')"
   else
-    printf '[div .list .file [a href="%s" [img src="%s?a=thumbnail"] %s]]' \
+    printf '[div .list .file [a href="%s" [img src="%s?a=thumbnail"][label %s]]]' \
       "$path" "$path" "$name"
   fi
 }
 
-list_items(){
+list_items() {
   mode="$(COOKIE mode |grep -m1 -xE 'index|browse' || printf browse )"
 
   [ "$mode" = browse -a "$ITEM" ] && printf '..\n'
@@ -55,10 +55,9 @@ list_items(){
     Name) sort -k 2;;
   esac \
   | cut -d/ -f2-
-    
 }
 
-list_paginate(){
+list_paginate() {
   page="$(GET p |grep -xE '[0-9]+' || printf 1)"
 
   printf '[div .itemlist '