aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2013-05-31 12:48:01 +0000
committerNicolas Vigier <boklm@mageia.org>2013-05-31 12:48:01 +0000
commit6c6ff997a0c19a3edbf7b6fd2cb91af2ac71567e (patch)
tree5eed52b9d4f7f33a86604e66621ca925bb960ac8
parent8103337ecdc5ffef6c9a45e002539dcac8053735 (diff)
downloadmgatres-6c6ff997a0c19a3edbf7b6fd2cb91af2ac71567e.tar
mgatres-6c6ff997a0c19a3edbf7b6fd2cb91af2ac71567e.tar.gz
mgatres-6c6ff997a0c19a3edbf7b6fd2cb91af2ac71567e.tar.bz2
mgatres-6c6ff997a0c19a3edbf7b6fd2cb91af2ac71567e.tar.xz
mgatres-6c6ff997a0c19a3edbf7b6fd2cb91af2ac71567e.zip
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
-rw-r--r--NEWS1
-rwxr-xr-xmktreasurer6
-rw-r--r--tmpl/donations_who.html15
-rw-r--r--tmpl/index.html4
4 files changed, 26 insertions, 0 deletions
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 @@
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>List of people who donated money to Mageia.Org</title>
+ </head>
+ <body>
+ <h1>List of people who donated money to Mageia.Org</h1>
+
+ <ul>
+ [%- FOR pa IN donations.sorted_pa_by_total -%]
+ <li><a href="donations_p_[% pa %].html">[% donations.by_pa.$pa.who %]</a>: [% donations.by_pa.$pa.total %] Euros</li>
+ [%- END -%]
+ </ul>
+ </body>
+</html>
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 -%]
</ul>
+ <h2>Who donated money</h2>
+
+ You can find <a href="donations_who.html">a list of people who donated to Mageia.Org</a>.
+
<h2>RSS Feeds</h2>
<p><a href="donations.rss">Donations RSS Feed <img src="[% config.staticdir_url %]/feed-16x16.png" alt="RSS feed" /></a></p>
<p><a href="transactions.rss">Transactions RSS Feed <img src="[% config.staticdir_url %]/feed-16x16.png" alt="RSS feed" /></a></p>