diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb index 6f496eb10..e8458a937 100644 --- a/app/helpers/notifications_helper.rb +++ b/app/helpers/notifications_helper.rb @@ -12,4 +12,12 @@ module NotificationsHelper else end end + + def new_notification_text(count) + if count > 0 + t('new_notifications', :count => count) + else + t('no_new_notifications') + end + end end diff --git a/app/views/aspects/_all_aspects_contacts.haml b/app/views/aspects/_all_aspects_contacts.haml index 6c6e6fd99..d0c37608e 100644 --- a/app/views/aspects/_all_aspects_contacts.haml +++ b/app/views/aspects/_all_aspects_contacts.haml @@ -11,9 +11,9 @@ .section.aspect_listings %h3 - = link_to(t('.aspects'), aspects_manage_path) - .right{:style=>"font-size:12px;top:7px;"} - = link_to t('.add_aspect'), '#add_aspect_pane', :class => "add_aspect_button" + = t('.aspects') + .right{:style=>"font-size:12px;top:5px;"} + = link_to t('.manage_aspects'), aspects_manage_path %ul - for a_hash in @aspect_hashes diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index 06519d79f..b4d46a281 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -22,6 +22,13 @@ = form_tag(people_path, :method => 'get', :id => "global_search_form") do = 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 .right ▼ @@ -37,14 +44,13 @@ #aspect_nav %ul %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 %li{:class => ("selected" if current_aspect?(aspect))} = link_for_aspect aspect %li = 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 #add_aspect_pane diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 348e9d66e..c331a97f9 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -25,6 +25,8 @@ en: back: "Back" the_world: "the world" search: "Search" + new_notifications: "%{count} new notifications" + no_new_notifications: "no new notifications" _home: "Home" _comments: "Comments" contacts: @@ -123,7 +125,7 @@ en: aspects: all_aspects_contacts: all_contacts: "All contacts" - add_aspect: "add aspect" + manage_aspects: "manage aspects" aspects: "Aspects" no_contacts: "You currently have no contacts. Find your contacts here." aspect_contacts: diff --git a/public/images/icons/mail.png b/public/images/icons/mail.png new file mode 100644 index 000000000..32c943a2f Binary files /dev/null and b/public/images/icons/mail.png differ diff --git a/public/images/icons/mail_grey.png b/public/images/icons/mail_grey.png new file mode 100644 index 000000000..07403d3da Binary files /dev/null and b/public/images/icons/mail_grey.png differ diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index d28c71c1d..e2d2c542c 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -139,7 +139,6 @@ header :top 10px :height 45px - ul#notifications, ul#user_menu :overflow hidden :white-space nowrap @@ -1477,38 +1476,6 @@ ul.aspects form :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 :margin 0 :padding 0 @@ -1597,6 +1564,69 @@ h3 span.current_gs_step :padding 12px :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 ul#aspects_for_person > li @@ -1945,24 +1975,6 @@ h3,h4 :padding :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 :-webkit-box-shadow 0 4px 8px #333 :-moz-box-shadow 0 4px 8px #333 @@ -2099,3 +2111,26 @@ h3,h4 #aspects_list :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 +