-- Leo's gemini proxy
-- Connecting to git.thebackupbox.net:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini
repo: actpub action: commit revision: path_from: revision_from: 92c5622c0d76c814c9d1cd4ffb74fedd7053479b: path_to: revision_to:
commit 92c5622c0d76c814c9d1cd4ffb74fedd7053479b Author: epoch <epoch@thebackupbox.net> Date: Thu Apr 6 21:23:08 2023 +0000 poll items broke when the choice had a space in it. duh. changed. diff --git a/ap-object2html b/ap-object2html
--- a/ap-object2html +++ b/ap-object2html @@ -151,7 +151,9 @@ if [ "$type" == "Question" ];then i=0 if [ "$(jq -r '.oneOf | type' < "${object_file}")" = "array" ];then total_votes=$(jq -r '[.oneOf[] | .replies.totalItems] | add' < "${object_file}") - jq -r '.oneOf[] | .name,.replies.totalItems' < "${object_file}" | paste - - | while read -r name votes;do + jq -r '.oneOf[] | .name,.replies.totalItems' < "${object_file}" | paste - - | while read -r line;do + votes="$(cut -f2 <<< "$line")" + name="$(cut -f1 <<< "$line")" printf '<li>\n' printf '<input id="opt%s" type="radio" name="vote" value="%s">\n' "$i" "$name" printf '<meter for="opt%s" value="%s" min="0" max="%s">%s votes</meter>\n' "$i" "$votes" "$total_votes" "$votes"
-----END OF PAGE-----
-- Response ended
-- Page fetched on Sun Jun 2 19:11:01 2024