From acf4446523e3c1e952ed83c27fa1d36b7d659881 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Wed, 8 Aug 2012 03:10:26 +0800 Subject: [PATCH] Add meta to head for fb share --- app/helpers/application_helper.rb | 15 +++++++++++++-- .../front_end/bulletins/show.html.erb | 5 ++--- .../news/front_end/news_bulletins/show.html.erb | 5 +---- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 16b0ff09..8fb55315 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -140,7 +140,7 @@ module ApplicationHelper stylesheets << "\n" stylesheets << "\n" end - stylesheets << "\n" + stylesheets << "\n" stylesheets << "\n" if page.design.reset_css stylesheets << "\n" stylesheets << "\n" if page.design.default_css @@ -162,7 +162,7 @@ module ApplicationHelper end javascripts << "\n" javascripts << "\n" - javascripts << "\n" + javascripts << "\n" javascripts << "\n" page.design.javascripts.each do |js| # javascripts << "" @@ -214,4 +214,15 @@ module ApplicationHelper object.strftime("%Y-%m-%d") end + def share_links(object) + js = '' + js << "\n" rescue '' + js << "\n" rescue '' + js << "\n" rescue '' + content_tag :div, :class => 'fb' do + concat social_share_button_tag + concat javascript_tag "$('head').append('#{j js}');" + end + end + end diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.html.erb index af1ca12c..2671d2e1 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/show.html.erb @@ -36,6 +36,5 @@ <% end %> -
- <%= render "shared/addthis_toolbox"%> -
+ +<%= share_links(@news_bulletin) %> diff --git a/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/show.html.erb b/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/show.html.erb index c6c912c8..38a62828 100644 --- a/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/show.html.erb +++ b/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/show.html.erb @@ -39,7 +39,4 @@ <% end %> -
- <%= social_share_button_tag(@news_bulletin.title) %> - <%#= render "shared/addthis_toolbox"%> -
+<%= share_links(@news_bulletin) %>