From 5074654d1b469364b1df30331acf2e1089827b7a Mon Sep 17 00:00:00 2001 From: Raghvendra Parashar Date: Fri, 12 Feb 2016 18:47:09 +0530 Subject: [PATCH 1/2] disqus: show comments-count when disqus_shortname present --- app/helpers/monologue/application_helper.rb | 9 +++++++++ app/views/monologue/posts/_post_header.html.erb | 4 +--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/helpers/monologue/application_helper.rb b/app/helpers/monologue/application_helper.rb index 5bd663a0..96493f50 100644 --- a/app/helpers/monologue/application_helper.rb +++ b/app/helpers/monologue/application_helper.rb @@ -54,5 +54,14 @@ def social_icon(foundicon, url, setting) end end end + + def disqus_comments_count_for url + return if Monologue::Config.disqus_shortname.blank? + + content_tag :span, data: {monologue: 'disqus'} do + content_tag :a, href: "#{url}#disqus_thread" do + end + end + end end end diff --git a/app/views/monologue/posts/_post_header.html.erb b/app/views/monologue/posts/_post_header.html.erb index 5e71c7fa..15ecd0d0 100644 --- a/app/views/monologue/posts/_post_header.html.erb +++ b/app/views/monologue/posts/_post_header.html.erb @@ -9,8 +9,6 @@ <%= post.user.name %> - - "> - + <%= disqus_comments_count_for(post.full_url) %> \ No newline at end of file From 0200e63a7ee9f6dc12aa53da8f20812c3e11b1da Mon Sep 17 00:00:00 2001 From: Raghvendra Parashar Date: Sun, 14 Feb 2016 11:22:40 +0530 Subject: [PATCH 2/2] fixing specs: removed missing require turbolinks --- spec/dummy/app/assets/javascripts/application.js | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/dummy/app/assets/javascripts/application.js b/spec/dummy/app/assets/javascripts/application.js index d6925fa4..1ca0e3b7 100644 --- a/spec/dummy/app/assets/javascripts/application.js +++ b/spec/dummy/app/assets/javascripts/application.js @@ -12,5 +12,4 @@ // //= require jquery //= require jquery_ujs -//= require turbolinks //= require_tree .