Skip to content

Commit

Permalink
Displays donation summary on league show page.
Browse files Browse the repository at this point in the history
  • Loading branch information
toomuchpete committed Apr 18, 2024
1 parent 6e806f8 commit 9f41f4a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/views/leagues/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@
.span5
= render :partial => '/league_summary', :locals => {league: @league}
- if permitted_to? :manage, @league
- if @league.solicit_donations?
%hr
- registration_id_list = @league.registrations.active.to_a.map(&:_id)
- donation_list = Donation.where(registration_id: {'$in': registration_id_list})
.row
.span2{style: 'font-weight: bold;'} Donations:
.span3
%strong Number:
=donation_list.count
%br
%strong Total:
=number_to_currency donation_list.to_a.inject(0){|sum,d| sum+d.amount}

%hr
%h4 League Comps
= render partial: 'comps', locals: {league: @league}
Expand Down

0 comments on commit 9f41f4a

Please sign in to comment.