]> git.plutz.net Git - serve0/blobdiff - templates/filterdiag.html.sh
simplified filter mechanism
[serve0] / templates / filterdiag.html.sh
index 9a388887c9d294740e28b4ea84320ca857fb1e03..3e81b286152b7ac5fd1c316371449bbaeeac1ee8 100755 (executable)
@@ -44,7 +44,7 @@ cat <<FilterEnd
     <span class="help">Up to <b>10</b> filter boxes will appear as you start selecting tags. You can select <b>multiple</b> tags in each box by holding down the <b>Ctrl</b>-key. Click the "<b>Filter!</b>" button when you are ready.</span>
 
   $(for n in {0..9}; do
-    hideall="$(sed -rn "s;^([^:]+):.*$;hide('${n}_\\1')\\;;p" <<<"$taglist" |sort -u)hide('${n}_none');"
+    hideall="$(echo "$taglist" |sed -rn "s;^([^:]+):.*$;hide('${n}_\\1')\\;;p" |sort -u)hide('${n}_none');"
     echo "
     <div class="filter" id=\"filter$n\" $([ $n -gt 0 ] && echo 'style="display:none;"')>
       <span class=\"help conjunction\">and</span>
@@ -54,16 +54,16 @@ cat <<FilterEnd
       <span class=\"label category\">Category:</span>
       <select class=\"input category\" name=\"category$n\" size=\"1\" onchange=\"${hideall}show_block('${n}_'+this.options[this.options.selectedIndex].value)\">
         <option>none</option>
-        $(sed -rn 's;^([^:]+):.*$;<option>\1</option>;p' <<<"$taglist" |sort -u)
+        $(echo "$taglist" |sed -rn 's;^([^:]+):.*$;<option>\1</option>;p' |sort -u)
       </select>
-      <select class=\"input tagfilter\" name=\"filter${n}_\" size=\"12\" multiple id=\"${n}_none\"
+      <select class=\"input tagfilter\" name=\"cfilter${n}_\" size=\"12\" multiple id=\"${n}_none\"
               onchange=\"show_iblock('filter$((1+$n))')\">
-         $(sed -rn 's;^([^:]+)$;<option>\1</option>;p' <<<"$taglist")
+         $(echo "$taglist" |sed -rn 's;^([^:]+)$;<option>\1</option>;p')
       </select>
-      $(sed -rn 's;^([^:]+):.*$;\1;p' <<<"$taglist" |sort -u |while read cat; do echo "
+      $(echo "$taglist" |sed -rn 's;^([^:]+):.*$;\1;p' |sort -u |while read cat; do echo "
       <select class=\"input tagfilter\" name=\"cfilter${n}_\" size=\"12\" multiple id=\"${n}_$cat\" style=\"display:none;\"
               onchange=\"show_iblock('filter$((1+$n))')\">
-         $(sed -rn "s;^$cat:(.*)$;<option>\\1</option>;p" <<<"$taglist")
+         $(echo "$taglist" |sed -rn 's;^'"$cat"':(.*)$;<option>\1</option>;p')
       </select>"
       done)
     </div>"