From 1c9552b9220a72348564edcacb9ae10f98459268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 4 Jan 2019 19:18:31 +0100 Subject: [PATCH] Add number-with-info HTML class to stats So it can be reused in advanced statistics. --- app/assets/stylesheets/stats.scss | 37 ++++++++++--------- .../shared/stats/_participation.html.erb | 6 +-- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/app/assets/stylesheets/stats.scss b/app/assets/stylesheets/stats.scss index f6d8845c5..27fb84873 100644 --- a/app/assets/stylesheets/stats.scss +++ b/app/assets/stylesheets/stats.scss @@ -20,16 +20,30 @@ margin-top: $line-height; } - .participants { + .number-with-info { display: inline-block; margin-right: $line-height * 2; - padding-left: $line-height * 2.5; - position: relative; - &::before { + &.participants { + padding-left: $line-height * 2.5; + position: relative; + + &::before { + left: 0; + position: absolute; + } + } + + &.total-participants::before { content: image-url('stats_man.png'); - left: 0; - position: absolute; + } + + &.male::before { + content: image-url('stats_man.png'); + } + + &.female::before { + content: image-url('stats_woman.png'); } .number { @@ -45,17 +59,6 @@ } } - .gender { - - &.male::before { - content: image-url('stats_man.png'); - } - - &.female::before { - content: image-url('stats_woman.png'); - } - } - .progress { background: #ebf0f4; border-radius: rem-calc(20); diff --git a/app/views/shared/stats/_participation.html.erb b/app/views/shared/stats/_participation.html.erb index cf31920db..d49fb839b 100644 --- a/app/views/shared/stats/_participation.html.erb +++ b/app/views/shared/stats/_participation.html.erb @@ -4,7 +4,7 @@

<%= t("stats.total_participants") %>

-

+

<%= stats[:total_participants] %> <%= t("polls.show.stats.total_votes") %>

@@ -13,7 +13,7 @@

<%= t("stats.by_gender") %>

-

+

<%= stats[:total_male_participants] %> <%= I18n.t("stats.men_percentage", @@ -21,7 +21,7 @@

-

+

<%= stats[:total_female_participants] %> <%= I18n.t("stats.women_percentage",