tab/app/views/pages/landing.html.haml

44 lines
1.6 KiB
Text
Raw Normal View History

2015-09-17 18:23:21 +02:00
%h1.columns-title Tab
= javascript_include_tag "//www.google.com/jsapi", "chartkick"
2015-09-17 18:23:21 +02:00
- unless user_signed_in?
.pure-g
.pure-u-1-2.left-column
%h2 Authentication
2015-09-18 13:34:37 +02:00
%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"
2015-09-17 18:23:21 +02:00
.pure-u-1-2.right-column
%h2 Pie of Shame
= pie_chart @statistics.shamehash
- else
%h2.columns-title Cute Little Statistics
.pure-g
.pure-u-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-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