From 6d9ced63a2d12cfa2e894f97c97c69d4ce16d6d6 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Mon, 31 Oct 2016 13:10:15 +0100 Subject: [PATCH 1/4] renames and removes unused variables --- app/assets/stylesheets/_settings.scss | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/app/assets/stylesheets/_settings.scss b/app/assets/stylesheets/_settings.scss index 44433938b..242a03b82 100644 --- a/app/assets/stylesheets/_settings.scss +++ b/app/assets/stylesheets/_settings.scss @@ -48,37 +48,32 @@ // -------------------- $base-font-size: rem-calc(17); -$base-line-height: rem-calc(26); +$base-line: rem-calc(26); $small-font-size: rem-calc(14); $line-height: rem-calc(24); $brand: #004A83; -$body: #E9E9E9; -$background: #EDEFF0; -$border: #DEE0E3; $dark: darken($brand, 10%); $text: #222222; $text-medium: #999999; $text-light: #CCCCCC; +$border: #DEE0E3; + $link: #2895F1; -$link-hover: #2178BF; +$link-hover: darken($link, 20%); $debates: #008CCF; -$votes-bg: #26AEEE; -$votes-border: #1F94CB; -$votes-like: #7BD2A8; -$votes-like-act: #5D9E7F; -$votes-unlike: #EF8585; -$votes-unlike-act: #BD6A6A; +$votes: #26AEEE; +$like: #7BD2A8; +$unlike: #EF8585; $delete: #F04124; $check: #46DB91; $proposals: #FFA42D; -$proposals-border: #CC8425; $budget: #454372; $budget-hover: #7571BF; @@ -86,9 +81,6 @@ $budget-hover: #7571BF; $highlight: #E7F2FC; $featured: #FED900; -$footer-bg: #DEE0E2; -$footer-color: #171819; -$footer-link: #454A4C; $footer-border: #BFC1C3; $success-bg: #DFF0D8; From 7d4f92f10ad26c4afa8aa60bbcd1aede8a4def36 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Mon, 31 Oct 2016 13:11:23 +0100 Subject: [PATCH 2/4] unifies styles of page forms --- app/assets/stylesheets/admin.scss | 2 +- app/views/debates/edit.html.erb | 2 +- app/views/debates/new.html.erb | 2 +- app/views/management/proposals/new.html.erb | 2 +- app/views/management/spending_proposals/new.html.erb | 2 +- app/views/proposals/new.html.erb | 2 +- app/views/spending_proposals/new.html.erb | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index cd8241fca..4968983f0 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -82,7 +82,7 @@ body.admin { .admin-content { - .proposal-new, .proposal-edit { + .proposal-form { padding-top: 0; } diff --git a/app/views/debates/edit.html.erb b/app/views/debates/edit.html.erb index eea353438..13a2aa625 100644 --- a/app/views/debates/edit.html.erb +++ b/app/views/debates/edit.html.erb @@ -1,4 +1,4 @@ -
+
<%= render "shared/back_link" %> diff --git a/app/views/debates/new.html.erb b/app/views/debates/new.html.erb index 65d47bbcd..cd4a92cc6 100644 --- a/app/views/debates/new.html.erb +++ b/app/views/debates/new.html.erb @@ -1,4 +1,4 @@ -
+
<%= render "shared/back_link" %> diff --git a/app/views/management/proposals/new.html.erb b/app/views/management/proposals/new.html.erb index e3e2087e9..07c7e734a 100644 --- a/app/views/management/proposals/new.html.erb +++ b/app/views/management/proposals/new.html.erb @@ -1,4 +1,4 @@ -
+
<%= render '/shared/print' %> diff --git a/app/views/management/spending_proposals/new.html.erb b/app/views/management/spending_proposals/new.html.erb index e036a04cb..b4cc82cf2 100644 --- a/app/views/management/spending_proposals/new.html.erb +++ b/app/views/management/spending_proposals/new.html.erb @@ -1,4 +1,4 @@ -
+
<%= render '/shared/print' %> diff --git a/app/views/proposals/new.html.erb b/app/views/proposals/new.html.erb index 2887cd97a..fb9bcaf38 100644 --- a/app/views/proposals/new.html.erb +++ b/app/views/proposals/new.html.erb @@ -1,4 +1,4 @@ -
+
<%= render "shared/back_link" %> diff --git a/app/views/spending_proposals/new.html.erb b/app/views/spending_proposals/new.html.erb index 219444857..6c962c482 100644 --- a/app/views/spending_proposals/new.html.erb +++ b/app/views/spending_proposals/new.html.erb @@ -1,4 +1,4 @@ -
+
<%= render "shared/back_link" %> From d771b739bf2e932beb5ffde8bd9572c446b3093c Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Mon, 31 Oct 2016 13:25:48 +0100 Subject: [PATCH 3/4] renames variables, removes unused styles --- app/assets/stylesheets/layout.scss | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index 8052513fc..1b186d438 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -40,7 +40,7 @@ h1, h2, h3, h4, h5, h6 { p { font-size: $base-font-size; font-weight: 400; - line-height: $base-line-height; + line-height: $base-line; } a { @@ -487,7 +487,7 @@ header { // ---------- footer { - color: $footer-color; + color: $text; .logo a { font-family: 'Lato' !important; @@ -507,10 +507,11 @@ footer { } a, a:active, a:focus { - color: $footer-link; + color: $text; + text-decoration: underline; &:hover { - color: $footer-color; + color: $text-medium; } } @@ -519,7 +520,7 @@ footer { } h2 a { - border-bottom: 1px solid $footer-border; + border-bottom: 1px solid $text-light; display: block; font-size: rem-calc(24); line-height: rem-calc(31); @@ -529,14 +530,14 @@ footer { } .footer { - background: $footer-bg; + background: $border; border-top: 6px solid $brand; margin-top: $line-height*2; padding-top: $line-height; } .subfooter { - border-top: 1px solid $footer-border; + border-top: 1px solid $text-light; padding-top: $line-height/2; } @@ -563,8 +564,8 @@ footer { color: $link; &:hover { - background: $highlight; - color: $link-hover; + background: $brand; + color: white; } } @@ -1002,15 +1003,6 @@ img.avatar, img.admin-avatar, img.moderator-avatar, img.initialjs-avatar { // 09. Search // ---------- -.search-form h3 { - border-top: 1px solid $votes-border; - display: inline-block; - font-size: rem-calc(16); - margin: -1px 0 $line-height/2; - padding-top: $line-height/4; - text-transform: uppercase; -} - .search-results h2 { margin-bottom: 0; } From 6fd5e6a67acc50d443a5b6c3339f710a3d0d3a95 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Mon, 31 Oct 2016 16:50:13 +0100 Subject: [PATCH 4/4] unifies styles for participation not allowed --- app/assets/javascripts/votes.js.coffee | 14 +- app/assets/stylesheets/layout.scss | 1 + app/assets/stylesheets/participation.scss | 239 ++++++------------- app/views/comments/_votes.html.erb | 4 +- app/views/debates/_votes.html.erb | 32 +-- app/views/proposals/_featured_votes.html.erb | 32 +-- app/views/proposals/_votes.html.erb | 32 +-- app/views/spending_proposals/_votes.html.erb | 2 +- spec/support/common_actions.rb | 4 +- 9 files changed, 125 insertions(+), 235 deletions(-) diff --git a/app/assets/javascripts/votes.js.coffee b/app/assets/javascripts/votes.js.coffee index 030b9cf46..b842c3ffc 100644 --- a/app/assets/javascripts/votes.js.coffee +++ b/app/assets/javascripts/votes.js.coffee @@ -3,17 +3,11 @@ App.Votes = hoverize: (votes) -> $(document).on { 'mouseenter focus': -> - $("div.anonymous-votes", this).show(); - $("div.organizations-votes", this).show(); - $("div.not-logged", this).show(); - $("div.no-supports-allowed", this).show(); - $("div.logged", this).hide(); + $("div.participation-not-allowed", this).show(); + $("div.participation-allowed", this).hide(); mouseleave: -> - $("div.anonymous-votes", this).hide(); - $("div.organizations-votes", this).hide(); - $("div.not-logged", this).hide(); - $("div.no-supports-allowed", this).hide(); - $("div.logged", this).show(); + $("div.participation-not-allowed", this).hide(); + $("div.participation-allowed", this).show(); }, votes initialize: -> diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index 1b186d438..c3dded973 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -1580,6 +1580,7 @@ table { font-size: $small-font-size; margin: rem-calc(6) 0; padding: rem-calc(6); + position: relative; [class^="icon-arrow"] { font-size: rem-calc(18); diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss index efd385c19..1ab1eb726 100644 --- a/app/assets/stylesheets/participation.scss +++ b/app/assets/stylesheets/participation.scss @@ -12,15 +12,14 @@ // ---------------------- @mixin votes { - background: $votes-bg; - border-top: 1px solid $votes-border; + background: $votes; margin: 0 rem-calc(-12); padding: rem-calc(14) rem-calc(12); position: relative; - .icon-like { + .icon-like, .icon-unlike { background: white; - border: 2px solid $votes-border; + border: 2px solid $votes; border-radius: rem-calc(3); color: $text-light; display: inline-block; @@ -29,40 +28,25 @@ padding: rem-calc(3) rem-calc(6); position: relative; - &:hover { - background: $votes-like; + &:hover, &:active { border-color: white; color: white; cursor: pointer; opacity: 1 !important; } + } - &:active { - border-color: $votes-like-act; + .icon-like { + + &:hover, &:active { + background: $like; } } .icon-unlike { - background: white; - border: 2px solid $votes-border; - border-radius: rem-calc(3); - color: $text-light; - display: inline-block; - font-size: rem-calc(30); - line-height: rem-calc(30); - padding: rem-calc(3) rem-calc(6); - position: relative; - &:hover { - background: $votes-unlike; - border-color: white; - color: white; - cursor: pointer; - opacity: 1 !important; - } - - &:active { - border-color: $votes-unlike-act; + &:hover, &:active { + background: $unlike; } } @@ -81,20 +65,23 @@ } .voted { - .icon-like { - background: $votes-like; + + .icon-like, .icon-unlike { border-color: white; color: white; } + .icon-like { + background: $like; + } + .icon-unlike { - background: $votes-unlike; - border-color: white; - color: white; + background: $unlike; } } .no-voted { + .icon-like, .icon-unlike { opacity: .5; } @@ -109,54 +96,10 @@ .divider { margin: 0 rem-calc(6); } - - .not-logged { - background: rgba(22,99,135,.9); - color: white; - font-size: $small-font-size; - height: 100%; - left: 0; - position: absolute; - text-align: center; - top: 0; - width: 100%; - filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#222222', endColorstr='#222222'); /* IE */ - - a { - color: white; - text-decoration: underline; - } - } - - .anonymous-votes, .organizations-votes { - background: $warning-bg; - color: $color-warning; - height: 100%; - left: 0; - line-height: $line-height; - padding-top: rem-calc(12); - position: absolute; - text-align: center; - top: 0; - width: 100%; - - p { - color: $color-warning; - margin: 0 rem-calc(12); - text-align: left; - } - - a { - color: $color-warning; - font-weight: bold; - text-decoration: underline; - } - } } @mixin supports { background: $proposals; - border-top: 1px solid $proposals-border; margin: 0 rem-calc(-12); padding: rem-calc(14) rem-calc(12); position: relative; @@ -166,7 +109,7 @@ height: $line-height/2; .meter { - background: $votes-like; + background: $like; display: block; height: $line-height/2; } @@ -197,7 +140,7 @@ margin-top: rem-calc(12); &:hover { - background: $proposals-border; + background: darken($proposals, 35%); color: white; cursor: pointer; } @@ -221,49 +164,6 @@ margin: 0 rem-calc(6); } - .not-logged { - background: rgba(255,164,45,.9); - color: white; - font-size: $small-font-size; - height: 100%; - left: 0; - position: absolute; - text-align: center; - top: 0; - width: 100%; - filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#222222', endColorstr='#222222'); /* IE */ - - a { - color: white; - text-decoration: underline; - } - } - - .anonymous-votes, .organizations-votes, .no-supports-allowed { - background: $warning-bg; - color: $color-warning; - height: 100%; - left: 0; - line-height: $line-height; - padding-top: rem-calc(12); - position: absolute; - text-align: center; - top: 0; - width: 100%; - - p { - color: $color-warning; - margin: 0 rem-calc(12); - text-align: left; - } - - a { - color: $color-warning; - font-weight: bold; - text-decoration: underline; - } - } - .supported { color: white; margin-top: rem-calc(12); @@ -285,32 +185,61 @@ } } +.participation-not-allowed { + background: $warning-bg; + color: $color-warning; + height: 100%; + left: 0; + line-height: $line-height; + padding: $line-height $line-height/2; + position: absolute; + text-align: center; + top: 0; + width: 100%; + z-index: 2; + + p { + color: $color-warning !important; + margin: 0 rem-calc(12); + text-align: left; + } + + a { + color: $color-warning !important; + font-weight: bold; + text-decoration: underline; + } +} + +.reply .participation-not-allowed { + padding-right: $line-height/2; + padding-top: $line-height/6; + text-align: right; +} + // 02. New participation // --------------------- -.debate-new, .debate-edit, -.proposal-new, .proposal-edit, -.spending-proposal-new, .spending-proposal-edit { +.debate-form, +.proposal-form, +.spending-proposal-form { + + .icon-debates, .icon-proposals, .icon-budget { + font-size: rem-calc(50); + line-height: $line-height; + opacity: .5; + } .icon-debates { color: $debates; - font-size: rem-calc(60); - line-height: $line-height; - opacity: .5; } .icon-proposals { color: $proposals; - font-size: rem-calc(50); - line-height: $line-height; - opacity: .5; } .icon-budget { color: $budget; - font-size: rem-calc(50); - line-height: $line-height; - opacity: .5; } .recommendations { @@ -330,14 +259,14 @@ } } -.debate-new, .debate-edit { +.debate-form { .recommendations li:before { color: $debates; } } -.proposal-new, .proposal-edit { +.proposal-form { .recommendations li:before { color: $proposals; @@ -496,11 +425,6 @@ line-height: $line-height; } - .not-logged { - line-height: $line-height; - padding: rem-calc(24); - } - @include breakpoint(small + rem-calc(1) and medium down) { .in-favor, .against { text-align: left; @@ -530,11 +454,6 @@ float: none; line-height: $line-height; } - - .not-logged { - line-height: $line-height; - padding: rem-calc(24); - } } .leave-comment { @@ -711,15 +630,6 @@ } } - .not-logged { - line-height: $line-height; - padding-top: rem-calc(24); - } - - .anonymous-votes, .organizations-votes { - padding-top: rem-calc(24); - } - .divider { display: none; } @@ -745,7 +655,7 @@ .votes { @include votes; - border: 1px solid $votes-border; + border: 1px solid $votes; margin: 0 rem-calc(-12); @include breakpoint(medium) { @@ -803,7 +713,7 @@ .supports { @include supports; - border: 1px solid $proposals-border; + border: 1px solid $proposals; margin: 0 rem-calc(-12); @include breakpoint(medium) { @@ -904,16 +814,6 @@ line-height: rem-calc(70); } - .no-supports-allowed { - background: rgba(69,67,114,.96); - color: white; - padding: rem-calc(12); - } - - .no-supports-allowed p, .no-supports-allowed a { - color: white; - } - .share-supported { .ssb-twitter, @@ -1006,18 +906,13 @@ margin-top: 0; } - .not-logged, - .organizations-votes, - .anonymous-votes { + .participation-not-allowed { background: $featured; - color: $color-warning; font-size: $small-font-size; - line-height: $line-height; padding-top: 0; a { color: $color-warning; - font-weight: bold; } p { diff --git a/app/views/comments/_votes.html.erb b/app/views/comments/_votes.html.erb index 8ee315e35..0de92a675 100644 --- a/app/views/comments/_votes.html.erb +++ b/app/views/comments/_votes.html.erb @@ -33,7 +33,7 @@ <% elsif !user_signed_in? %> -
+
<%= t('comments.comment.votes', count: comment.total_votes) %>  |  @@ -60,7 +60,7 @@ <%= comment.total_dislikes %>
- <% if user_signed_in? && current_user.organization? %> - + <% elsif user_signed_in? && !proposal.votable_by?(current_user)%> - + <% elsif !user_signed_in? %> - + <% end %> <% if voted_for?(@featured_proposals_votes, proposal) %> diff --git a/app/views/proposals/_votes.html.erb b/app/views/proposals/_votes.html.erb index 0c572e71f..198bf5d07 100644 --- a/app/views/proposals/_votes.html.erb +++ b/app/views/proposals/_votes.html.erb @@ -31,24 +31,24 @@
<% if user_signed_in? && current_user.organization? %> - + <% elsif user_signed_in? && !proposal.votable_by?(current_user)%> - + <% elsif !user_signed_in? %> - + <% end %> <% if voted_for?(@proposal_votes, proposal) && setting['twitter_handle'] %> diff --git a/app/views/spending_proposals/_votes.html.erb b/app/views/spending_proposals/_votes.html.erb index a4fd43993..9ef7e75b3 100644 --- a/app/views/spending_proposals/_votes.html.erb +++ b/app/views/spending_proposals/_votes.html.erb @@ -24,7 +24,7 @@
<% if reason.present? && !user_voted_for %> -