Take current user id out of avatar
This commit is contained in:
parent
5b73e9ca06
commit
f2cc51dd0d
3 changed files with 4 additions and 5 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def person_image_tag(person, size=:thumb_small)
|
||||
"<img alt=\"#{h(person.name)}\" class=\"avatar\" #{("data-owner_id="+@user_id.to_s) if @user_id} data-person_id=\"#{person.id}\" src=\"#{person.profile.image_url(size)}\" title=\"#{h(person.name)}\">".html_safe
|
||||
"<img alt=\"#{h(person.name)}\" class=\"avatar\" data-person_id=\"#{person.id}\" src=\"#{person.profile.image_url(size)}\" title=\"#{h(person.name)}\">".html_safe
|
||||
end
|
||||
|
||||
def person_link(person, opts={})
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
Loading…
Reference in a new issue