diff --git a/Gemfile b/Gemfile index 3146d5bc..3eb4c060 100644 --- a/Gemfile +++ b/Gemfile @@ -39,6 +39,8 @@ gem 'progress_bar' gem 'sinatra' gem 'sprockets' +gem 'social-share-button' + gem 'tinymce-rails' gem 'therubyracer' if RUBY_PLATFORM.downcase.include?("linux") gem 'rb-readline' if RUBY_PLATFORM.downcase.include?("linux") diff --git a/Gemfile.lock b/Gemfile.lock index 31bdf08a..96f07221 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -250,6 +250,7 @@ GEM rack (~> 1.3, >= 1.3.6) rack-protection (~> 1.2) tilt (~> 1.3, >= 1.3.3) + social-share-button (0.0.6) spork (0.9.0) spork (0.9.0-x86-mingw32) win32-process @@ -343,6 +344,7 @@ DEPENDENCIES shoulda-matchers simplecov sinatra + social-share-button spork sprockets sunspot-rails-tester diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 13d92690..f3c799cf 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -6,4 +6,5 @@ // //= require jquery //= require jquery_ujs -//= require_tree . \ No newline at end of file +//= require_tree . +//= social-share-button \ No newline at end of file diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 9833ffda..c0c227fe 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -3,5 +3,5 @@ *and any sub-directories. You're free to add application-wide styles to this file and they'll appear at *the top of the compiled file, but it's generally better to create a new file per style scope. *= require_self - + *= require social-share-button */ diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0c6229b3..16b0ff09 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -140,6 +140,7 @@ module ApplicationHelper stylesheets << "\n" stylesheets << "\n" end + stylesheets << "\n" stylesheets << "\n" if page.design.reset_css stylesheets << "\n" stylesheets << "\n" if page.design.default_css @@ -161,6 +162,7 @@ module ApplicationHelper end javascripts << "\n" javascripts << "\n" + javascripts << "\n" javascripts << "\n" page.design.javascripts.each do |js| # javascripts << "" diff --git a/config/initializers/social_share_button.rb b/config/initializers/social_share_button.rb new file mode 100644 index 00000000..8b933577 --- /dev/null +++ b/config/initializers/social_share_button.rb @@ -0,0 +1,3 @@ +SocialShareButton.configure do |config| + config.allow_sites = %w(twitter facebook google_plus) +end \ No newline at end of file diff --git a/config/locales/social_share_button.en.yml b/config/locales/social_share_button.en.yml new file mode 100644 index 00000000..7e3f1fb0 --- /dev/null +++ b/config/locales/social_share_button.en.yml @@ -0,0 +1,14 @@ +en: + social_share_button: + share_to: Share to %{name} + weibo: Sina Weibo + twitter: Twitter + facebook: Facebook + douban: Douban + qq: Qzone + tqq: Tqq + delicious: Delicious + baidu: Baidu.com + kaixin001: Kaixin001.com + renren: Renren.com + google_plus: Google+ diff --git a/config/locales/social_share_button.zh-tw.yml b/config/locales/social_share_button.zh-tw.yml new file mode 100644 index 00000000..b0321eb5 --- /dev/null +++ b/config/locales/social_share_button.zh-tw.yml @@ -0,0 +1,14 @@ +zh_tw: + social_share_button: + share_to: 分享到%{name} + weibo: 新浪微博 + twitter: Twitter + facebook: Facebook + douban: 豆瓣 + qq: QQ空間 + tqq: 腾讯微博 + delicious: Delicious + baidu: 百度收藏 + kaixin001: 開心網 + renren: 人人網 + google_plus: Google+ 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 edd8a9e1..c6c912c8 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 @@ -40,5 +40,6 @@
- <%= render "shared/addthis_toolbox"%> + <%= social_share_button_tag(@news_bulletin.title) %> + <%#= render "shared/addthis_toolbox"%>