ensl.org/app/views/polls/_show.html.erb
Luke Barratt ca75960bdd Added gather player count
Improved content spacing
Colour tweaks
2014-05-09 22:38:14 +01:00

23 lines
702 B
Text

<div class="widget-content-wrapper">
<div class="question">
<h5><%= @poll.question %></h5>
<% @poll.options.all.each do |opt| %>
<p class="option">
<% if cuser and !@poll.voted?(cuser) %>
<%= link_to (h opt), controller: "votes", action: "create", vote: { votable_id: opt.id, votable_type: "Option" } %>
<% else %>
<%= opt.option %> <br />
<% end %>
<% if opt.votes > 0 %>
<%= content_tag :div, "", { class: "bar", style: "width: #{opt.votes*100/@poll.votes}%;" } %>
<% end %>
<span><%= opt.votes %></span>
</p>
<% end %>
</div>
<%= link_to "Archive", polls_path, class: "button" %>
</div>