agenda-libre-ruby/app/views/stats/index.html.haml

87 lines
2.0 KiB
Plaintext
Raw Normal View History

2014-07-21 23:17:11 +02:00
%h2
%em.fa.fa-signal
= title t '.title'
2014-07-26 18:27:19 +02:00
%dl
%dt= t '.allEvents'
%dd.quantity= number_with_delimiter @events_count
%dt= t '.awaitingModeration'
%dd.quantity= number_with_delimiter @events_um_count
%dt= t '.allOrgas'
%dd.quantity= number_with_delimiter @orgas_count
%dt= t '.awaitingModeration'
%dd.quantity= number_with_delimiter @orgas_um_count
%h3
%em.fa.fa-calendar
= t '.dates'
%table.list.dates
%thead
%tr
%th/
2014-11-06 00:23:01 +01:00
- @years.each do |year|
%th= year[0]
2014-11-06 00:33:33 +01:00
%th/
%tbody
- (1..12).each do |m|
%tr
2014-10-19 16:47:30 +02:00
%th.month= I18n.t('date.month_names')[m]
2014-11-06 00:23:01 +01:00
- @years.each do |year|
2015-12-27 00:16:17 +01:00
- line = @months.find do |l|
- l[0][0] == year[0] && l[0][1].try(:to_i) == m
%td.quantity
= link_to root_path(start_date: "#{year[0]}-#{m}-01") do
= number_with_delimiter line[1] if line
%td.sparkline/
%tfoot
%tr
%th= t '.total'
2014-11-06 00:23:01 +01:00
- @years.each do |year|
%th.quantity= number_with_delimiter year[1]
%tr
%th/
%td.sparkline{ colspan: @years.size }
%h3
%em.fa.fa-shield-alt
= t '.regional'
2014-11-06 00:23:01 +01:00
%table.list.dates
%thead
%tr
%th/
- @years.each do |year|
%th= year[0]
%th= t '.total'
2014-11-06 00:33:33 +01:00
%th/
2014-11-06 00:23:01 +01:00
%tbody
- @regions.each do |region|
2014-11-06 00:23:01 +01:00
%tr
2019-04-29 18:29:38 +02:00
%th.region= t(region.code.presence ? region.code : region.name,
scope: :countries, default: region.name)
2014-11-06 00:33:33 +01:00
- total = 0
2014-11-06 00:23:01 +01:00
- @years.each do |year|
%td.quantity
- total += @region_events[[region.id, year[0]]] || 0
= link_to root_path(year: year[0].to_s, region: region.id) do
= number_with_delimiter @region_events[[region.id, year[0]]]
2014-11-06 00:36:58 +01:00
%th.quantity.total= number_with_delimiter total
2014-11-06 00:23:01 +01:00
%td.sparkline/
2018-02-11 18:06:32 +01:00
%h3
%em.fa.fa-building
= t '.city'
%p= t '.city_conditions'
2014-07-26 18:27:19 +02:00
%dl
- @city_events.each do |city|
2014-07-26 18:27:19 +02:00
%dt.item= city[0]
%dd.quantity= number_with_delimiter city[1]