From 152670a72bb6a8ad7ab0dd40619b220b05e292a4 Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 20 Dec 2010 16:05:32 -0800 Subject: [PATCH] notification badge now in header --- app/helpers/notifications_helper.rb | 8 ++ app/views/aspects/_all_aspects_contacts.haml | 6 +- app/views/layouts/_header.html.haml | 10 +- config/locales/diaspora/en.yml | 4 +- public/images/icons/mail.png | Bin 0 -> 3246 bytes public/images/icons/mail_grey.png | Bin 0 -> 352 bytes public/stylesheets/sass/application.sass | 137 ++++++++++++------- 7 files changed, 108 insertions(+), 57 deletions(-) create mode 100644 public/images/icons/mail.png create mode 100644 public/images/icons/mail_grey.png 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 0000000000000000000000000000000000000000..32c943a2f03ca5241be382a6ec60d7ec54e8ecd3 GIT binary patch literal 3246 zcmd5)9#(KJA2+@dtK)qp8trmGw*iCo1IzT zyuIDKz%Y#vO!{Si6d_ntYDieoL4SCn6a^JQo?rw81_hC&QCLxZXJ&Vtz1vCvd!e;3^ZpLbsVQw{`{3~TujGLm~h zP|R{jR?Pwm)yox_4+Iju^@^;FAwm^UQ8SYC#dlBAl%^)>EnPV_S4pFi)<22S=E;G) zGC8KiRl2vQBT*Lspp1x2)yukJ3H2oH;0o}+{hFaE$ApX}Y0)O6MskBx+Qf*8g!m92 zRM_q?)fEnfyZCNCvYz5uHpZ|~Cd>x8n85J@7o!?KbWaDB!0M)zY=tNh$cr7O=L=klBhDf!nN_Ty%s4Vgr$0GprNxeo>*?iK5UZqQVr$T}G<(gUnlPax4I_n^*im)W zHjR<0L2!0O6hVrPMr8$sV9{n7N-{xU44+WvJj<~`mV?K!@-LB)H3-sm;Ht{{Mr7E_ zTG4>Hh-DWOViR&u@2X5>8`TFF&hwlQ4hvlPK9&<$)h)EGs2x zmSXAO(UhJu>x8n9tu~sd;! zi&f-=LCv)pR7@4J$aS-gjJ2^z6AU=%Nu-phAylarbWLfCmnqAdzQx4QgvR6zZAxM` z_%Lpmw<#gU?jcmdUBQ0Mg8G|qUb&5BGur8n+@Y>HNuVfa!wHZWr+O`U9I39>=9JcE z8Lp`aK#dDtD9#7EW7%RW0m*Cg{_Ul8dbxdTi)c*ycv)@mgl*Wao@pkH7%B%mk`xXVw2C2I9rk}Q?bty6Z<4K*VL2PBkHIw z8!E!oCe4Dga=aZ=)6HS>quMO)0qG-Y>heh1=fUaE+BkyiSGjB&79|pbwL;ao0}Yr) z(0-4wqRBcnU{Vso+PF->!D=V5N$N=SNwOQ`kaL6!!|3~cKsdGd0-3mdn z`wniKaM5MFn=TBzyD~DMfnvA`e|mb?6}UyOB$*Mi*&HP`8KZ!E;mwvI3qwd&Cw6{- z5@2*OD~b8~`7_U)TDph5Iiu{Is)&W%t8WiIda?7bMGBodv3a)esl4f><#nw=N^BaZ14Xmurcw=$>W#4?tN);F&j9$ WXUB!D^@%0+*NkjtKsuh<{^(!QssEDz literal 0 HcmV?d00001 diff --git a/public/images/icons/mail_grey.png b/public/images/icons/mail_grey.png new file mode 100644 index 0000000000000000000000000000000000000000..07403d3da84f416165efbad6eca27a9cb1935b4d GIT binary patch literal 352 zcmV-m0iXVfP)l!4M3=5Dr2h7=j5zGK4?~gg_{R`Zc#d(-*sS+Neq^RUPSGRy*H} z_JIGEoKB}#5ov#8Cb?vHZ%Lj-WC2i~^v)z(5gD?o0>EHqCFhJMAhVfWa?UdVBr}7V z0l-{qeKE6fn>~2r?RLAa5SZBqz|0U4W3Ba|s^zm;RZFe)Kyup8^P0X_A&H16DWyq7 zT6ZrgrCvlzMBFWJH~0dHh>qj{03tG_l)6WYcMV8h0W2cY1L#OjE1-)Akh}os_TRn- zEbe|>Yj3l=RFZ8(3{BIV0krP`k_&*ITAd_bLFOs>@GIf1@`&>h6dp@lN*u0000