From 7385abf90da99975b216ba6e7196dde2504c2986 Mon Sep 17 00:00:00 2001 From: gauravano Date: Sun, 22 Oct 2017 00:15:16 +0530 Subject: [PATCH 1/4] Facebook share button working --- .idea/.generators | 8 + .idea/.rakeTasks | 7 + .idea/misc.xml | 4 + .idea/modules.xml | 8 + .idea/playtime.iml | 244 +++++ .idea/vcs.xml | 6 + .idea/workspace.xml | 1033 ++++++++++++++++++++ app/views/wishlists/new.html.erb | 2 +- app/views/wishlists/show.html.erb | 2 +- config/initializers/social_share_button.rb | 2 +- 10 files changed, 1313 insertions(+), 3 deletions(-) create mode 100644 .idea/.generators create mode 100644 .idea/.rakeTasks create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/playtime.iml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/.generators b/.idea/.generators new file mode 100644 index 0000000..1618976 --- /dev/null +++ b/.idea/.generators @@ -0,0 +1,8 @@ + + diff --git a/.idea/.rakeTasks b/.idea/.rakeTasks new file mode 100644 index 0000000..c6865d9 --- /dev/null +++ b/.idea/.rakeTasks @@ -0,0 +1,7 @@ + + diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..157739d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..f823bd0 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/playtime.iml b/.idea/playtime.iml new file mode 100644 index 0000000..7e96bcf --- /dev/null +++ b/.idea/playtime.iml @@ -0,0 +1,244 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..1d4d521 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,1033 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + project + + + + + + + + + + + + + + + + project + + + true + + + + DIRECTORY + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1508279695617 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/views/wishlists/new.html.erb b/app/views/wishlists/new.html.erb index 5475c3a..70f3822 100644 --- a/app/views/wishlists/new.html.erb +++ b/app/views/wishlists/new.html.erb @@ -1,6 +1,6 @@
-

Create a New Wishlist

+

Create a New Wishlist

<%= render 'form', wishlist: @wishlist %> diff --git a/app/views/wishlists/show.html.erb b/app/views/wishlists/show.html.erb index f9dc7fc..6697eac 100644 --- a/app/views/wishlists/show.html.erb +++ b/app/views/wishlists/show.html.erb @@ -1,7 +1,7 @@

<%= @wishlist.name %> - <%= social_share_button_tag("Are you a hero of play? #{@wishlist.name} needs your help!") %> + <%= social_share_button_tag("Are you a hero of play? #{@wishlist.name} needs your help!",:url => "https://project-playtime-staging.herokuapp.com/wishlists/#{@wishlist.id}",desc: "Are you a hero of play? #{@wishlist.name} needs your help!") %>

<% if current_user.can_manage?(@wishlist) %> diff --git a/config/initializers/social_share_button.rb b/config/initializers/social_share_button.rb index 79978d2..c2ffa7c 100644 --- a/config/initializers/social_share_button.rb +++ b/config/initializers/social_share_button.rb @@ -1,3 +1,3 @@ SocialShareButton.configure do |config| - config.allow_sites = %w(twitter email) + config.allow_sites = %w(facebook twitter email) end From 9f7652397b939b3d0da60e27c88237f223d4475c Mon Sep 17 00:00:00 2001 From: gauravano Date: Sun, 22 Oct 2017 13:39:58 +0530 Subject: [PATCH 2/4] URL updation according to Environment --- .gitignore | 1 + .idea/workspace.xml | 394 +++++++++++++++++++++++------- Gemfile | 2 +- Gemfile.lock | 2 +- app/views/wishlists/show.html.erb | 9 +- 5 files changed, 318 insertions(+), 90 deletions(-) diff --git a/.gitignore b/.gitignore index c74c95e..b782803 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ *.swp .env +.idea/ diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 1d4d521..a7bb039 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,11 @@ - + + + + - @@ -34,8 +36,68 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -51,11 +113,11 @@ - + - - + + @@ -69,12 +131,13 @@ @@ -106,7 +169,6 @@ - @@ -120,6 +182,66 @@ + @@ -594,18 +825,19 @@ - + + - - + @@ -624,30 +856,13 @@ - - - - - - - - - - - - - - - - - - - - + + @@ -656,27 +871,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -852,13 +1046,6 @@ - - - - - - - @@ -873,13 +1060,6 @@ - - - - - - - @@ -937,14 +1117,6 @@ - - - - - - - - @@ -997,14 +1169,6 @@ - - - - - - - - @@ -1021,10 +1185,66 @@ + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Gemfile b/Gemfile index 8356444..897118b 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -ruby '2.4.1' +ruby '2.3.3' git_source(:github) do |repo_name| repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") diff --git a/Gemfile.lock b/Gemfile.lock index e13a405..118815c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -305,7 +305,7 @@ DEPENDENCIES webmock (~> 3.0) RUBY VERSION - ruby 2.4.1p111 + ruby 2.3.3p222 BUNDLED WITH 1.15.4 diff --git a/app/views/wishlists/show.html.erb b/app/views/wishlists/show.html.erb index 6697eac..df1d497 100644 --- a/app/views/wishlists/show.html.erb +++ b/app/views/wishlists/show.html.erb @@ -1,7 +1,14 @@

<%= @wishlist.name %> - <%= social_share_button_tag("Are you a hero of play? #{@wishlist.name} needs your help!",:url => "https://project-playtime-staging.herokuapp.com/wishlists/#{@wishlist.id}",desc: "Are you a hero of play? #{@wishlist.name} needs your help!") %> + + <% if Rails.env.production? %> + <% url_share = "https://project-playtime-staging.herokuapp.com/wishlists/#{@wishlist.id}" %> + <% else %> + <% url_share = "https://project-playtime-staging.herokuapp.com/wishlists/#{@wishlist.id}" %> + <% end %> + + <%= social_share_button_tag("Are you a hero of play? #{@wishlist.name} needs your help!",:url => url_share,desc: "Are you a hero of play? #{@wishlist.name} needs your help!") %>

<% if current_user.can_manage?(@wishlist) %> From 9dbe111b6840b0482d59867863c541bdd42c1928 Mon Sep 17 00:00:00 2001 From: gauravano Date: Sun, 22 Oct 2017 13:46:08 +0530 Subject: [PATCH 3/4] URL and gitignore update --- .gitignore | 2 +- .idea/.generators | 8 - .idea/.rakeTasks | 7 - .idea/misc.xml | 4 - .idea/modules.xml | 8 - .idea/playtime.iml | 244 --------- .idea/vcs.xml | 6 - .idea/workspace.xml | 1253 ------------------------------------------- Gemfile | 2 +- 9 files changed, 2 insertions(+), 1532 deletions(-) delete mode 100644 .idea/.generators delete mode 100644 .idea/.rakeTasks delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/playtime.iml delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml diff --git a/.gitignore b/.gitignore index b782803..7280ca4 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,4 @@ *.swp .env -.idea/ +.idea/* diff --git a/.idea/.generators b/.idea/.generators deleted file mode 100644 index 1618976..0000000 --- a/.idea/.generators +++ /dev/null @@ -1,8 +0,0 @@ - - diff --git a/.idea/.rakeTasks b/.idea/.rakeTasks deleted file mode 100644 index c6865d9..0000000 --- a/.idea/.rakeTasks +++ /dev/null @@ -1,7 +0,0 @@ - - diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 157739d..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index f823bd0..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/playtime.iml b/.idea/playtime.iml deleted file mode 100644 index 7e96bcf..0000000 --- a/.idea/playtime.iml +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index a7bb039..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,1253 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - DEFINITION_ORDER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - project - - - - - - - - - - - - - - - - project - - - true - - - - DIRECTORY - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1508279695617 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Gemfile b/Gemfile index 897118b..8356444 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -ruby '2.3.3' +ruby '2.4.1' git_source(:github) do |repo_name| repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") From 2f36c5316b400efcfc5df820fe8b911b71189ebd Mon Sep 17 00:00:00 2001 From: gauravano Date: Wed, 25 Oct 2017 00:41:10 +0530 Subject: [PATCH 4/4] general link using helper --- Gemfile.lock | 2 +- app/helpers/application_helper.rb | 4 ++++ app/views/wishlists/show.html.erb | 11 +++-------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 118815c..e13a405 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -305,7 +305,7 @@ DEPENDENCIES webmock (~> 3.0) RUBY VERSION - ruby 2.3.3p222 + ruby 2.4.1p111 BUNDLED WITH 1.15.4 diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index aa69dc7..4f0f745 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -11,6 +11,10 @@ def display_date(date) date.to_formatted_s(:long_ordinal) end + def wishlist_url(wishlist) + request.base_url+"/wishlists/#{wishlist.id}" + end + private def current_user_pronouns(user, perspectives, capitalize: true) diff --git a/app/views/wishlists/show.html.erb b/app/views/wishlists/show.html.erb index df1d497..11916ce 100644 --- a/app/views/wishlists/show.html.erb +++ b/app/views/wishlists/show.html.erb @@ -1,14 +1,9 @@

<%= @wishlist.name %> - - <% if Rails.env.production? %> - <% url_share = "https://project-playtime-staging.herokuapp.com/wishlists/#{@wishlist.id}" %> - <% else %> - <% url_share = "https://project-playtime-staging.herokuapp.com/wishlists/#{@wishlist.id}" %> - <% end %> - - <%= social_share_button_tag("Are you a hero of play? #{@wishlist.name} needs your help!",:url => url_share,desc: "Are you a hero of play? #{@wishlist.name} needs your help!") %> + <%= social_share_button_tag("Are you a hero of play? #{@wishlist.name} needs your help!", + url: wishlist_url(@wishlist), + desc: "Are you a hero of play? #{@wishlist.name} needs your help!") %>

<% if current_user.can_manage?(@wishlist) %>