Merge pull request #342 from sgmap/stats-layout

Stats layout
This commit is contained in:
Mathieu Magnin 2017-05-29 16:09:52 +02:00 committed by GitHub
commit 84cf52d1a5
7 changed files with 15 additions and 9 deletions

View file

@ -40,7 +40,6 @@
// = require recapitulatif
// = require search
// = require siret
// = require stats
// = require support_navigator_banner
// = require switch_menu
// = require typeahead

View file

@ -1,5 +1,3 @@
@import "card";
$dark-grey: #333333;
$light-grey: #999999;
$blue: rgba(61, 149, 236, 1);
@ -12,8 +10,9 @@ $new-h1-margin-bottom: 4 * $default-space;
.new-h1 {
color: $dark-grey;
text-align: center;
margin-top: 0;
margin-bottom: $new-h1-margin-bottom;
font-weight: bold;
font-size: 41px;
}
$statistiques-padding-top: $default-space * 2;
@ -33,6 +32,7 @@ $statistiques-padding-top: $default-space * 2;
$stat-card-margin-bottom: 3 * $default-space;
.stat-card {
padding: 15px;
margin-bottom: $stat-card-margin-bottom;
border-radius: 5px;
box-shadow: none;
@ -49,7 +49,7 @@ $stat-card-half-horizontal-spacing: 4 * $default-space;
.stat-card-title {
color: $dark-grey;
font-size: 26px;
font-weight: 500;
font-weight: bold;
width: 200px;
}

View file

@ -13,3 +13,7 @@
.center {
text-align: center;
}
.hidden {
display: none;
}

View file

@ -1,4 +1,5 @@
class StatsController < ApplicationController
layout "new_application"
def index
procedures = Procedure.where(:published => true)

View file

@ -37,6 +37,7 @@
= render partial: "layouts/mailjet_newsletter"
= javascript_include_tag "application", "data-turbolinks-track" => true
= yield :charts_js
- if Rails.env == "test"
%script{ :type => "text/javascript" }
(typeof jQuery !== "undefined") && (jQuery.fx.off = true);

View file

@ -4,7 +4,7 @@
.stat-cards
.card.stat-card.stat-card-half.pull-left
.stat-card.stat-card-half.pull-left
%ul.segmented-control.pull-right
%li.segmented-control-item.segmented-control-item-active{ :onclick => "TPS.toggleChart(event, '.cumulative-procedures-chart');" }
Cumul
@ -21,7 +21,7 @@
= line_chart @procedures_30_days_flow,
:colors => ["rgba(61, 149, 236, 1)"]
.card.stat-card.stat-card-half.pull-left
.stat-card.stat-card-half.pull-left
%ul.segmented-control.pull-right
%li.segmented-control-item.segmented-control-item-active{ :onclick => "TPS.toggleChart(event, '.cumulative-dossiers-chart');" }
Cumul
@ -38,12 +38,12 @@
= line_chart @dossiers_30_days_flow,
:colors => ["rgba(61, 149, 236, 1)"]
.card.stat-card.stat-card-half.big-number-card.pull-left
.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)
.card.stat-card.stat-card-half.big-number-card.pull-left
.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)

View file

@ -0,0 +1 @@
Chartkick.options[:content_for] = :charts_js