On the Stats page, move the total numbers at the top of the page

This commit is contained in:
gregoirenovel 2017-05-29 17:16:26 +02:00
parent e19fb43f01
commit 58aa94359c
2 changed files with 12 additions and 13 deletions

View file

@ -7,6 +7,9 @@ class StatsController < ApplicationController
procedures = Procedure.where(:published => true)
dossiers = Dossier.where.not(:state => :draft)
@procedures_count = procedures.count
@dossiers_count = dossiers.count
@procedures_in_the_last_4_months = last_four_months_hash(procedures)
@dossiers_in_the_last_4_months = last_four_months_hash(dossiers, :initiated_at)
@ -16,9 +19,6 @@ class StatsController < ApplicationController
@procedures_cumulative = cumulative_hash(procedures)
@dossiers_cumulative = cumulative_hash(dossiers, :initiated_at)
@procedures_count = procedures.count
@dossiers_count = dossiers.count
@dossier_instruction_mean_time = dossier_instruction_mean_time(dossiers)
@dossier_filling_mean_time = dossier_filling_mean_time(dossiers)
end

View file

@ -3,6 +3,15 @@
%h1.new-h1 Statistiques
.stat-cards
.stat-card.stat-card-half.big-number-card.pull-left
%span.big-number-card-title TOTAL PROCÉDURES DÉMATÉRIALISÉES
%span.big-number-card-number
= number_with_delimiter(@procedures_count)
.stat-card.stat-card-half.big-number-card.pull-left
%span.big-number-card-title TOTAL DOSSIERS DÉPOSÉS
%span.big-number-card-number
= number_with_delimiter(@dossiers_count)
.stat-card.stat-card-half.pull-left
%span.stat-card-title Procédures dématérialisées / mois
@ -54,16 +63,6 @@
= line_chart @dossiers_30_days_flow,
:colors => ["rgba(61, 149, 236, 1)"]
.stat-card.stat-card-half.big-number-card.pull-left
%span.big-number-card-title TOTAL PROCÉDURES DÉMATÉRIALISÉES
%span.big-number-card-number
= number_with_delimiter(@procedures_count)
.stat-card.stat-card-half.big-number-card.pull-left
%span.big-number-card-title TOTAL DOSSIERS DÉPOSÉS
%span.big-number-card-number
= number_with_delimiter(@dossiers_count)
- if administration_signed_in?
- cache "computation-heavy-stats", :expires_in => 1.day do
.stat-card.stat-card-half.pull-left