From 03e06cb279ccd0582d58beaea54551ebdad1c733 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Sat, 24 Jul 2010 10:24:43 -0700 Subject: [PATCH] person sidebar has a view all; displays user images with names in tooltips instead of text --- app/helpers/application_helper.rb | 10 +++++++++- app/views/layouts/application.html.haml | 2 +- app/views/people/_sidebar.html.haml | 11 ++++++----- app/views/status_messages/_status_message.html.haml | 2 +- public/stylesheets/application.css | 7 +------ public/stylesheets/sass/application.sass | 7 +------ 6 files changed, 19 insertions(+), 20 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0ca3f7ad5..aa0ab515f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -45,7 +45,15 @@ module ApplicationHelper image_location = person.profile.image_url image_location ||= "/images/user/default.jpg" - image_tag image_location, :class => "person_picture" + image_tag image_location, :class => "person_picture", :alt => person.real_name, :title => person.real_name + end + + def person_image_link(person) + link_to person_image_tag(person), object_path(person) + end + + def owner_image_link + person_image_link(User.owner) end def new_request(request_count) diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 6f7738030..3d0d5f3e4 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -53,7 +53,7 @@ .span-18.append-3.last = yield .span-3.last - = link_to person_image_tag(User.owner), root_path + = link_to (image_tag(current_user.profile.image_url)), root_path = link_to "Edit your profile", edit_user_path(current_user) %br %br diff --git a/app/views/people/_sidebar.html.haml b/app/views/people/_sidebar.html.haml index 877db490e..bb6187dac 100644 --- a/app/views/people/_sidebar.html.haml +++ b/app/views/people/_sidebar.html.haml @@ -1,15 +1,16 @@ %ul#friend_stream.nav - %h4 friends! + %h3 friends - for friend in @friends - %li= link_to friend.real_name, person_path(friend) + %li= person_image_link(friend) + + = link_to "all", people_path %hr - %h4 on other networks! + %h3 following - for author in @subscribed_persons %li= link_to author.username, author_path(author) - %li= link_to "add a new person", new_request_path - += link_to "add a new person", new_request_path diff --git a/app/views/status_messages/_status_message.html.haml b/app/views/status_messages/_status_message.html.haml index f3a44d3af..5681e9753 100644 --- a/app/views/status_messages/_status_message.html.haml +++ b/app/views/status_messages/_status_message.html.haml @@ -1,6 +1,6 @@ %li.message{:id => post.id, :class => ("mine" if mine?(post))} - = person_image_tag(post.person) + = person_image_link(post.person) %span.from = link_to post.person.real_name, post.person diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 6e31c853b..7386942da 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -196,15 +196,10 @@ ul.comment_set { padding-bottom: 8px; } img.person_picture { - max-width: 100%; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; - display: inline block; } - -li.message > img.person_picture, -li.comment > img.person_picture, -#session_action > img.person_picture { + display: inline block; height: 30px; display: absolute; float: left; diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 8809af2a8..107e8008b 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -236,15 +236,10 @@ ul.comment_set :bottom 8px img.person_picture - :max-width 100% :border-radius 3px :-webkit-border-radius 3px :-moz-border-radius 3px :display inline block - -li.message > img.person_picture, -li.comment > img.person_picture, -#session_action > img.person_picture :height 30px :display absolute :float left @@ -416,4 +411,4 @@ ul#publisher_content_pickers li .field_with_submit input[type='text'] :width 85% - :display inline \ No newline at end of file + :display inline