- This action needn't be performed when all notifications are read, hence disabling it is a good practice - Added a link-disabled-color - Used css pointer-events to disable clicking on the link Preventing default on click for the mark_all_read_link - avoiding the use of pointer-events - setting up disabled only for mark_all_read_link Moved disabling of the link to a global handler - Added disabled class to the button in /notifications when all are read - Styled the disabled button - Adding disabled class after completion of ajaxRequest
39 lines
1.6 KiB
Text
39 lines
1.6 KiB
Text
#notifications_content
|
|
.span-13
|
|
%h2
|
|
%span.notification_count{:class => ('unread' if @unread_notification_count >0 )}
|
|
= @unread_notification_count
|
|
= t('.notifications')
|
|
.span-8.last
|
|
= link_to t('.mark_all_as_read'), notifications_read_all_path, :class => "button #{'disabled' unless @unread_notification_count > 0}"
|
|
.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.effective_target)
|
|
.float-right
|
|
= aspect_membership_dropdown(contact, note.effective_target, 'left')
|
|
|
|
.media
|
|
.bd
|
|
= person_image_tag note.actors.first, :thumb_medium
|
|
= notification_message_for(note)
|
|
%div
|
|
%time
|
|
= timeago(note.created_at)
|
|
= link_to t('.mark_unread'), "#", :class => "unread-setter"
|
|
|
|
= will_paginate @notifications
|
|
|
|
:javascript
|
|
$(document).ready(function(){
|
|
Diaspora.page.header.notifications.setUpNotificationPage( $("#notifications_content" ) );
|
|
});
|