From 875e8557d847cdcbd5c32ae42ff1c3fec451828d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Tue, 17 Jul 2018 01:53:54 +0200 Subject: [PATCH] simplification due to update in html-sh --- cgilite | 2 +- widgets.sh | 24 +++++++++++++----------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/cgilite b/cgilite index 55052a1..6aa432e 160000 --- a/cgilite +++ b/cgilite @@ -1 +1 @@ -Subproject commit 55052a16e5c2792b25c90b8aea0e3daea06b533a +Subproject commit 6aa432e55d9227b58dbe3d20518eb7adfa057070 diff --git a/widgets.sh b/widgets.sh index 3142b44..62a4027 100644 --- a/widgets.sh +++ b/widgets.sh @@ -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#*:}" printf '[option %s value="%s" %s]' \ - "$([ ! "${f%%*|${tag}|*}" ] && printf 'selected="selected"')" \ + "$([ ! "${f%%*|${tag}|*}" ] && printf 'selected')" \ "$tg" "$tn" done printf '\n]' -- 2.39.2