ensl.org/app/views/gathers/_voting.html.erb

35 lines
975 B
Text
Raw Normal View History

<div class="gather-columns">
<div class="data">
<div class="contents">
<h4>Vote Captains</h4>
<table id="gatherers">
<% @gather.gatherers.most_voted.each do |gatherer| %>
<tr>
<td><%= flag gatherer.user.country %></td>
<td>
(<%= gatherer.votes %>)
<% if @gatherer and gatherer.real_votes.build(user: cuser).can_create? cuser %>
<%= link_to (h gatherer.user),
controller: "votes", action: "create",
vote: { votable_id: gatherer.id, votable_type: "Gatherer"},
method: "post" %>
<% else %>
<%= namelink gatherer.user %>
<% end %>
</td>
</tr>
<% end %>
</table>
<% if @gatherer %>
<p>Click to vote for captain.</p>
<% end %>
</div>
</div>
<%= render partial: 'votes' %>
</div>
<%= render partial: 'status' %>