diff --git a/Gemfile b/Gemfile
index 831b62813..f9c2f54e5 100644
--- a/Gemfile
+++ b/Gemfile
@@ -41,7 +41,7 @@ gem 'acts_as_votable'
gem 'ckeditor', '~> 4.2.2'
gem 'invisible_captcha', '~> 0.9.2'
gem 'cancancan', '~> 1.16.0'
-gem 'social-share-button'
+gem 'social-share-button', '~> 0.10'
gem 'initialjs-rails', '0.2.0.4'
gem 'unicorn', '~> 5.2.0'
gem 'paranoia', '~> 2.2.1'
diff --git a/Gemfile.lock b/Gemfile.lock
index c9d097a15..6c117ea77 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -520,7 +520,7 @@ DEPENDENCIES
sass-rails (~> 5.0, >= 5.0.4)
savon
sitemap_generator (~> 5.3.1)
- social-share-button
+ social-share-button (~> 0.10)
spring
spring-commands-rspec
sprockets (~> 3.7.1)
diff --git a/app/assets/fonts/icons.eot b/app/assets/fonts/icons.eot
index c3c5d6289..60cfbaddb 100644
Binary files a/app/assets/fonts/icons.eot and b/app/assets/fonts/icons.eot differ
diff --git a/app/assets/fonts/icons.svg b/app/assets/fonts/icons.svg
index a548d9575..f45adea5a 100644
--- a/app/assets/fonts/icons.svg
+++ b/app/assets/fonts/icons.svg
@@ -56,6 +56,9 @@
-
+
+
+
+
diff --git a/app/assets/fonts/icons.ttf b/app/assets/fonts/icons.ttf
index 6f938f863..8f791759e 100644
Binary files a/app/assets/fonts/icons.ttf and b/app/assets/fonts/icons.ttf differ
diff --git a/app/assets/fonts/icons.woff b/app/assets/fonts/icons.woff
index f3c31e804..0eef00837 100644
Binary files a/app/assets/fonts/icons.woff and b/app/assets/fonts/icons.woff differ
diff --git a/app/assets/stylesheets/icons.scss b/app/assets/stylesheets/icons.scss
index f3d8c003e..c02835881 100644
--- a/app/assets/stylesheets/icons.scss
+++ b/app/assets/stylesheets/icons.scss
@@ -184,3 +184,6 @@
.icon-checkmark-circle:before {
content: "\59";
}
+.icon-telegram:before {
+ content: "\31";
+}
diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss
index e4741f4d6..45a131763 100644
--- a/app/assets/stylesheets/layout.scss
+++ b/app/assets/stylesheets/layout.scss
@@ -1167,7 +1167,8 @@ table {
.button.button-twitter,
.button.button-facebook,
-.button.button-google {
+.button.button-google,
+.button.button-telegram {
background: white;
color: $text;
font-weight: bold;
@@ -1303,6 +1304,48 @@ table {
}
}
+.button.button-telegram {
+ background: #ECF7FC;
+ border-left: 3px solid #0088cc;
+
+ &:before {
+ color: #0088cc;
+ content: "1";
+ font-family: "icons" !important;
+ font-size: rem-calc(24);
+ left: 0;
+ line-height: $line-height*2;
+ padding: 0 rem-calc(20);
+ position: absolute;
+ top: 0;
+ }
+}
+
+.ssb-telegram {
+ background: #0088cc;
+ background-image: none !important;
+ color: white;
+ height: $line-height*2 !important;
+ position: relative;
+ width: $line-height*2 !important;
+
+ &:before {
+ content: "1";
+ font-family: "icons" !important;
+ font-size: rem-calc(24);
+ left: 50%;
+ line-height: $line-height*2;
+ margin-left: rem-calc(-11);
+ position: absolute;
+ top: 0;
+ }
+
+ &:hover, &:focus {
+ background: white;
+ color: #40A2D1;
+ }
+}
+
.social {
a {
@@ -1394,6 +1437,30 @@ table {
color: #CE3E26;
}
}
+
+ .ssb-telegram {
+ background: #0088cc;
+ color: white;
+ height: $line-height;
+ position: relative;
+ width: $line-height*2;
+
+ &:before {
+ content: "A";
+ font-family: "icons" !important;
+ font-size: rem-calc(24);
+ left: 50%;
+ line-height: $line-height*2;
+ margin-left: rem-calc(-11);
+ position: absolute;
+ top: 0;
+ }
+
+ &:hover, &:focus {
+ background: white;
+ color: #40A2D1;
+ }
+ }
}
// 13. Pages
diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss
index 235b58291..feca7f0a8 100644
--- a/app/assets/stylesheets/participation.scss
+++ b/app/assets/stylesheets/participation.scss
@@ -974,6 +974,10 @@
&.social-share-button-google_plus:hover {
color: #CE3E26;
}
+
+ &.social-share-button-telegram:hover {
+ color: #CE3E26;
+ }
}
}
diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb
index ba5de2658..4b5e90523 100644
--- a/app/views/layouts/_footer.html.erb
+++ b/app/views/layouts/_footer.html.erb
@@ -84,6 +84,14 @@
<% end %>
<% end %>
+ <% if setting['telegram_handle'] %>
+
+ <%= link_to "https://www.telegram.me/#{setting['telegram_handle']}", target: "_blank", title: t("social.telegram") + t('shared.target_blank_html') do %>
+ <%= t("social.telegram") %>
+
+ <% end %>
+
+ <% end %>
diff --git a/config/initializers/social_share_button.rb b/config/initializers/social_share_button.rb
index d8b6e5254..6ee0fa0ed 100644
--- a/config/initializers/social_share_button.rb
+++ b/config/initializers/social_share_button.rb
@@ -1,3 +1,3 @@
SocialShareButton.configure do |config|
- config.allow_sites = %w(twitter facebook google_plus)
+ config.allow_sites = %w(twitter facebook google_plus telegram)
end
diff --git a/config/locales/en.yml b/config/locales/en.yml
index a2d64835d..7c0948ac7 100755
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -474,6 +474,7 @@ en:
twitter: Twitter
youtube: YouTube
whatsapp: WhatsApp
+ telegram: Telegram
spending_proposals:
form:
association_name_label: 'If you propose in name of an assocation or collective add the name here'
diff --git a/config/locales/es.yml b/config/locales/es.yml
index 3160ed7c5..1c751b518 100755
--- a/config/locales/es.yml
+++ b/config/locales/es.yml
@@ -474,6 +474,7 @@ es:
twitter: Twitter
youtube: YouTube
whatsapp: WhatsApp
+ telegram: Telegram
spending_proposals:
form:
association_name_label: 'Si propones en nombre de una asociación o colectivo añade el nombre aquí'
diff --git a/config/locales/fr.yml b/config/locales/fr.yml
index 565cd5609..74a65a916 100644
--- a/config/locales/fr.yml
+++ b/config/locales/fr.yml
@@ -1395,6 +1395,8 @@ fr:
facebook: Facebook
twitter: Twitter
youtube: YouTube
+ whatsapp: WhatsApp
+ telegram: Telegram
social_share_button:
baidu: Baidu.com
delicious: Delicious
@@ -1413,6 +1415,7 @@ fr:
tumblr: Tumblr
twitter: Twitter
weibo: Sina Weibo
+ telegram: Telegram
spending_proposals:
form:
description: Description
diff --git a/config/locales/social_share_button.en.yml b/config/locales/social_share_button.en.yml
index 84ee6baba..2715c46ab 100644
--- a/config/locales/social_share_button.en.yml
+++ b/config/locales/social_share_button.en.yml
@@ -16,4 +16,5 @@ en:
tumblr: "Tumblr"
plurk: "Plurk"
pinterest: "Pinterest"
- email: "Email"
\ No newline at end of file
+ email: "Email"
+ telegram: "Telegram"
diff --git a/config/locales/social_share_button.es.yml b/config/locales/social_share_button.es.yml
index aa0c3f224..1c49ef4f5 100644
--- a/config/locales/social_share_button.es.yml
+++ b/config/locales/social_share_button.es.yml
@@ -16,4 +16,5 @@ es:
tumblr: "Tumblr"
plurk: "Plurk"
pinterest: "Pinterest"
- email: "Correo electrónico"
\ No newline at end of file
+ email: "Correo electrónico"
+ telegram: "Telegram"
diff --git a/db/seeds.rb b/db/seeds.rb
index 5ff079f2f..be7960dff 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -49,6 +49,7 @@ Setting["twitter_handle"] = nil
Setting["twitter_hashtag"] = nil
Setting["facebook_handle"] = nil
Setting["youtube_handle"] = nil
+Setting["telegram_handle"] = nil
Setting["blog_url"] = nil
# Public-facing URL of the app.
diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb
index bc01c94e2..f6efceea2 100644
--- a/spec/features/debates_spec.rb
+++ b/spec/features/debates_spec.rb
@@ -54,7 +54,7 @@ feature 'Debates' do
expect(page.html).to include "#{debate.title}"
within('.social-share-button') do
- expect(page.all('a').count).to be(3) # Twitter, Facebook, Google+
+ expect(page.all('a').count).to be(4) # Twitter, Facebook, Google+, Telegram
end
end
diff --git a/spec/features/proposals_spec.rb b/spec/features/proposals_spec.rb
index dbc5956cd..c7949a91d 100644
--- a/spec/features/proposals_spec.rb
+++ b/spec/features/proposals_spec.rb
@@ -63,7 +63,7 @@ feature 'Proposals' do
expect(page.html).to include "#{proposal.title}"
within('.social-share-button') do
- expect(page.all('a').count).to be(3) # Twitter, Facebook, Google+
+ expect(page.all('a').count).to be(4) # Twitter, Facebook, Google+, Telegram
end
end