mirror of https://codeberg.org/cage/tinmop/
- prevented skipping code when a poll has not expired.
This commit is contained in:
parent
976f154bc2
commit
cc6bbd691b
|
@ -240,20 +240,20 @@
|
|||
(mapcar #'db:row-votes-count options)))
|
||||
(max-title-w (find-max-line-length all-titles))
|
||||
(max-bar-width (- width max-title-w 6))
|
||||
(bar-char (swconf:vote-vertical-bar))
|
||||
(expiredp (db:row-poll-expired-p poll)))
|
||||
(with-output-to-string (stream)
|
||||
(loop for option in options do
|
||||
(let* ((title (left-padding (db:row-title option) max-title-w))
|
||||
(rate (handler-case
|
||||
(/ (db:row-votes-count option)
|
||||
vote-sum)
|
||||
(error () 0)))
|
||||
(vote (left-padding (format nil "~a%" (* 100 rate)) 4))
|
||||
(bar-w (truncate (* rate max-bar-width))))
|
||||
(format stream "~a " title)
|
||||
(loop for i from 0 below bar-w do
|
||||
(princ bar-char stream))
|
||||
(format stream " ~a~%" (left-padding vote (- max-bar-width bar-w)))))
|
||||
(when expiredp
|
||||
(format stream "~%~a~%" (_ "The poll has expired")))))))
|
||||
(bar-char (swconf:vote-vertical-bar)))
|
||||
(let ((expiredp (db:row-poll-expired-p poll)))
|
||||
(with-output-to-string (stream)
|
||||
(loop for option in options do
|
||||
(let* ((title (left-padding (db:row-title option) max-title-w))
|
||||
(rate (handler-case
|
||||
(/ (db:row-votes-count option)
|
||||
vote-sum)
|
||||
(error () 0)))
|
||||
(vote (left-padding (format nil "~a%" (* 100 rate)) 4))
|
||||
(bar-w (truncate (* rate max-bar-width))))
|
||||
(format stream "~a " title)
|
||||
(loop for i from 0 below bar-w do
|
||||
(princ bar-char stream))
|
||||
(format stream " ~a~%" (left-padding vote (- max-bar-width bar-w)))))
|
||||
(when expiredp
|
||||
(format stream "~%~a~%" (_ "The poll has expired"))))))))
|
||||
|
|
Loading…
Reference in New Issue