2014-03-23 00:22:25 +00:00
|
|
|
<% vote_maps, vote_servers = false %>
|
|
|
|
|
2014-04-15 09:59:52 +00:00
|
|
|
<div class="data servers">
|
2014-05-04 11:53:47 +00:00
|
|
|
<div class="contents">
|
|
|
|
<h4>Server Votes</h4>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2014-05-04 11:53:47 +00:00
|
|
|
<ul class="votes">
|
|
|
|
<% @gather.gather_servers.ordered.each do |server| %>
|
|
|
|
<li>
|
|
|
|
<span class="count">
|
|
|
|
<%= if server.votes then server.votes else "0" end %>
|
|
|
|
</span>
|
|
|
|
<% if server.real_votes.build(user: cuser).can_create? cuser %>
|
|
|
|
<%= link_to server,
|
|
|
|
controller: "votes", action: "create",
|
|
|
|
vote: { votable_id: server.id, votable_type: "GatherServer" },
|
|
|
|
method: "post" %>
|
|
|
|
<% vote_servers = true else %>
|
|
|
|
<%= server %>
|
|
|
|
<% end %>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2014-05-04 11:53:47 +00:00
|
|
|
<% if vote_servers %>
|
|
|
|
<p>Click to vote</p>
|
|
|
|
<p><%= link_to "More servers", { controller: :servers }, { class: 'button tiny' } %></p>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2014-04-15 09:59:52 +00:00
|
|
|
</div>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2014-04-15 09:59:52 +00:00
|
|
|
<div class="data">
|
2014-05-04 11:53:47 +00:00
|
|
|
<div class="contents">
|
|
|
|
<h4>Map Votes</h4>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2014-05-04 11:53:47 +00:00
|
|
|
<ul class="votes">
|
|
|
|
<% @gather.gather_maps.ordered.each do |map| %>
|
|
|
|
<li>
|
|
|
|
<span><%= map.votes %></span>
|
|
|
|
<% if map.real_votes.build(user: cuser).can_create? cuser %>
|
2015-04-06 21:28:35 +00:00
|
|
|
<%= link_to shorten(map, 30),
|
2014-05-04 11:53:47 +00:00
|
|
|
controller: "votes", action: "create",
|
|
|
|
vote: { votable_id: map.id, votable_type: "GatherMap" },
|
|
|
|
method: "post" %>
|
|
|
|
<% vote_maps = true %>
|
|
|
|
<% else %>
|
2015-04-06 21:28:35 +00:00
|
|
|
<%= shorten map, 30 %>
|
2014-05-04 11:53:47 +00:00
|
|
|
<% end %>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2014-05-04 11:53:47 +00:00
|
|
|
<% if vote_maps %>
|
|
|
|
<p>Click to vote</p>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2014-04-15 09:59:52 +00:00
|
|
|
</div>
|