tab/app/views/pages/landing.html.haml
2015-09-14 17:21:53 +02:00

33 lines
1 KiB
Text

%h1 Tab!
%h2 Authentication
- if user_signed_in?
%p Yeah! Je bent ingelogd.
- else
Log een keer in!
%p= link_to "Log in met Zeus WPI", user_omniauth_authorize_path(:zeuswpi)
%h2 Cute Little Statistics
= javascript_include_tag "//www.google.com/jsapi", "chartkick"
.pure-g
.pure-u-1-2
%h3 Table of Shame
%table.pure-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
%h3 Pie of Shame
= pie_chart @statistics.shamehash
.pure-g
.pure-u-1-2
%h3 Distribution of Debt Sources
= pie_chart @statistics.by_issuer
.pure-u-1-2
%h3 Distribution of Transaction Amounts
= column_chart @statistics.amount_distribution