From 6c6ff997a0c19a3edbf7b6fd2cb91af2ac71567e Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Fri, 31 May 2013 12:48:01 +0000 Subject: add donations_who.html page listing all people who donated money git-svn-id: svn+ssh://svn.mageia.org/svn/soft/mga-treasurer/trunk@8409 5b7c3c08-40e5-403b-9995-ace06908e4af --- NEWS | 1 + mktreasurer | 6 ++++++ tmpl/donations_who.html | 15 +++++++++++++++ tmpl/index.html | 4 ++++ 4 files changed, 26 insertions(+) create mode 100644 tmpl/donations_who.html diff --git a/NEWS b/NEWS index a3158ef..e52b998 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ +- add donations_who.html page listing all people who donated money - provide some data in JSON format - sort donations by date on monthly page diff --git a/mktreasurer b/mktreasurer index f13b531..44b8d56 100755 --- a/mktreasurer +++ b/mktreasurer @@ -83,6 +83,7 @@ sub donations_infos { by_year => {}, by_pa => {}, total_30 => 0, + sorted_pa_by_total => [], ); foreach my $don (@{$res{donations}}) { my $dt = DateTime->from_epoch(epoch => $don->{date}); @@ -95,6 +96,7 @@ sub donations_infos { push @{$res{by_year}->{$year}->{months}}, $month unless grep { $_ eq $month } @{$res{by_year}->{$year}->{months}}; push @{$res{by_pa}->{$don->{pa}}->{donations}}, $don; + $res{by_pa}->{$don->{pa}}->{who} = $don->{who}; if (time - $don->{date} < '2592000') { # last 30 days $res{total_30} += $don->{amount}; } @@ -106,6 +108,9 @@ sub donations_infos { $d->{type}->{$don->{sc_name}} += $don->{amount}; } } + @{$res{sorted_pa_by_total}} = sort { + $res{by_pa}->{$b}->{total} <=> $res{by_pa}->{$a}->{total} + } keys %{$res{by_pa}}; return \%res; } @@ -267,6 +272,7 @@ sub output_pages { last_update => $last_update, }; process_template($template, 'donations', $vars, 'donations'); + process_template($template, 'donations_who', $vars, 'donations_who'); process_template($template, 'transactions', $vars, 'transactions'); process_template($template, 'index', $vars, 'index'); } diff --git a/tmpl/donations_who.html b/tmpl/donations_who.html new file mode 100644 index 0000000..aa5208e --- /dev/null +++ b/tmpl/donations_who.html @@ -0,0 +1,15 @@ + + + + List of people who donated money to Mageia.Org + + +

List of people who donated money to Mageia.Org

+ + + + diff --git a/tmpl/index.html b/tmpl/index.html index 2939fc4..11e8382 100644 --- a/tmpl/index.html +++ b/tmpl/index.html @@ -161,6 +161,10 @@ [%- END -%] +

Who donated money

+ + You can find a list of people who donated to Mageia.Org. +

RSS Feeds

Donations RSS Feed RSS feed

Transactions RSS Feed RSS feed

-- cgit v1.2.1