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

88 lines
1.9 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 Event.moderated.count
%dt= t '.awaitingModeration'
%dd.quantity= number_with_delimiter Event.unmoderated.count
%dt= t '.allOrgas'
%dd.quantity= number_with_delimiter Orga.moderated.count
%dt= t '.awaitingModeration'
%dd.quantity= number_with_delimiter Orga.unmoderated.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|
%td.quantity
2014-11-06 00:23:01 +01:00
- line = @months.find { |line| line[0][0] == year[0] && line[0][1].try(:to_i) == m }
= 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
= 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
- Region.all.each do |region|
%tr
2014-11-29 19:48:10 +01:00
%th.region= region
2014-11-06 00:33:33 +01:00
- total = 0
2014-11-06 00:23:01 +01:00
- @years.each do |year|
%td.quantity
2014-11-06 00:33:33 +01:00
- total += @regions[[region.id, year[0]]] || 0
2014-11-06 00:23:01 +01:00
= link_to root_path(year: "#{year[0]}", region: region.id) do
= number_with_delimiter @regions[[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/
%h3= 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]
%h3= t '.web'
:markdown
#{t '.webalizer'}