-- 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:

git.thebackupbox.net

actpub

git://git.thebackupbox.net/actpub

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

index f9c24e61c2217aa4de5932ace1e4c74ad9321974..

index ..be609e2bd37bebc7a8c49552d18db782d03c9017 100755

--- 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