From 335397c8bbaa883a0fed82baf4e2c1bbfbaec586 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 28 Aug 2020 18:14:31 -0700 Subject: [PATCH] add twitter/fb share links to stream shares and share modal on content pages --- app/views/content/_share.html.erb | 40 +++++++++++++++------ app/views/content_page_shares/show.html.erb | 25 ++++++++----- 2 files changed, 46 insertions(+), 19 deletions(-) diff --git a/app/views/content/_share.html.erb b/app/views/content/_share.html.erb index 51276c63..8d835096 100644 --- a/app/views/content/_share.html.erb +++ b/app/views/content/_share.html.erb @@ -16,6 +16,13 @@
To be shared, content must either be public or 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 %> +
+
+ Changes are saved automatically and can be changed at any time.
@@ -69,10 +76,6 @@ <% end %> - -
- Changes are saved automatically and can be changed at any time. -
<% if shared_content.is_a?(Universe) %> @@ -84,12 +87,29 @@ <% end %> -
-

- <%= 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 %> -

+ +
+ <%= 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 %> +
+ + Share to Twitter +
+ <% end %> +
+ <% else %> diff --git a/app/views/content_page_shares/show.html.erb b/app/views/content_page_shares/show.html.erb index 534cb2c2..e8bac02a 100644 --- a/app/views/content_page_shares/show.html.erb +++ b/app/views/content_page_shares/show.html.erb @@ -66,27 +66,34 @@
-