notification badge now in header

This commit is contained in:
maxwell 2010-12-20 16:05:32 -08:00
parent 9cd08bac67
commit 152670a72b
7 changed files with 108 additions and 57 deletions

View file

@ -12,4 +12,12 @@ module NotificationsHelper
else else
end end
end end
def new_notification_text(count)
if count > 0
t('new_notifications', :count => count)
else
t('no_new_notifications')
end
end
end end

View file

@ -11,9 +11,9 @@
.section.aspect_listings .section.aspect_listings
%h3 %h3
= link_to(t('.aspects'), aspects_manage_path) = t('.aspects')
.right{:style=>"font-size:12px;top:7px;"} .right{:style=>"font-size:12px;top:5px;"}
= link_to t('.add_aspect'), '#add_aspect_pane', :class => "add_aspect_button" = link_to t('.manage_aspects'), aspects_manage_path
%ul %ul
- for a_hash in @aspect_hashes - for a_hash in @aspect_hashes

View file

@ -22,6 +22,13 @@
= form_tag(people_path, :method => 'get', :id => "global_search_form") do = form_tag(people_path, :method => 'get', :id => "global_search_form") do
= text_field_tag 'q', nil, :placeholder => t('search'), :type => 'search', :results => 5 = text_field_tag 'q', nil, :placeholder => t('search'), :type => 'search', :results => 5
#notification_badge
= link_to "", notifications_path, :title => new_notification_text(@notification_count)
= image_tag 'icons/mail_grey.png'
- if @notification_count > 0
#notification_badge_number
= @notification_count
%ul#user_menu %ul#user_menu
.right .right
@ -37,14 +44,13 @@
#aspect_nav #aspect_nav
%ul %ul
%li{:class => ("selected" if @aspect == :all)} %li{:class => ("selected" if @aspect == :all)}
= link_to ((@request_count == 0)? t('_home') : "#{t('_home')} (#{@request_count})"), root_path, :class => new_request?(@request_count) = link_to t('_home'), root_path
- for aspect in @aspects - for aspect in @aspects
%li{:class => ("selected" if current_aspect?(aspect))} %li{:class => ("selected" if current_aspect?(aspect))}
= link_for_aspect aspect = link_for_aspect aspect
%li %li
= link_to '+', '#add_aspect_pane', :class => "add_aspect_button", :title => t('aspects.manage.add_a_new_aspect') = link_to '+', '#add_aspect_pane', :class => "add_aspect_button", :title => t('aspects.manage.add_a_new_aspect')
/= link_to "notifications (#{@notification_count})", notifications_path
.fancybox_content .fancybox_content
#add_aspect_pane #add_aspect_pane

View file

@ -25,6 +25,8 @@ en:
back: "Back" back: "Back"
the_world: "the world" the_world: "the world"
search: "Search" search: "Search"
new_notifications: "%{count} new notifications"
no_new_notifications: "no new notifications"
_home: "Home" _home: "Home"
_comments: "Comments" _comments: "Comments"
contacts: contacts:
@ -123,7 +125,7 @@ en:
aspects: aspects:
all_aspects_contacts: all_aspects_contacts:
all_contacts: "All contacts" all_contacts: "All contacts"
add_aspect: "add aspect" manage_aspects: "manage aspects"
aspects: "Aspects" aspects: "Aspects"
no_contacts: "You currently have no contacts. Find your contacts here." no_contacts: "You currently have no contacts. Find your contacts here."
aspect_contacts: aspect_contacts:

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

View file

@ -139,7 +139,6 @@ header
:top 10px :top 10px
:height 45px :height 45px
ul#notifications,
ul#user_menu ul#user_menu
:overflow hidden :overflow hidden
:white-space nowrap :white-space nowrap
@ -1477,38 +1476,6 @@ ul.aspects
form form
:display relative :display relative
.bottom_notification
:position fixed
:bottom 0
:left 0
:width 100%
:background
:color rgba(16,127,201,0.8)
:text
:align center
:font
:size 14px
:weight bold
:color #fff
:padding 12px
:bottom 10px
a
:color #fafafa
:background
:color rgb(16,127,201)
:padding 8px
:-webkit-border-radius 10px
:-moz-border-radius 10px
:border-radius 10px
&:hover
:background
:color #22AAE0
.inline_aspect_listing .inline_aspect_listing
:margin 0 :margin 0
:padding 0 :padding 0
@ -1597,6 +1564,69 @@ h3 span.current_gs_step
:padding 12px :padding 12px
:color #fff :color #fff
.bottom_notification
:position fixed
:bottom 0
:left 0
:width 100%
:background
:color rgba(16,127,201,0.8)
:text
:align center
:font
:size 14px
:weight bold
:color #fff
:padding 12px
:bottom 10px
a
:color #fafafa
:background
:color rgb(16,127,201)
:padding 8px
:-webkit-border-radius 10px
:-moz-border-radius 10px
:border-radius 10px
&:hover
:background
:color #22AAE0
#notification_badge
:position relative
:top 5px
:display inline
:margin 0 1em
:font
:weight bold
:size smaller
:width 30px
a
:z-index 5
:position absolute
:top -9px
:width 20px
:height 20px
#notification_badge_number
:z-index 3
:position absolute
:top -10px
:left 11px
:padding 0 2px
:bottom 1px
:background
:color #A40802
:border-radius 2px
:line
:height 12px
:color #fff
#profile #profile
ul#aspects_for_person ul#aspects_for_person
> li > li
@ -1945,24 +1975,6 @@ h3,h4
:padding :padding
:bottom 5px :bottom 5px
#new_request_pane
:background
:color red
:-webkit-border-radius 4px
:-moz-border-radius 4px
:border-radius 4px
:-webkit-box-shadow 0 1px 2px #666
:-moz-box-shadow 0 1px 2px #666
:box-shadow 0 1px 2px #666
h1
a
:color #fff
:font
:weight bold
#edit_aspect_pane #edit_aspect_pane
:-webkit-box-shadow 0 4px 8px #333 :-webkit-box-shadow 0 4px 8px #333
:-moz-box-shadow 0 4px 8px #333 :-moz-box-shadow 0 4px 8px #333
@ -2099,3 +2111,26 @@ h3,h4
#aspects_list #aspects_list
:height auto :height auto
#new_request_list
:margin 0
:bottom 2em
:padding 0 1em
li
:padding 0.5em 0
:border
:bottom 1px solid #eee
.avatar
:height 30px
:width 30px
.content
:padding
:left 40px
.right
:top 6px
:right 0