parent
5348c72209
commit
63c7634f6a
2 changed files with 21 additions and 26 deletions
|
|
@ -15,7 +15,7 @@ class ApplicationController < ActionController::Base
|
|||
|
||||
inflection_method :grammatical_gender => :gender
|
||||
|
||||
helper_method :all_aspects, :all_contacts_count, :my_contacts_count, :only_sharing_count, :notification_count, :unread_message_count
|
||||
helper_method :all_aspects, :all_contacts_count, :my_contacts_count, :only_sharing_count
|
||||
helper_method :tags, :tag_followings
|
||||
|
||||
def ensure_http_referer_is_set
|
||||
|
|
@ -26,6 +26,8 @@ class ApplicationController < ActionController::Base
|
|||
if user_signed_in?
|
||||
if request.format.html? && !params[:only_posts]
|
||||
@aspect = nil
|
||||
@notification_count = Notification.for(current_user, :unread =>true).count
|
||||
@unread_message_count = ConversationVisibility.sum(:unread, :conditions => "person_id = #{current_user.person.id}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -42,14 +44,6 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
|
||||
##helpers
|
||||
def notification_count
|
||||
@ontification_count ||= Notification.for(current_user, :unread =>true).count
|
||||
end
|
||||
|
||||
def unread_message_count
|
||||
@unread_message_count ||= ConversationVisibility.sum(:unread, :conditions => "person_id = #{current_user.person.id}")
|
||||
end
|
||||
|
||||
def all_aspects
|
||||
@all_aspects ||= current_user.aspects
|
||||
end
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
= form_tag(people_path, :method => 'get', :class => "search_form") do
|
||||
= text_field_tag 'q', nil, :placeholder => t('find_people'), :type => 'search', :results => 5
|
||||
|
||||
- if @notification_count
|
||||
#nav_badges
|
||||
#home_badge.badge
|
||||
= link_to aspects_path, :title => t('_home') do
|
||||
|
|
@ -33,14 +34,14 @@
|
|||
#notification_badge.badge
|
||||
= link_to notifications_path, :title => new_notification_text(@notification_count) do
|
||||
= image_tag 'icons/notifications_grey.svg', :height => 16, :id => "notification-flag"
|
||||
.badge_count{:class => ("hidden" if notification_count == 0)}
|
||||
= notification_count
|
||||
.badge_count{:class => ("hidden" if @notification_count == 0)}
|
||||
= @notification_count
|
||||
|
||||
#message_inbox_badge.badge
|
||||
= link_to conversations_path , :title => new_message_text(@unread_message_count) do
|
||||
= image_tag 'icons/mail_grey.svg', :width => 18
|
||||
.badge_count{:class => ("hidden" if unread_message_count == 0)}
|
||||
= unread_message_count
|
||||
.badge_count{:class => ("hidden" if @unread_message_count == 0)}
|
||||
= @unread_message_count
|
||||
|
||||
#notification_dropdown
|
||||
.header
|
||||
|
|
|
|||
Loading…
Reference in a new issue