webgui/app/views/pool/index.html.erb in tournament-2.2.0 vs webgui/app/views/pool/index.html.erb in tournament-2.2.1
- old
+ new
@@ -7,10 +7,11 @@
<small>
<% if current_user && pool.user_id == current_user.id %>
<%= link_to '[Edit]', :controller => 'admin', :action => 'pool', :id => pool.id %>
<%= link_to '[Entries]', :controller => 'admin', :action => 'entries', :id => pool.id %>
+<%= link_to '[Bracket]', :controller => 'admin', :action => 'bracket', :id => pool.id %>
<% end %>
<%= link_to '[Leader Board]', :controller => 'reports', :action => 'show', :id => pool.id, :report => 'leader' %>
<%= link_to '[Reports]', :controller => 'reports', :action => 'show', :id => pool.id %>
</small>
<div class="poollistinfo">
@@ -22,11 +23,13 @@
<div class="poollistinfodetail">
Entry Fee: $<%=pool.fee%>
</div>
<div class="poollistinfodetail">
Payouts:
+<% take = pool.user_entries.size * pool.fee.to_f -
+ (pool.payouts.inject(0) {|sum, p| sum += p.kind == '$' ? p.payout.to_i : 0}) %>
<% pool.payouts.delete_if{|p| p.kind.blank?}.sort_by {|p| p.rank }.each do |p| -%>
-<%=p.rank != 'L' ? p.rank.to_i.ordinal : 'Last'%>: <%= p.kind if p.kind == '$'%><%=p.payout%><%=p.kind if p.kind != '$'%>
+<%=p.rank != 'L' ? p.rank.to_i.ordinal : 'Last'%>: $<%=p.kind == '$' ? p.payout : p.payout.to_f / 100.0 * take%>
<% end -%>
</div>
<div class="poollistinfodetail">
Scoring: <%=pool.pool.scoring_strategy.description%>
</div>