add twitter/fb share links to stream shares and share modal on content pages

This commit is contained in:
Andrew Brown 2020-08-28 18:14:31 -07:00
parent 8ef6ee66b8
commit 335397c8bb
2 changed files with 46 additions and 19 deletions

View File

@ -16,6 +16,13 @@
<div class="row">
<div class="col s12 center">
To be shared, content must either be public <strong>or</strong> in a public Universe.
<%= link_to 'https://medium.com/indent-labs/privacy-on-notebook-ai-how-it-works-c23a59faeae2', class: 'blue-text lighten-1', target: '_new' do %>
Learn more about sharing on Notebook.ai.
<% end %>
</div>
<div class="col s12 center grey-text">
Changes are saved automatically and can be changed at any time.
</div>
</div>
@ -69,10 +76,6 @@
</div>
</div>
<% end %>
<div class="col s12 center grey-text">
Changes are saved automatically and can be changed at any time.
</div>
</div>
<% if shared_content.is_a?(Universe) %>
@ -84,12 +87,29 @@
</div>
<% end %>
<div class="row">
<p class="col s12" style='text-align: center'>
<%= link_to 'https://medium.com/indent-labs/privacy-on-notebook-ai-how-it-works-c23a59faeae2', class: 'blue-text lighten-1', target: '_new' do %>
Click here to learn more about sharing pages on Notebook.ai
<% end %>
</p>
<div class="col s12 m6">
<%= link_to [
'http://twitter.com/share?',
'url=' + URI::escape(send("#{shared_content.class.name.downcase}_url", shared_content)),
'&text=' + URI::escape("I'm using Notebook.ai to create fictional worlds! You can see my #{shared_content.class.name.downcase} #{shared_content.name} at this link:")
].join, target: '_new' do %>
<div class="hoverable card-panel white-text" style="background: #1DA1F2">
<i class="left fa fa-twitter" style="font-size: 150%"></i>
Share to Twitter
</div>
<% end %>
</div>
<div class="col s12 m6">
<a
href="https://www.facebook.com/sharer/sharer.php?app_id=1523926344336934&u=<%= URI::escape(send("#{shared_content.class.name.downcase}_url", shared_content)) %>&display=popup&ref=plugin&src=share_button"
onclick="return !window.open(this.href, 'Facebook', 'width=640,height=580')">
<div class="hoverable card-panel white-text" style="background: #4267B2">
<i class="left fa fa-facebook" style="font-size: 150%"></i>
Share to Facebook
</div>
</a>
</div>
<% else %>

View File

@ -66,27 +66,34 @@
</li>
</ul>
</div>
<!--
<div>
<ul class="uppercase">
<li class="grey-text">
Reshare this post to...
<ul class="">
<li class="grey-text uppercase">
Reshare to...
</li>
<li>
<%= link_to '#', class: 'btn-flat blue-text' do %>
<i class="material-icons tiny left">share</i>
<%= link_to [
'http://twitter.com/share?',
'url=' + URI::escape(user_content_page_share_url(user_id: @share.user.id, id: @share.id)),
'&text=' + URI::escape(@share.message)
].join, class: 'blue-text', target: '_blank' do %>
<i class="material-icons tiny left" style="margin-top: 4px;">share</i>
Twitter
<% end %>
</li>
<li>
<%= link_to '#', class: 'btn-flat blue-text' do %>
<i class="material-icons tiny left">share</i>
<%=
link_to "https://www.facebook.com/sharer/sharer.php?app_id=1523926344336934&u=#{URI::escape(user_content_page_share_url(user_id: @share.user.id, id: @share.id))}&display=popup&ref=plugin&src=share_button",
class: 'blue-text',
onclick: "return !window.open(this.href, 'Facebook', 'width=640,height=580')" do
%>
<i class="material-icons tiny left" style="margin-top: 4px">share</i>
Facebook
<% end %>
</li>
</ul>
</div>
-->
</div>
<div class="col s12 m12 l7">
<div class="card">