aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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>