Skip to content

Commit

Permalink
disqus: show comments-count when disqus_shortname present
Browse files Browse the repository at this point in the history
  • Loading branch information
parasharrk committed Feb 12, 2016
1 parent bfb3e9f commit 5c68c97
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 9 additions & 0 deletions app/helpers/monologue/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 1 addition & 3 deletions app/views/monologue/posts/_post_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
<span data-monologue="user">
<%= post.user.name %>
</span>
<span data-monologue="disqus">
<a href="<%= post.full_url + "#disqus_thread" %>"></a>
</span>
<%= disqus_comments_count_for(post.full_url) %>
</div>
</header>

0 comments on commit 5c68c97

Please sign in to comment.