can retrieve all comments

This commit is contained in:
Rocky Duan
2012-08-15 01:08:42 -07:00
parent e5fe54ca5d
commit 00ff1b9419
2 changed files with 5 additions and 4 deletions

View File

@@ -265,7 +265,7 @@ initializeFollowThread = (thread) ->
$threadTitle = $local(".thread-title")
$showComments = $local(".discussion-show-comments")
if not $showComments.length or not $threadTitle.length
if not $showComments.hasClass("first-time") and (not $showComments.length or not $threadTitle.length)
return
rebindHideEvents = ->
@@ -277,7 +277,7 @@ initializeFollowThread = (thread) ->
$showComments.html prevHtml.replace "Show", "Hide"
if $content.children(".comments").length
if not $showComments.hasClass("first-time") and $content.children(".comments").length
$content.children(".comments").show()
rebindHideEvents()
else
@@ -294,6 +294,7 @@ initializeFollowThread = (thread) ->
$content.find(".comment").each (index, comment) ->
Discussion.initializeContent(comment)
Discussion.bindContentEvents(comment)
$showComments.removeClass("first-time")
rebindHideEvents()
Discussion.bindLocalEvents $local,

View File

@@ -134,8 +134,8 @@
</div>
<div class="comment-count">
% if content.get('comments_count', -1) >= 0:
% if kwargs.get('show_comments') is True:
<a href="javascript:void(0)" class="discussion-hide-comments">Hide ${content['comments_count']} ${pluralize('comment', content['comments_count'])}</a>
% if discussion_type == 'user':
<a href="javascript:void(0)" class="discussion-show-comments first-time">Show all comments (${content['comments_count']} total)</a>
% else:
<a href="javascript:void(0)" class="discussion-show-comments">Show ${content['comments_count']} ${pluralize('comment', content['comments_count'])}</a>
% endif