From f2cc51dd0d7a74823b41fef45e070cee1f451444 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Wed, 9 Mar 2011 17:04:21 -0800 Subject: [PATCH] Take current user id out of avatar --- app/controllers/application_controller.rb | 5 ++--- app/helpers/application_helper.rb | 2 +- public/javascripts/aspect-filters.js | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 13cb51b4e..f8c99941f 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -7,7 +7,7 @@ class ApplicationController < ActionController::Base protect_from_forgery :except => :receive before_filter :ensure_http_referer_is_set - before_filter :set_contacts_notifications_unread_count_and_status, :except => [:create, :update] + before_filter :set_header_data, :except => [:create, :update] before_filter :count_requests before_filter :set_invites before_filter :set_locale @@ -22,14 +22,13 @@ class ApplicationController < ActionController::Base request.env['HTTP_REFERER'] ||= '/aspects' end - def set_contacts_notifications_unread_count_and_status + def set_header_data if user_signed_in? @aspect = nil @object_aspect_ids = [] @all_aspects = current_user.aspects.includes(:aspect_memberships) @notification_count = Notification.for(current_user, :unread =>true).count @unread_message_count = ConversationVisibility.sum(:unread, :conditions => "person_id = #{current_user.person.id}") - @user_id = current_user.id end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index d90e571ad..3a8512124 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -129,7 +129,7 @@ module ApplicationHelper end def person_image_tag(person, size=:thumb_small) - "\"#{h(person.name)}\"".html_safe + "\"#{h(person.name)}\"".html_safe end def person_link(person, opts={}) diff --git a/public/javascripts/aspect-filters.js b/public/javascripts/aspect-filters.js index 0b4f5dbd0..1994ee563 100644 --- a/public/javascripts/aspect-filters.js +++ b/public/javascripts/aspect-filters.js @@ -104,7 +104,7 @@ $(document).ready(function(){ function performAspectUpdate(home){ // update the open aspects in the user - updateURL = "/users/" + $('div.avatar').children('img').attr("data-owner_id"); + updateURL = "/users/" + $('#user_menu').find('div.avatar').children('img').attr("data-owner_id"); updateURL += '?'; if(home == 'home'){ updateURL += 'user[a_ids][]=home';