From 9b6d40544cbdca31f425ef44bd23a4ff6349e6c6 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 21 Dec 2010 17:36:14 -0800 Subject: [PATCH] fixed _comments bug on show pages --- app/views/comments/_comments.html.haml | 10 ++++++---- app/views/photos/show.html.haml | 2 +- app/views/status_messages/show.html.haml | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/views/comments/_comments.html.haml b/app/views/comments/_comments.html.haml index 7d244ef43..499986095 100644 --- a/app/views/comments/_comments.html.haml +++ b/app/views/comments/_comments.html.haml @@ -2,10 +2,12 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -%ul.show_comments{:class => ("hidden" if comment_hashes.size == 0)} - %li - = image_tag 'icons/spechbubble_2.png', :class => 'more_comments_icon' - %b= comment_toggle(comment_hashes.size) + +- unless defined?(always_expanded) && always_expanded + %ul.show_comments{:class => ("hidden" if comment_hashes.size == 0)} + %li + = image_tag 'icons/spechbubble_2.png', :class => 'more_comments_icon' + %b= comment_toggle(comment_hashes.size) %ul.comments{:id => post_id, :class => ("hidden" if comment_hashes.size == 0)} -if comment_hashes.size > 3 diff --git a/app/views/photos/show.html.haml b/app/views/photos/show.html.haml index 2466693d7..d1605d8ab 100644 --- a/app/views/photos/show.html.haml +++ b/app/views/photos/show.html.haml @@ -62,4 +62,4 @@ %ul{:id => 'photo_stream', :class => 'stream show'} %li.message{:data=>{:guid=>@parent.id}} - = render "comments/comments", :post_id => @parent.id, :comment_hashes => @comment_hashes + = render "comments/comments", :post_id => @parent.id, :comment_hashes => @comment_hashes, :always_expanded => true diff --git a/app/views/status_messages/show.html.haml b/app/views/status_messages/show.html.haml index 13e3ffcc4..de3c3e45d 100644 --- a/app/views/status_messages/show.html.haml +++ b/app/views/status_messages/show.html.haml @@ -28,4 +28,4 @@ %h4{:style=>"margin-bottom:5px;"}= t('_comments') %ul{:class => 'stream show', :id => 'status_message_stream'} %li.message{:data=>{:guid=>@status_message.id}} - = render "comments/comments", :post_id => @status_message.id, :comment_hashes => @comment_hashes + = render "comments/comments", :post_id => @status_message.id, :comment_hashes => @comment_hashes, :always_expanded => true