Add optional image_url parameter to social sharing partial.
This commit is contained in:
@@ -120,6 +120,7 @@
|
|||||||
<%= render partial: 'shared/social_share', locals: {
|
<%= render partial: 'shared/social_share', locals: {
|
||||||
share_title: t("budgets.investments.show.share"),
|
share_title: t("budgets.investments.show.share"),
|
||||||
title: investment.title,
|
title: investment.title,
|
||||||
|
image_url: investment.image.exists? ? URI(request.url) + investment.image.url(:thumb) : '',
|
||||||
url: budget_investment_url(budget_id: investment.budget_id, id: investment.id)
|
url: budget_investment_url(budget_id: investment.budget_id, id: investment.id)
|
||||||
} %>
|
} %>
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
<% if local_assigns[:share_title].present? %>
|
<% if local_assigns[:share_title].present? %>
|
||||||
<div id="social-share" class="sidebar-divider"></div>
|
<div id="social-share" class="sidebar-divider"></div>
|
||||||
<p class="sidebar-title"><%= share_title %></p>
|
<p class="sidebar-title"><%= share_title %></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="social-share-full">
|
<div class="social-share-full">
|
||||||
<%= social_share_button_tag("#{title} #{setting['twitter_hashtag']}") %>
|
<%= social_share_button_tag("#{title} #{setting['twitter_hashtag']}",
|
||||||
|
:url => local_assigns[:url],
|
||||||
|
:image => local_assigns[:image_url].present? ? local_assigns[:image_url] : '' ) %>
|
||||||
<a href="whatsapp://send?text=<%= CGI.escape(title) %> <%= url %>"
|
<a href="whatsapp://send?text=<%= CGI.escape(title) %> <%= url %>"
|
||||||
class="show-for-small-only" data-action="share/whatsapp/share">
|
class="show-for-small-only" data-action="share/whatsapp/share">
|
||||||
<span class="icon-whatsapp whatsapp"></span>
|
<span class="icon-whatsapp whatsapp"></span>
|
||||||
|
|||||||
Reference in New Issue
Block a user