]> git.plutz.net Git - webpoll/blobdiff - poll.sh
make admin link more visible
[webpoll] / poll.sh
diff --git a/poll.sh b/poll.sh
index 5624284347abf702012712528d37fb126fa39f12..bb5bc8db1d213dc0b46d3bdebacfe5a24d257c3f 100644 (file)
--- a/poll.sh
+++ b/poll.sh
@@ -4,7 +4,10 @@ id="$(checkid "${PATH_INFO#/}")"
 file="${_DATA}/${id}"
 
 #cancel if poll is invalid
-[ "$id" -a -f "$file" ] || REDIRECT "$_BASE/"
+if [ ! "$id" -o ! -f "$file" ]; then
+  page_home;
+  return 0
+fi
 
 if expr match "$bookmarks" ".*${id}.*" >/dev/null; then
   :
@@ -88,8 +91,12 @@ table_poll() {
   if [ "$splittimes" = yes -o "$todall" ]; then
     printf '[tr .tod [th]'
     for time in $timelist; do
-      [ "${time#*_}" = "${time}" ] && time="_${time}"
-      printf '[th . %s]' "${time#*_}"
+      case $time in
+       *-*-*_*:*) time="${time#*_}";;
+       *-*-*) time="";;
+       *:*);;  # time="${time}"
+      esac
+      printf '[th . %s]' "${time}"
     done
     printf '[th]]\n'
   fi