Merge pull request #1802 from consul/share-whatsapp

Share button WhatsApp
This commit is contained in:
BertoCQ
2017-08-17 23:10:13 +02:00
committed by GitHub
6 changed files with 13 additions and 18 deletions

View File

@@ -311,7 +311,8 @@
.polls-show,
.debate-quiz,
.budget-investment-show,
.draft-panels {
.draft-panels,
.debate-questions {
p {
word-wrap: break-word;
@@ -328,10 +329,13 @@
.whatsapp::before {
background-color: #43d854;
color: #fff;
font-size: 1.7em;
margin-left: rem-calc(0.5);
padding: rem-calc(9.5) rem-calc(9.8);
vertical-align: rem-calc(10);
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);
}
.edit-debate,

View File

@@ -18,7 +18,7 @@
<aside class="small-12 medium-3 column">
<div class="sidebar-divider"></div>
<h2><%= t('legislation.shared.share') %></h2>
<%= render '/legislation/shared/share_buttons',
<%= render '/shared/social_share',
title: t('legislation.shared.share_comment', version_name: @draft_version.title.downcase, process_name: @process.title),
url: legislation_process_draft_version_path(process, draft_version)
%>

View File

@@ -33,7 +33,7 @@
<aside class="small-12 medium-3 column">
<div class="sidebar-divider"></div>
<h2><%= t('legislation.shared.share') %></h2>
<%= render '/legislation/shared/share_buttons',
<%= render '/shared/social_share',
title: t('legislation.shared.share_comment', version_name: @draft_version.title.downcase, process_name: @process.title),
url: legislation_process_draft_version_annotations_path(@process, @draft_version)
%>

View File

@@ -38,7 +38,7 @@
<aside class="small-12 medium-3 column">
<div id="social-share" class="sidebar-divider"></div>
<h3><%= t('.share') %></h3>
<%= render '/legislation/shared/share_buttons', title: @question.title, url: legislation_process_question_url(@question.process, @question) %>
<%= render '/shared/social_share', title: @question.title, url: legislation_process_question_url(@question.process, @question) %>
</aside>
</div>

View File

@@ -1,9 +0,0 @@
<div class="social-share-full">
<%= social_share_button_tag("#{title} #{setting['twitter_hashtag']}") %>
<% if browser.device.mobile? %>
<a href="whatsapp://send?text=<%= title %> <%= url %>" data-action="share/whatsapp/share">
<span class="icon-whatsapp whatsapp"></span>
<span class="show-for-sr"><%= t("social.whatsapp") %></span>
</a>
<% end %>
</div>

View File

@@ -4,7 +4,7 @@
<% end %>
<div class="social-share-full">
<%= social_share_button_tag("#{title} #{setting['twitter_hashtag']}") %>
<a href="whatsapp://send?text=<%= title.gsub(/\s/, '%20') %>&nbsp;<%= url %>"
<a href="whatsapp://send?text=<%= CGI.escape(title) %>&nbsp;<%= url %>"
class="show-for-small-only" data-action="share/whatsapp/share">
<span class="icon-whatsapp whatsapp"></span>
<span class="show-for-sr"><%= t("social.whatsapp") %></span>