From 2c230fb80dbf818fb987b40360a0f1fdf0a68321 Mon Sep 17 00:00:00 2001 From: zhitomirskiyi Date: Mon, 24 Jan 2011 12:20:24 -0800 Subject: [PATCH] added menu notifications page aspect name header. --- app/views/aspects/index.mobile.haml | 6 +++ app/views/layouts/application.mobile.haml | 61 +++++++++++++++++++++- app/views/notifications/index.mobile.haml | 22 ++++++++ public/images/icons/back_white.png | Bin 0 -> 317 bytes public/stylesheets/sass/mobile.sass | 39 ++++++++++++-- 5 files changed, 122 insertions(+), 6 deletions(-) create mode 100644 app/views/notifications/index.mobile.haml create mode 100644 public/images/icons/back_white.png diff --git a/app/views/aspects/index.mobile.haml b/app/views/aspects/index.mobile.haml index 7c36a2609..9f9edc561 100644 --- a/app/views/aspects/index.mobile.haml +++ b/app/views/aspects/index.mobile.haml @@ -2,6 +2,12 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. +#aspect_header + - if @aspect == :all + = t('application.helper.aspect_badge.all_aspects') + - else + = @aspect + .grey_back = render 'shared/publisher', :aspect_ids => @aspect_ids diff --git a/app/views/layouts/application.mobile.haml b/app/views/layouts/application.mobile.haml index 4349616b8..a40fe87bc 100644 --- a/app/views/layouts/application.mobile.haml +++ b/app/views/layouts/application.mobile.haml @@ -16,20 +16,30 @@ :javascript $(document).ready(Mobile.initialize); + $(document).ready( function() { + $("#menu_button").bind('tap', function(e){ + e.preventDefault(); + $("#content").hide(); + $("#menu").show(); + }); + }); = yield(:head) %body #content{:data => {:role => 'page'}} - #header_sauce + #header - if current_user + .left + = link_to(image_tag('icons/back_white.png'), '#menu', :id => "menu_button") + .right = link_to(image_tag('icons/search_white.png'), people_path) = link_to(image_tag('white.png'), aspects_path) = yield - #footer_sauce + #footer - if current_user logged in as = link_to current_user.name, current_user.person @@ -46,3 +56,50 @@ %br = link_to 'logout', destroy_user_session_path + + #menu{:data => {:role => 'page'}} + #header + - if current_user + .right + = link_to(image_tag('icons/search_white.png'), people_path) + = link_to(image_tag('white.png'), aspects_path) + + %div{:data => {:role => 'content'}} + %h2 + = current_user.name + + %ul{:data => {:role => 'listview', :inset => 'true'}} + %li + = link_to t('people.edit.your_profile'), person_path(current_user.person) + %li + = link_to t('notifications.index.notifications'), notifications_path + .ui-li-count + = @notification_count + + %h4 + your aspects + + %ul{:data => {:role => 'listview', :inset => 'true'}} + %li + = link_to t('application.helper.aspect_badge.all_aspects'), aspects_path + - for aspect in @all_aspects + %li + = link_to aspect, aspects_path('a_ids[]' => aspect.id) + + + #footer + - if current_user + logged in as + = link_to current_user.name, current_user.person + + %br + %br + %b your aspects + %br + - for aspect in @all_aspects + = link_to aspect, aspects_path('a_ids[]' => aspect.id) + | + %br + + %br + = link_to 'logout', destroy_user_session_path diff --git a/app/views/notifications/index.mobile.haml b/app/views/notifications/index.mobile.haml new file mode 100644 index 000000000..64d945380 --- /dev/null +++ b/app/views/notifications/index.mobile.haml @@ -0,0 +1,22 @@ +%h3 + = t('.notifications') + +%ul.stream.notifications + - @group_days.each do |day, notes| + %li + .notification_day_header + = day + %ul.notifications_for_day + - notes.each do |note| + .stream_element{:data=>{:guid => note.id}, :class => "#{note.unread ? 'unread' : ''}"} + + = person_image_link(note.actor) + + .content + %span.from + %b= note.actor.name + + = object_link(note) + .time= timeago(note.created_at) + + = will_paginate @notifications diff --git a/public/images/icons/back_white.png b/public/images/icons/back_white.png new file mode 100644 index 0000000000000000000000000000000000000000..67fef69ba89be29de3469b1ffb312eed898e8760 GIT binary patch literal 317 zcmV-D0mA-?P)JA|CuCBH|>q zyc-cu1#%H_gLX=J4=+V>^s$0wD)|=PN^X9QR!aGHh5QoBDdjtOFOgqhA*FoR=Xw=! zhPmIIKQ^k+q*RSy@Cx&(1I8;N0_Rvv8ZihdTf>NmD=g)R*u-neIQnSii0I1S1HdX P00000NkvXXu0mjf3I2f5 literal 0 HcmV?d00001 diff --git a/public/stylesheets/sass/mobile.sass b/public/stylesheets/sass/mobile.sass index ee73d7dc5..9f699d650 100644 --- a/public/stylesheets/sass/mobile.sass +++ b/public/stylesheets/sass/mobile.sass @@ -78,7 +78,7 @@ a:not([role='button']) .content :padding - :left 43px + :left 45px :border :bottom 1px solid #eee @@ -231,7 +231,7 @@ ul .right :float right - + .hidden :display none @@ -265,7 +265,7 @@ ul :text :align left -#header_sauce +#header :background :color #111 :text @@ -287,7 +287,38 @@ ul :top 5px :right 0 -#footer_sauce +.left + :position absolute + :top 0 + :padding 6px + :left 0 + + +#footer :background :color #ccc :padding 12px + +.notification_day_header + :padding 6px + :background + :color #eee + :border + :top 1px solid #ddd + :bottom 1px solid #ccc + :font + :weight bold + :color #666 + +#aspect_header + :text + :align center + :padding 4px + :font + :weight bold + :text + :shadow none + :background + :color #333 + :color #ccc +