diff --git a/Gemfile b/Gemfile index c8e81f860..2779aa9a7 100644 --- a/Gemfile +++ b/Gemfile @@ -53,7 +53,7 @@ gem "rollbar", "~> 3.0.1" gem "sassc-rails", "~> 2.1.2" gem "savon", "~> 2.12.1" gem "sitemap_generator", "~> 6.1.2" -gem "social-share-button", "~> 1.1" +gem "social-share-button", "~> 1.2.3" gem "sprockets", "~> 3.7.2" gem "translator-text", "~> 0.1.0" gem "turbolinks", "~> 5.2.1" diff --git a/Gemfile.lock b/Gemfile.lock index 3dc9a30fb..e848da938 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -557,7 +557,7 @@ GEM sitemap_generator (6.1.2) builder (~> 3.0) smart_properties (1.15.0) - social-share-button (1.1.0) + social-share-button (1.2.3) coffee-rails socksify (1.7.1) spring (2.1.1) @@ -724,7 +724,7 @@ DEPENDENCIES scss_lint (~> 0.59.0) selenium-webdriver (~> 3.142) sitemap_generator (~> 6.1.2) - social-share-button (~> 1.1) + social-share-button (~> 1.2.3) spring (~> 2.1.1) spring-commands-rspec (~> 1.0.4) sprockets (~> 3.7.2) diff --git a/app/assets/javascripts/social_share.js b/app/assets/javascripts/social_share.js index eb75fe479..70343755a 100644 --- a/app/assets/javascripts/social_share.js +++ b/app/assets/javascripts/social_share.js @@ -3,7 +3,7 @@ App.SocialShare = { initialize: function() { $(".social-share-button a").each(function() { - $(this).append("" + ($(this).data("site")) + ""); + $(this).append("" + ($(this).data("site").replace(/_app$/, "")) + ""); }); }, destroy: function() { diff --git a/app/assets/stylesheets/icons.scss b/app/assets/stylesheets/icons.scss index 5915164d2..aaf6ccb2f 100644 --- a/app/assets/stylesheets/icons.scss +++ b/app/assets/stylesheets/icons.scss @@ -186,10 +186,6 @@ font-weight: normal; } -.icon-whatsapp::before { - content: "\f232"; -} - .icon-zip::before { content: "\f1c6"; font-weight: normal; @@ -285,7 +281,6 @@ .icon-instagram, .icon-telegram, .icon-twitter, -.icon-whatsapp, .icon-youtube { &::before { diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index 85b7ca3db..64ff558d6 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -1569,17 +1569,15 @@ table { } } -.ssb-twitter { - background: #45b0e3; - background-image: none !important; +.social-share-button .ssb-icon { + background-image: none; color: #fff; - height: $line-height * 2 !important; + height: $icon-width; position: relative; - width: $line-height * 2 !important; + width: $icon-width; &::before { - content: "f"; - font-family: "icons" !important; + font-family: "icons"; font-size: rem-calc(24); left: 50%; line-height: $line-height * 2; @@ -1591,6 +1589,18 @@ table { &:hover, &:focus { background: #fff; + } +} + +.ssb-twitter { + background: #45b0e3; + + &::before { + content: "f"; + } + + &:hover, + &:focus { color: #40a2d1; } } @@ -1607,26 +1617,13 @@ table { .ssb-facebook { background: #3b5998; - background-image: none !important; - color: #fff; - height: rem-calc(48) !important; - position: relative; - width: rem-calc(48) !important; &::before { content: "A"; - font-family: "icons" !important; - font-size: rem-calc(24); - left: 50%; - line-height: $line-height * 2; - margin-left: rem-calc(-11); - position: absolute; - top: 0; } &:hover, &:focus { - background: #fff; color: #354f88; } } @@ -1663,34 +1660,35 @@ table { .ssb-telegram { background: #08c; - background-image: none !important; - color: #fff; - height: $line-height * 2 !important; - position: relative; - width: $line-height * 2 !important; &::before { content: "1"; - font-family: "icons" !important; - font-size: rem-calc(24); - left: 50%; - line-height: $line-height * 2; - margin-left: rem-calc(-11); - position: absolute; - top: 0; } &:hover, &:focus { - background: #fff; color: #40a2d1; } } +.ssb-whatsapp_app { + background: #43d854; + + &::before { + content: "P"; + } + + &:hover, + &:focus { + color: #43d854; + } +} + @include breakpoint(medium) { .button.button-telegram, - .ssb-telegram { + .ssb-telegram, + .ssb-whatsapp_app { display: none !important; } } @@ -1718,81 +1716,6 @@ table { .social-share-button { display: inline-block; } - - .ssb-twitter { - background: #45b0e3; - color: #fff; - height: $line-height; - position: relative; - width: $line-height * 2; - - &::before { - content: "f"; - font-family: "icons" !important; - font-size: rem-calc(24); - left: 50%; - line-height: $line-height * 2; - margin-left: rem-calc(-11); - position: absolute; - top: 0; - } - - &:hover, - &:focus { - background: #fff; - color: #40a2d1; - } - } - - .ssb-facebook { - background: #3b5998; - color: #fff; - height: rem-calc(24); - position: relative; - width: rem-calc(48); - - &::before { - content: "A"; - font-family: "icons" !important; - font-size: rem-calc(24); - left: 50%; - line-height: $line-height * 2; - margin-left: rem-calc(-11); - position: absolute; - top: 0; - } - - &:hover, - &:focus { - background: #fff; - color: #354f88; - } - } - - .ssb-telegram { - background: #08c; - color: #fff; - height: $line-height; - position: relative; - width: $line-height * 2; - - &::before { - content: "1"; - font-family: "icons" !important; - font-size: rem-calc(24); - left: 50%; - line-height: $line-height * 2; - margin-left: rem-calc(-11); - position: absolute; - top: 0; - } - - &:hover, - &:focus { - background: #fff; - color: #40a2d1; - } - } } // 13. Pages diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss index d47dda44e..4a3669547 100644 --- a/app/assets/stylesheets/participation.scss +++ b/app/assets/stylesheets/participation.scss @@ -355,18 +355,6 @@ display: inline; } - .whatsapp::before { - background-color: #43d854; - color: #fff; - display: inline-block; - font-size: rem-calc(30); - height: rem-calc(48); - padding-top: rem-calc(9); - text-align: center; - vertical-align: top; - width: rem-calc(48); - } - .debate-info, .proposal-info, .investment-project-info, @@ -1126,12 +1114,10 @@ .share-supported { - .ssb-twitter, - .ssb-facebook { + .social-share-button .ssb-icon { background: none; color: $text; - height: rem-calc(33) !important; - + height: rem-calc(33); &::before { font-size: rem-calc(18); @@ -1238,22 +1224,6 @@ margin-bottom: rem-calc(3); text-decoration: none; } - - .social-share-button a { - color: #fff; - - &.social-share-button-twitter:hover { - color: #40a2d1; - } - - &.social-share-button-facebook:hover { - color: #354f88; - } - - &.social-share-button-telegram:hover { - color: #ce3e26; - } - } } .groups-and-headings { diff --git a/app/views/proposals/share.html.erb b/app/views/proposals/share.html.erb index 9c390107a..0cb387809 100644 --- a/app/views/proposals/share.html.erb +++ b/app/views/proposals/share.html.erb @@ -10,47 +10,45 @@ <% end %> <% cache [locale_and_user_status(@proposal), @proposal, @proposal.author, Flag.flagged?(current_user, @proposal), @proposal_votes] do %> -
- <%= t("proposals.proposal.share.guide") %>
- <%= t("proposals.proposal.share.edit") %>
-
+ <%= t("proposals.proposal.share.guide") %>
+ <%= t("proposals.proposal.share.edit") %>
+
- <%= t("proposals.share.improve_it") %> -
-
- <%= @proposal.title %>
- <%= t("proposals.show.code") %> <%= @proposal.code %>
+ <% if can?(:dashboard, @proposal) %>
+
+ <%= t("proposals.share.improve_it") %>
+
+ <%= @proposal.title %>
+ <%= t("proposals.show.code") %> <%= @proposal.code %>
+