]> git.plutz.net Git - serve0/commitdiff
simplification due to update in html-sh
authorPaul Hänsch <paul@plutz.net>
Mon, 16 Jul 2018 23:53:54 +0000 (01:53 +0200)
committerPaul Hänsch <paul@plutz.net>
Mon, 16 Jul 2018 23:53:54 +0000 (01:53 +0200)
cgilite
widgets.sh

diff --git a/cgilite b/cgilite
index 55052a16e5c2792b25c90b8aea0e3daea06b533a..6aa432e55d9227b58dbe3d20518eb7adfa057070 160000 (submodule)
--- a/cgilite
+++ b/cgilite
@@ -1 +1 @@
-Subproject commit 55052a16e5c2792b25c90b8aea0e3daea06b533a
+Subproject commit 6aa432e55d9227b58dbe3d20518eb7adfa057070
index 3142b4485aedbdeece2d7bd89a0c090c063f4fb3..62a40271b735f06cd9a8bd255374d79457facdca 100644 (file)
@@ -78,21 +78,23 @@ w_advsearch(){
     lbid="$(HTML "cat_${n}_(none)")"
     printf '[input .and type=checkbox name=and id="and_%i" %s][label for="and_%i" +and
             ][fieldset .select
-            [input .pol type="radio" name=pol_%i %s id="pol_pos_%i"][label for=pol_pos_%i Any]
-            [input .pol type="radio" name=pol_%i %s id="pol_neg_%i"][label for=pol_neg_%i None]
+            [radio "pol_%i" "pos" .pol %s #pol_pos_%i"][label for=pol_pos_%i Any]
+            [radio "pol_%i" "neg" .pol %s #pol_neg_%i"][label for=pol_neg_%i None]
             [label .head Category:]' \
-            $n "$([ "$f" ] && printf 'checked="checked"')" $n \
-            $n "$([ "$f" -a ! "${f%%~*}" ] || printf 'checked="checked"')" $n $n \
-            $n "$([ "$f" -a ! "${f%%~*}" ] && printf 'checked="checked"')" $n $n
+            $n "$([ "$f" ] && printf 'checked')" $n \
+            $n "$([ "$f" -a ! "${f%%~*}" ] || printf 'checked')" $n $n \
+            $n "$([ "$f" -a ! "${f%%~*}" ] && printf 'checked')" $n $n
     f="|${f#~}|"
 
     printf '*\n%s\n' "$w_tagcategories" \
     | while read -r category; do
-      lbid="$(HTML "cat_${n}_${category}")"
-      printf '[input .cat type=radio %s name="cat_%i" id="%s"][label for="%s" %s]
-              [select name=tag_%s size=10 multiple="multiple"' \
-              "$([ ! "${f%%*|${category}:*}" -o ! "${category%\*}" ] && printf 'checked="checked"')" \
-              $n "$lbid" "$lbid" "$(HTML "$category")" $n
+      catn="$(HTML "$category")"
+      lbid="cat_${n}_${catn}"
+      printf '[radio "cat_%i" "%s" .cat id="%s" %s][label for="%s" %s]
+              [select name=tag_%s size=10 multiple' \
+              $n "$catn" "$lbid" \
+              "$([ ! "${f%%*|${category}:*}" -o ! "${category%\*}" ] && printf 'checked')" \
+              "$lbid" "$catn" $n
 
       printf %s "$w_tags" \
       | { [ "$category" = '*' ] && grep -vF ':' || grep -wF "${category}"; } \
@@ -100,7 +102,7 @@ w_advsearch(){
         [ ! "$tag" ] && continue
         tg="$(HTML "$tag")"; tn="${tg#*&#58;}"
         printf '[option %s value="%s" %s]' \
-          "$([ ! "${f%%*|${tag}|*}" ] && printf 'selected="selected"')" \
+          "$([ ! "${f%%*|${tag}|*}" ] && printf 'selected')" \
           "$tg" "$tn"
       done
       printf '\n]'