From aae5fe04ceadc30c58698ff3891f99c272f4d096 Mon Sep 17 00:00:00 2001 From: Steven Fuchs Date: Tue, 17 Jan 2012 19:21:25 -0500 Subject: [PATCH] css for marking as unread, and hook for notification page to be part of it when called. --- app/views/notifications/index.html.haml | 61 +++++++++++++----------- public/stylesheets/sass/application.sass | 9 +++- 2 files changed, 42 insertions(+), 28 deletions(-) diff --git a/app/views/notifications/index.html.haml b/app/views/notifications/index.html.haml index 88a098ab2..0e07e31ac 100644 --- a/app/views/notifications/index.html.haml +++ b/app/views/notifications/index.html.haml @@ -2,33 +2,40 @@ -self.extend AspectsHelper -self.extend ApplicationHelper -self.extend ErrorMessagesHelper -.span-13 - %h2 - %span.notification_count{:class => ('unread' if @notification_count > 0)} - = @notification_count - = t('.notifications') -.span-8.last - = link_to t('.mark_all_as_read'), read_all_notifications_path, :class => 'button' +#notifications_content + .span-13 + %h2 + %span.notification_count{:class => ('unread' if @notification_count > 0)} + = @notification_count + = t('.notifications') + .span-8.last + = link_to t('.mark_all_as_read'), read_all_notifications_path, :class => 'button' + .span-24.last + .stream.notifications + - group_days.each do |day, notes| + .day_group.span-24.last + .span-3 + .date + .day= the_day(day.split(' ')) + .month= the_month(day.split(' ')) -.span-24.last - .stream.notifications - - group_days.each do |day, notes| - .day_group.span-24.last - .span-3 - .date - .day= the_day(day.split(' ')) - .month= the_month(day.split(' ')) + .span-8.notifications_for_day + - notes.each do |note| + .stream_element{:data=>{:guid => note.id}, :class => "#{note.unread ? 'unread' : 'read'}"} + - if note.type == "Notifications::StartedSharing" && contact = current_user.contact_for(note[:target]) + .right + = aspect_membership_dropdown(contact, note[:target], 'left') - .span-8.notifications_for_day - - notes.each do |note| - .stream_element{:data=>{:guid => note.id}, :class => "#{note.unread ? 'unread' : ''}"} - - if note.type == "Notifications::StartedSharing" && contact = current_user.contact_for(note[:target]) - .right - = aspect_membership_dropdown(contact, note[:target], 'left') + %span.from + = notification_message_for(note) + %br + %time= timeago(note.created_at) + %a{:class => 'unread-setter'} + mark unread + .span-13.last + = will_paginate notifications - %span.from - = notification_message_for(note) - %br - %time= timeago(note.created_at) - .span-13.last - = will_paginate notifications +:javascript + $(document).ready(function(){ + Diaspora.page.header.notifications.setUpNotificationPage( $("#notifications_content" ) ); + }); diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 047586227..20145c001 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -2987,6 +2987,12 @@ ul.left_nav .user_card :margin-left 8px +.unread-setter + :float right + :display none + :cursor pointer + :margin-top 8px + .stream_container :min-height 500px @@ -3139,7 +3145,8 @@ a.toggle_selector .notification_element :padding 10px :min-height 30px - + &:hover + :background-color #FAFAFA > img :height 30px :width 30px