From 34c8dd0b8af20d3ba3b894790d43828e2e6e0794 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Tue, 22 Sep 2015 16:04:14 +0200 Subject: [PATCH] Adds social share for supported proposals --- app/assets/stylesheets/participacion.scss | 31 +++++++++++++++++++++++ app/views/proposals/_votes.html.erb | 10 ++++++-- config/locales/en.yml | 2 +- config/locales/es.yml | 2 +- 4 files changed, 41 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/participacion.scss b/app/assets/stylesheets/participacion.scss index 6946ea478..edcad4875 100644 --- a/app/assets/stylesheets/participacion.scss +++ b/app/assets/stylesheets/participacion.scss @@ -1393,6 +1393,37 @@ table { } } +.share-supported { + + .social-share-button { + display: inline-block; + } + + .social-share-button-twitter { + @extend .social-share-button-twitter; + background: none; + color: white; + height: rem-calc(24); + width: rem-calc(48); + } + + .social-share-button-facebook { + @extend .social-share-button-facebook; + background: none; + color: white; + height: rem-calc(24); + width: rem-calc(48); + } + + .social-share-button-google_plus { + @extend .social-share-button-google_plus; + background: none; + color: white; + height: rem-calc(24); + width: rem-calc(48); + } +} + // 16. Pages // - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/views/proposals/_votes.html.erb b/app/views/proposals/_votes.html.erb index 9443e548b..0689e43b8 100644 --- a/app/views/proposals/_votes.html.erb +++ b/app/views/proposals/_votes.html.erb @@ -19,8 +19,8 @@
<% if voted_for?(@proposal_votes, proposal) %>
- <%= t("proposals.proposal.already_supported") %> -
+ <%= t("proposals.proposal.already_supported") %> +
<% else %> <%= link_to vote_proposal_path(proposal, value: 'yes'), class: "button button-support tiny radius expand", @@ -50,4 +50,10 @@ signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %> <% end %> + + <% if voted_for?(@proposal_votes, proposal) %> +
+ <%= social_share_button_tag(proposal.title) %> +
+ <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index e42ab14c0..95a40fa0d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -179,7 +179,7 @@ en: supports_necessary: "53.726 necessary supports" census_percent: "2% of census" total_percent: "100%" - already_supported: "You already supported this proposal!" + already_supported: "You already supported this proposal, share it!" form: proposal_title: Proposal title proposal_question: Proposal question diff --git a/config/locales/es.yml b/config/locales/es.yml index 961f29969..c196d080c 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -179,7 +179,7 @@ es: supports_necessary: "53.726 apoyos necesarios" census_percent: "2% del Censo" total_percent: "100%" - already_supported: "¡Ya has apoyado esta propuesta!" + already_supported: "¡Ya has apoyado esta propuesta, compártela!" form: proposal_title: Título de la propuesta proposal_question: Pregunta de la propuesta