From 3d6e478a6d6e865bc54b26bb64b1ab1006250506 Mon Sep 17 00:00:00 2001 From: echarp Date: Thu, 6 Nov 2014 00:33:33 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20total=20par=20r=C3=A9gion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/stats/index.html.haml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/views/stats/index.html.haml b/app/views/stats/index.html.haml index ae8a6103..86104c9f 100644 --- a/app/views/stats/index.html.haml +++ b/app/views/stats/index.html.haml @@ -19,6 +19,7 @@ %th/ - @years.each do |year| %th= year[0] + %th/ %tbody - (1..12).each do |m| %tr @@ -50,14 +51,19 @@ %th/ - @years.each do |year| %th= year[0] + %th=t '.total' + %th/ %tbody - Region.all.each do |region| %tr %th.month= region + - total = 0 - @years.each do |year| %td.quantity + - total += @regions[[region.id, year[0]]] || 0 = link_to root_path(year: "#{year[0]}", region: region.id) do = number_with_delimiter @regions[[region.id, year[0]]] + %th.total= number_with_delimiter total %td.sparkline/ %h3=t '.city'