tab/app/views/pages/landing.html.haml
2016-02-17 15:09:49 +01:00

44 lines
1.6 KiB
Plaintext

%h1.columns-title Tab
= javascript_include_tag "//www.google.com/jsapi", "chartkick"
- unless user_signed_in?
.pure-g.landing_columns
.pure-u-1.pure-u-md-1-2
%h2 Authentication
%p Log een keer in en betaal uw schulden!
%p= link_to "Log in met Zeus WPI", user_omniauth_authorize_path(:zeuswpi), class: "pure-button pure-button-primary login-button"
.pure-u-1.pure-u-md-1-2
%h2 Pie of Shame
= pie_chart @statistics.shamehash
- else
%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