Merge pull request #127 from Ferdy89/compartir-en-redes-sociales
Adds sharing buttons
This commit is contained in:
1
Gemfile
1
Gemfile
@@ -29,6 +29,7 @@ gem 'acts_as_votable'
|
||||
gem "recaptcha", require: "recaptcha/rails"
|
||||
gem 'ckeditor'
|
||||
gem 'cancancan'
|
||||
gem 'social-share-button'
|
||||
|
||||
group :development, :test do
|
||||
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
|
||||
|
||||
@@ -241,6 +241,9 @@ GEM
|
||||
json (~> 1.8)
|
||||
simplecov-html (~> 0.10.0)
|
||||
simplecov-html (0.10.0)
|
||||
social-share-button (0.1.8)
|
||||
coffee-rails
|
||||
sass-rails
|
||||
spring (1.3.6)
|
||||
sprockets (3.2.0)
|
||||
rack (~> 1.0)
|
||||
@@ -318,6 +321,7 @@ DEPENDENCIES
|
||||
responders
|
||||
rspec-rails (~> 3.0)
|
||||
sass-rails (~> 5.0)
|
||||
social-share-button
|
||||
spring
|
||||
turbolinks
|
||||
uglifier (>= 1.3.0)
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
//= require foundation
|
||||
//= require turbolinks
|
||||
//= require ckeditor/init
|
||||
//= require social-share-button
|
||||
//= require app
|
||||
//= require_tree .
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
/*
|
||||
*= require social-share-button
|
||||
*/
|
||||
|
||||
@import "foundation_and_overrides";
|
||||
@import "fonts";
|
||||
@import "icons";
|
||||
@import "variables";
|
||||
@import "participacion";
|
||||
@import "debates";
|
||||
@import "debates";
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<h1><%= @debate.title %></h1>
|
||||
<%= @debate.description %>
|
||||
<p><%= render 'shared/tags', debate: @debate %></p>
|
||||
<p><%= social_share_button_tag(@debate.title) %></p>
|
||||
</div>
|
||||
|
||||
<div id="<%= dom_id(@debate) %>_votes" class="small-12 medium-3 column">
|
||||
|
||||
3
config/initializers/social_share_button.rb
Normal file
3
config/initializers/social_share_button.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
SocialShareButton.configure do |config|
|
||||
config.allow_sites = %w(twitter facebook google_plus)
|
||||
end
|
||||
19
config/locales/social_share_button.en.yml
Normal file
19
config/locales/social_share_button.en.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
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+
|
||||
google_bookmark: Google Bookmark
|
||||
tumblr: Tumblr
|
||||
plurk: Plurk
|
||||
pinterest: Pinterest
|
||||
email: Email
|
||||
19
config/locales/social_share_button.es.yml
Normal file
19
config/locales/social_share_button.es.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
es:
|
||||
social_share_button:
|
||||
share_to: Compartir en %{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+
|
||||
google_bookmark: Google Bookmark
|
||||
tumblr: Tumblr
|
||||
plurk: Plurk
|
||||
pinterest: Pinterest
|
||||
email: Correo electrónico
|
||||
@@ -34,6 +34,10 @@ feature 'Debates' do
|
||||
expect(page).to have_content "Debate description"
|
||||
expect(page).to have_content debate.author.name
|
||||
expect(page).to have_content I18n.l(Date.today)
|
||||
|
||||
within('.social-share-button') do
|
||||
expect(page.all('a').count).to be(3) # Twitter, Facebook, Google+
|
||||
end
|
||||
end
|
||||
|
||||
scenario 'Create' do
|
||||
|
||||
Reference in New Issue
Block a user