ck3g/homebugh

View on GitHub
app/views/statistics/index.html.haml

Summary

Maintainability
Test Coverage
%h2= title t("parts.statistics.stats_by_months")


%div{role: 'tabpanel'}
  = render 'tabs'

  .tab-content
    .tab-pane.active
    .currencies{role: 'tabpanel'}
      %ul.nav.nav-tabs{tole: 'tablist'}
        - current_user.currencies.each_with_index do |currency, index|
          %li{class: ('active' if active_currency?(currency, :statistics_path, index.zero?))}
            = link_to currency.name, statistics_path(currency: currency.name)
      #stats
        - @statistics.each do |stats|
          = render 'charts',
            title: stats[:title],
            total_income: stats[:income],
            total_spending: stats[:spending],
            income_chart_data: stats[:income_chart_data],
            spending_chart_data: stats[:spending_chart_data]