From e0fa82a533479b1d11349b48da6e0f46222c0751 Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Thu, 10 Jan 2019 16:31:24 +0100 Subject: [PATCH 1/3] Change layout dashboard proposals stats Created new layout to avoid text jump support --- app/assets/stylesheets/dashboard.scss | 11 ++++++++ .../dashboard/_proposal_totals.html.erb | 28 +++++++++---------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/app/assets/stylesheets/dashboard.scss b/app/assets/stylesheets/dashboard.scss index 53303f387..b7dac1e4b 100644 --- a/app/assets/stylesheets/dashboard.scss +++ b/app/assets/stylesheets/dashboard.scss @@ -40,10 +40,21 @@ @include breakpoint(medium) { border-left: 2px solid $highlight; + } + + @include breakpoint(large) { border-right: 2px solid $highlight; } } + .supports { + margin-top: $line-height; + + @include breakpoint(large) { + margin-top: 0; + } + } + .counter-value { font-size: rem-calc(20); font-weight: bold; diff --git a/app/views/layouts/dashboard/_proposal_totals.html.erb b/app/views/layouts/dashboard/_proposal_totals.html.erb index 3c110b474..06059067a 100644 --- a/app/views/layouts/dashboard/_proposal_totals.html.erb +++ b/app/views/layouts/dashboard/_proposal_totals.html.erb @@ -1,6 +1,6 @@
-
+
<%= Dashboard::Action.active.resources.active_for(proposal).count %> @@ -11,14 +11,14 @@
-
+
<%= number_with_delimiter(community_members_count, delimiter: '.') %>
<%= t("layouts.dashboard.proposal_totals.community") %>
-
+
<%= number_with_delimiter(proposal.votes_for.size, delimiter: '.') %> @@ -29,9 +29,9 @@
-
+
-
+
<%= next_goal_progress %>%
@@ -40,16 +40,16 @@
+
+
-
- -
+
+
From 36abba15e6378fbc70ad63c8e9fef72ffdb6ee6e Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Thu, 10 Jan 2019 20:01:31 +0100 Subject: [PATCH 2/3] Dashboard proposals stats V.2 - Found new solution to show dashboard proposals stats - Added new class for behaviour change in the medium version - Moved the progress bar to the bottom - Moved below by adding counter-label class to the text support - Added class to support text to push under the counter --- app/assets/stylesheets/dashboard.scss | 19 +++--- .../dashboard/_proposal_totals.html.erb | 61 ++++++++++--------- config/locales/es/general.yml | 4 +- 3 files changed, 47 insertions(+), 37 deletions(-) diff --git a/app/assets/stylesheets/dashboard.scss b/app/assets/stylesheets/dashboard.scss index b7dac1e4b..b6a70ae86 100644 --- a/app/assets/stylesheets/dashboard.scss +++ b/app/assets/stylesheets/dashboard.scss @@ -27,17 +27,23 @@ } .dashboard-proposals-stats { + text-align: center; border: 2px solid $highlight; border-radius: rem-calc(6); margin-bottom: $line-height; padding: $line-height / 2; - .counter { - text-align: center; + @include breakpoint(medium only) { + .change-behaviour { + padding: $line-height; + margin-top: $line-height; + float: left; + width: 100%; + margin-top: $line-height / 2; + } } .counter-divider { - @include breakpoint(medium) { border-left: 2px solid $highlight; } @@ -48,10 +54,9 @@ } .supports { - margin-top: $line-height; - @include breakpoint(large) { - margin-top: 0; + .counter-label { + display: block; } } @@ -68,7 +73,7 @@ .progress { background: #f0efea; border-radius: rem-calc(6); - height: $line-height; + height: $line-height / 2; } .progress-meter { diff --git a/app/views/layouts/dashboard/_proposal_totals.html.erb b/app/views/layouts/dashboard/_proposal_totals.html.erb index 06059067a..7b72cdd30 100644 --- a/app/views/layouts/dashboard/_proposal_totals.html.erb +++ b/app/views/layouts/dashboard/_proposal_totals.html.erb @@ -18,39 +18,44 @@
-
-
-
- <%= number_with_delimiter(proposal.votes_for.size, delimiter: '.') %> - / - <%= t("layouts.dashboard.proposal_totals.support_count", count: number_with_delimiter(next_goal_supports, delimiter: '.')) %> -
- <%= t("layouts.dashboard.proposal_totals.current_goal") %> -
-
- -
-
-
-
- <%= next_goal_progress %>% +
+
+
+
+ <%= number_with_delimiter(proposal.votes_for.size, delimiter: '.') %> + / + <%= t("layouts.dashboard.proposal_totals.support_count", count: number_with_delimiter(next_goal_supports, delimiter: '.')).html_safe %>
-
" aria-valuemax="100"> -
+ <%= t("layouts.dashboard.proposal_totals.current_goal") %> +
+ +
+ <%= next_goal_progress %>% +
+
" aria-valuemax="100"> +
+
+
+ +
+
+
+ +
+ +
+
-
- -
diff --git a/config/locales/es/general.yml b/config/locales/es/general.yml index 46422fd8c..342a74dc9 100644 --- a/config/locales/es/general.yml +++ b/config/locales/es/general.yml @@ -211,8 +211,8 @@ es: preview_proposal: Previsualizar propuesta current_goal: Meta actual support_count: - one: "%{count} apoyo" - other: "%{count} apoyos" + one: "%{count} Apoyo" + other: "%{count} Apoyos" footer: accessibility: Accesibilidad conditions: Condiciones de uso From 5c6abce8eecbb7e6dcee8ed837edbaebcb8b3d8e Mon Sep 17 00:00:00 2001 From: Alessandro Cuoghi Date: Fri, 11 Jan 2019 15:44:41 +0100 Subject: [PATCH 3/3] Fixed css order and depth - Reordered the properties of the css to pass houndci-bot verification --- app/assets/stylesheets/dashboard.scss | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/app/assets/stylesheets/dashboard.scss b/app/assets/stylesheets/dashboard.scss index b6a70ae86..dbe8c9897 100644 --- a/app/assets/stylesheets/dashboard.scss +++ b/app/assets/stylesheets/dashboard.scss @@ -27,19 +27,18 @@ } .dashboard-proposals-stats { - text-align: center; border: 2px solid $highlight; border-radius: rem-calc(6); margin-bottom: $line-height; padding: $line-height / 2; + text-align: center; @include breakpoint(medium only) { .change-behaviour { - padding: $line-height; - margin-top: $line-height; float: left; - width: 100%; margin-top: $line-height / 2; + padding: $line-height; + width: 100%; } } @@ -53,11 +52,8 @@ } } - .supports { - - .counter-label { - display: block; - } + .supports .counter-label { + display: block; } .counter-value {