From 781a49750efffbf69a918792b9fd447c98d4bf20 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Mon, 24 Feb 2014 14:59:12 +0800 Subject: [PATCH] facebook toggle added in the gem. can now set facebook sharing enabled or disabled using facebook_enabled true/false --- .../panel/announcement/front_end/bulletins_controller.rb | 1 + .../panel/announcement/front_end/bulletins/show.html.erb | 8 +++++--- lib/announcement.rb | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/controllers/panel/announcement/front_end/bulletins_controller.rb b/app/controllers/panel/announcement/front_end/bulletins_controller.rb index d2fee70..dfa0e86 100644 --- a/app/controllers/panel/announcement/front_end/bulletins_controller.rb +++ b/app/controllers/panel/announcement/front_end/bulletins_controller.rb @@ -55,6 +55,7 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController def show @item = Page.find(params[:page_id]) rescue nil + @fb_share = eval(params[:facebook_share]) rescue false if params[:preview] == "true" preview_content else diff --git a/app/views/panel/announcement/front_end/bulletins/show.html.erb b/app/views/panel/announcement/front_end/bulletins/show.html.erb index 9c4a4d9..292428d 100644 --- a/app/views/panel/announcement/front_end/bulletins/show.html.erb +++ b/app/views/panel/announcement/front_end/bulletins/show.html.erb @@ -39,9 +39,11 @@ <%= share_links(@bulletin, 'announcement') %> - - <%= image_tag("announcement/fbn.png",:width=>30, :height=>30) %> - +<% if @fb_share %> + + <%= image_tag("announcement/fbn.png",:width=>30, :height=>30) %> + +<% end %>