DG IZ; comments show and hide

This commit is contained in:
danielvincent 2010-06-29 20:53:49 -07:00
parent 984f5f62b6
commit 19c41fb6be
4 changed files with 32 additions and 28 deletions

View file

@ -6,7 +6,11 @@
%b= post.title
%br
= raw post.body
%div.time= link_to "#{time_ago_in_words(post.updated_at)} ago", blog_path(post)
%div.time
= link_to(how_long_ago(post), blog_path(post))
\--
= link_to "show comments (#{post.comments.count})", '#', :class => "show_post_comments"
= render "comments/comments", :post => post
- if mine?(post)
.destroy_link

View file

@ -7,7 +7,11 @@
%a{:href => "#{post.link}"}
= post.link
%div.time= link_to "#{time_ago_in_words(post.updated_at)} ago", bookmark_path(post)
%div.time
= link_to(how_long_ago(post), bookmark_path(post))
\--
= link_to "show comments (#{post.comments.count})", '#', :class => "show_post_comments"
= render "comments/comments", :post => post
- if mine?(post)
.destroy_link

View file

@ -1,24 +1,16 @@
.span-15
.span-4.append-1.last
%img{:src => "/images/user_picture.jpg", :id => "profile_picture"}
.span-10.last
%h1= "#{@friend.real_name}"
- if @friend_profile
%p
%b First Name
%p
= @friend_profile.first_name
%p
%b Last Name
%p
= @friend_profile.last_name
.span-18.last
%h1= "#{@friend.real_name}"
- if @friend_profile
%p
%b First Name
%p
= @friend_profile.first_name
%p
%b Last Name
%p
= @friend_profile.last_name
%br
%br
%br
%br
.span-15
.span-18
- if @friend.posts
%h3 stream
%ul#stream

View file

@ -62,7 +62,14 @@
$("label").inFieldLabels();
$(".show_post_comments").click( function() {
$(this).parents("li").children(".comments").fadeIn(100);
if( $(this).hasClass( "visible" )) {
$(this).html($(this).html().replace("hide", "show"));
$(this).parents("li").children(".comments").fadeOut(100);
} else {
$(this).html($(this).html().replace("show", "hide"));
$(this).parents("li").children(".comments").fadeIn(100);
}
$(this).toggleClass( "visible" );
});
@ -95,18 +102,15 @@
= my_latest_message
#content.span-24.last
.span-5.append-1.last
%img{:src => "/images/user_picture.jpg", :id => "user_picture"}
= link_to (image_tag "/images/user_picture.jpg", :id => "user_picture"), root_path
%ul#stream_filters
%a{ :href => root_path, :title => "Your network stream."}
%li home
%a{ :href => status_messages_path, :title => "Recent status messages."}
%li status messages
%a{ :href => bookmarks_path, :title => "Recently shared links."}
%li bookmarks
%a{ :href => blogs_path, :title => "Recent blog posts."}
%li blogs
%a{ :href => friends_path, :title => "Your list of connections with other seeds."}
%li friends
= render 'friends/sidebar' if user_signed_in?
.span-18
= yield