32 lines
1.2 KiB
Text
32 lines
1.2 KiB
Text
%h1.columns-title Tab
|
|
= javascript_include_tag "//www.google.com/jsapi", "chartkick"
|
|
%h2.columns-title Cute Little Statistics
|
|
.pure-g
|
|
.pure-u-1.pure-u-md-1-2.landing-column
|
|
%h3.columns-title Pie of Shame
|
|
= pie_chart @statistics.shamehash
|
|
%h3.columns-title Table of Shame
|
|
%table.pure-table.full-table
|
|
%thead
|
|
%th Shame on
|
|
%th Contribution to Zeus' lack of money
|
|
%tbody
|
|
- @statistics.shameful_users.each do |user|
|
|
%tr
|
|
%td.shameful-person= user.name
|
|
// Won't divide by zero because there won't be any users with
|
|
// a shameful debt if the total debt is zero.
|
|
%td.shame-percentage= "#{-100 * user.balance / @statistics.total_debt}%"
|
|
.pure-u-1.pure-u-md-1-2.landing-column
|
|
%h3.columns-title Distribution of Debt Sources
|
|
= pie_chart @statistics.by_issuer
|
|
%h3.columns-title Top Debt Creators
|
|
%table.pure-table.full-table
|
|
%thead
|
|
%th Issuer
|
|
%th Number of Transactions issued
|
|
%tbody
|
|
- @statistics.creation_counts.each do |name, count|
|
|
%tr
|
|
%td.shameful-person= name
|
|
%td.shame-percentage= count
|