MS DG notifications are now pretty decent
This commit is contained in:
parent
152670a72b
commit
6d4696faf0
4 changed files with 48 additions and 18 deletions
|
|
@ -22,4 +22,5 @@ class NotificationsController < ApplicationController
|
||||||
@group_days = @notifications.group_by{|note| note.created_at.strftime("%B %d") }
|
@group_days = @notifications.group_by{|note| note.created_at.strftime("%B %d") }
|
||||||
respond_with @notifications
|
respond_with @notifications
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,34 @@
|
||||||
:javascript
|
:javascript
|
||||||
$('.note a').live('click', function(evt){
|
$('.message').live('click', function(evt){
|
||||||
var note_id = $(this).closest('.note').attr('id');
|
var note = $(this).closest('.message'),
|
||||||
$.ajax({
|
note_id = note.attr('data-guid');
|
||||||
url: 'notifications/' + note_id,
|
|
||||||
type: 'PUT'
|
if(note.hasClass('unread') ){
|
||||||
});
|
note.removeClass('unread');
|
||||||
|
$.ajax({
|
||||||
|
url: 'notifications/' + note_id,
|
||||||
|
type: 'PUT'
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
%ul.notes
|
|
||||||
- @group_days.each do |day, notes|
|
.span-1
|
||||||
%h3
|
= image_tag 'icons/mail_big.png', :height => 30, :width => 30, :style=>"margin-top:3px;"
|
||||||
%ul
|
.span-23.last
|
||||||
%li
|
%h2
|
||||||
= day
|
Notifications
|
||||||
- notes.each do |note|
|
|
||||||
%li.note{:id => note.id}
|
.span-24.last
|
||||||
%h4{:class => "#{note.unread ? 'unread' : ''}"}
|
%ul.stream.notifications
|
||||||
= link_to "#{note.person.name.titleize}", person_path(note.person)
|
- @group_days.each do |day, notes|
|
||||||
= object_link(note)
|
%li
|
||||||
%span.description=" #{t('ago', :time => time_ago_in_words(note.created_at))}"
|
%h4= day
|
||||||
|
%ul.notifications_for_day
|
||||||
|
- notes.each do |note|
|
||||||
|
%li.message{:data=>{:guid => note.id}, :class => "#{note.unread ? 'unread' : ''}"}
|
||||||
|
%span.from
|
||||||
|
= link_to "#{note.person.name.titleize}", person_path(note.person)
|
||||||
|
= object_link(note)
|
||||||
|
|
||||||
|
%span.time= "#{t('ago', :time => time_ago_in_words(note.created_at))}"
|
||||||
|
|
|
||||||
BIN
public/images/icons/mail_big.png
Normal file
BIN
public/images/icons/mail_big.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.3 KiB |
|
|
@ -2134,3 +2134,19 @@ h3,h4
|
||||||
:top 6px
|
:top 6px
|
||||||
:right 0
|
:right 0
|
||||||
|
|
||||||
|
ul.notifications_for_day
|
||||||
|
|
||||||
|
:margin 0
|
||||||
|
:padding 0
|
||||||
|
|
||||||
|
li.message
|
||||||
|
:margin
|
||||||
|
:bottom 0.3em
|
||||||
|
:padding 0.2em 0.5em
|
||||||
|
:width 500px
|
||||||
|
|
||||||
|
.stream.notifications
|
||||||
|
> li:hover
|
||||||
|
:background none
|
||||||
|
:border
|
||||||
|
:bottom 1px solid #eee
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue