Try fb from override and generated page

This commit is contained in:
Christophe Vilayphiou committed 2012-08-08 05:40:50 +08:00
1 parent 3cb182ff8e
commit fc560f4205
6 files changed
+79 -3

No files matched your search

@@ -3,3 +3,24 @@ Integer.class_eval do
!self.zero?
end
end
module SocialShareButton
module Helper
def social_share_button_tag(title = "", opts = {})
rel = opts[:rel]
html = []
html << "<div class='social-share-button' data-title='#{title}' data-img='#{opts[:image]}' data-fb_url='#{opts[:fb_url]}'>"
SocialShareButton.config.allow_sites.each do |name|
link_title = t "social_share_button.share_to", :name => t("social_share_button.#{name.downcase}")
html << link_to("","#", :rel => "nofollow #{rel}",
"data-site" => name,
:class => "social-share-button-#{name}",
:onclick => "return SocialShareButton.share(this);",
:title => h(link_title))
end
html << "</div>"
raw html.join("\n")
end
end
end
+2
View File
@@ -140,6 +140,8 @@ Orbit::Application.routes.draw do
match '/panel/:app_name/front_end/:app_action' => 'pages#index_from_link', :constraints => lambda { |request|
!request.query_string.include?("inner=true")
}
match '/share/:model/:id' => 'application#render_share'
# routes for gridfs files
match "/gridfs/*path" => "gridfs#serve"