forked from GitHub/dbot
6c459c5b23
Cleaned up polls.jade Added a link to the first interpolated quotes.
37 lines
1.3 KiB
Plaintext
37 lines
1.3 KiB
Plaintext
div#backlink
|
|
a(href='/polls/') « Poll list
|
|
h2 #{description}
|
|
p Voters (#{locals.totalVotes}):
|
|
-each voter in votees
|
|
| #{voter}
|
|
ul#votelist
|
|
-var hasYouTubeVids=false
|
|
-each votes,option in options
|
|
-var percentage = votes/locals.totalVotes*100
|
|
-if(options.hasOwnProperty(option))
|
|
-if(option.match(locals.url_regex))
|
|
li.option
|
|
-if(option.match(/(jpg|png|gif|jpeg|tiff)$/))
|
|
a(href=option)
|
|
img(src=option)
|
|
-else if(option.match(/youtube.com\/watch/))
|
|
-hasYouTubeVids = true
|
|
span(class='ytplaceholder')
|
|
=option
|
|
-else
|
|
a(href=option)
|
|
=option
|
|
-else
|
|
li.option #{option}
|
|
li.option-votes
|
|
.vote-track
|
|
-if(!isNaN(percentage))
|
|
.vote-percentage(style="width: #{percentage}%")
|
|
case votes
|
|
when 1: #{votes} vote
|
|
default: #{votes} votes
|
|
-if(!isNaN(percentage))
|
|
|(#{percentage.toFixed(2)}%)
|
|
-if(hasYouTubeVids)
|
|
script(src='/ytembed.js')
|