]> git.plutz.net Git - webpoll/blobdiff - newdate.sh
vote count, reply editing
[webpoll] / newdate.sh
index 32533b8090b17dce35e21e194134e836e437a1bb..b2e35a6b5144c94b602640628a86897cdacc8c5a 100755 (executable)
@@ -25,11 +25,13 @@ fs_timeofday() {
 }
 
 fs_splittimes() {
-  local day times time c
+  local days day times time c
+  days="$(DBM "$file" get dates)"
   cat <<-EOF
        [fieldset .splittimes
          [checkbox "none" "none" .splittimes checked disabled=disabled] [submit "splittimes" "no" Separate Time Options per Day]
-         $(for day in $(DBM "$file" get dates); do 
+         $([ ! "$days" ] && printf '[p You have not selected any days yet.]\n')
+         $(for day in $days; do 
             date -d $day +"[h2 . %A - %B %_d, %Y]"
            times=$(DBM "$file" get "tod_$day")
            for time in ${times:--}; do
@@ -114,6 +116,8 @@ if [ "$REQUEST_METHOD" = POST ]; then
   if [ "$(POST cancel)" = cancel ]; then
     rm -- "$file"
     REDIRECT "$_BASE/"
+  elif [ "$(POST post)" = post ]; then
+    REDIRECT "$_BASE${PATH_INFO%/*}"
   else
     REDIRECT "$_BASE$PATH_INFO${month:+?month=}${month}"
   fi