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 "recaptcha", require: "recaptcha/rails"
|
||||||
gem 'ckeditor'
|
gem 'ckeditor'
|
||||||
gem 'cancancan'
|
gem 'cancancan'
|
||||||
|
gem 'social-share-button'
|
||||||
|
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
|
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
|
||||||
|
|||||||
@@ -241,6 +241,9 @@ GEM
|
|||||||
json (~> 1.8)
|
json (~> 1.8)
|
||||||
simplecov-html (~> 0.10.0)
|
simplecov-html (~> 0.10.0)
|
||||||
simplecov-html (0.10.0)
|
simplecov-html (0.10.0)
|
||||||
|
social-share-button (0.1.8)
|
||||||
|
coffee-rails
|
||||||
|
sass-rails
|
||||||
spring (1.3.6)
|
spring (1.3.6)
|
||||||
sprockets (3.2.0)
|
sprockets (3.2.0)
|
||||||
rack (~> 1.0)
|
rack (~> 1.0)
|
||||||
@@ -318,6 +321,7 @@ DEPENDENCIES
|
|||||||
responders
|
responders
|
||||||
rspec-rails (~> 3.0)
|
rspec-rails (~> 3.0)
|
||||||
sass-rails (~> 5.0)
|
sass-rails (~> 5.0)
|
||||||
|
social-share-button
|
||||||
spring
|
spring
|
||||||
turbolinks
|
turbolinks
|
||||||
uglifier (>= 1.3.0)
|
uglifier (>= 1.3.0)
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
//= require foundation
|
//= require foundation
|
||||||
//= require turbolinks
|
//= require turbolinks
|
||||||
//= require ckeditor/init
|
//= require ckeditor/init
|
||||||
|
//= require social-share-button
|
||||||
//= require app
|
//= require app
|
||||||
//= require_tree .
|
//= require_tree .
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
|
/*
|
||||||
|
*= require social-share-button
|
||||||
|
*/
|
||||||
|
|
||||||
@import "foundation_and_overrides";
|
@import "foundation_and_overrides";
|
||||||
@import "fonts";
|
@import "fonts";
|
||||||
@import "icons";
|
@import "icons";
|
||||||
@import "variables";
|
@import "variables";
|
||||||
@import "participacion";
|
@import "participacion";
|
||||||
@import "debates";
|
@import "debates";
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
<h1><%= @debate.title %></h1>
|
<h1><%= @debate.title %></h1>
|
||||||
<%= @debate.description %>
|
<%= @debate.description %>
|
||||||
<p><%= render 'shared/tags', debate: @debate %></p>
|
<p><%= render 'shared/tags', debate: @debate %></p>
|
||||||
|
<p><%= social_share_button_tag(@debate.title) %></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="<%= dom_id(@debate) %>_votes" class="small-12 medium-3 column">
|
<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 description"
|
||||||
expect(page).to have_content debate.author.name
|
expect(page).to have_content debate.author.name
|
||||||
expect(page).to have_content I18n.l(Date.today)
|
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
|
end
|
||||||
|
|
||||||
scenario 'Create' do
|
scenario 'Create' do
|
||||||
|
|||||||
Reference in New Issue
Block a user