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") }
|
||||
respond_with @notifications
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,21 +1,34 @@
|
|||
:javascript
|
||||
$('.note a').live('click', function(evt){
|
||||
var note_id = $(this).closest('.note').attr('id');
|
||||
$.ajax({
|
||||
url: 'notifications/' + note_id,
|
||||
type: 'PUT'
|
||||
});
|
||||
$('.message').live('click', function(evt){
|
||||
var note = $(this).closest('.message'),
|
||||
note_id = note.attr('data-guid');
|
||||
|
||||
if(note.hasClass('unread') ){
|
||||
note.removeClass('unread');
|
||||
$.ajax({
|
||||
url: 'notifications/' + note_id,
|
||||
type: 'PUT'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
%ul.notes
|
||||
- @group_days.each do |day, notes|
|
||||
%h3
|
||||
%ul
|
||||
%li
|
||||
= day
|
||||
- notes.each do |note|
|
||||
%li.note{:id => note.id}
|
||||
%h4{:class => "#{note.unread ? 'unread' : ''}"}
|
||||
= link_to "#{note.person.name.titleize}", person_path(note.person)
|
||||
= object_link(note)
|
||||
%span.description=" #{t('ago', :time => time_ago_in_words(note.created_at))}"
|
||||
|
||||
.span-1
|
||||
= image_tag 'icons/mail_big.png', :height => 30, :width => 30, :style=>"margin-top:3px;"
|
||||
.span-23.last
|
||||
%h2
|
||||
Notifications
|
||||
|
||||
.span-24.last
|
||||
%ul.stream.notifications
|
||||
- @group_days.each do |day, notes|
|
||||
%li
|
||||
%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
|
||||
: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