diff --git a/app/assets/javascripts/app/controllers/widget/online_notification.js.coffee b/app/assets/javascripts/app/controllers/widget/online_notification.js.coffee
index aebff64b3..459010f26 100644
--- a/app/assets/javascripts/app/controllers/widget/online_notification.js.coffee
+++ b/app/assets/javascripts/app/controllers/widget/online_notification.js.coffee
@@ -43,6 +43,11 @@ class App.OnlineNotificationWidget extends App.Controller
else
@el.find('.logo').append('
' + count.toString() + '
')
+ markAllAsSeen: (items) =>
+ for item in items
+ if !item.seen
+ App.OnlineNotification.seen( 'Ticket', item.id )
+
stop: =>
@counterUpdate(0)
@el.find('.logo').popover('destroy')
@@ -68,11 +73,15 @@ class App.OnlineNotificationWidget extends App.Controller
placement: 'right'
title: ->
App.i18n.translateInline( 'Notifications' ) + " #{counter}"
- content: ->
+ content: =>
# insert data
- App.view('widget/online_notification')(
+ html = $( App.view('widget/online_notification')(
items: items
- )
+ ))
+ html.on('click', (e) =>
+ e.preventDefault()
+ @markAllAsSeen(items)
+ )
).on('shown.bs.popover', =>
# show frontend times
@frontendTimeUpdate()
diff --git a/app/assets/javascripts/app/views/widget/online_notification.jst.eco b/app/assets/javascripts/app/views/widget/online_notification.jst.eco
index df16cdd73..577c01683 100644
--- a/app/assets/javascripts/app/views/widget/online_notification.jst.eco
+++ b/app/assets/javascripts/app/views/widget/online_notification.jst.eco
@@ -1,15 +1,22 @@
-<% for item in @items: %>
-
+ <% end %>
+<% else: %>
+
+ <%- @T("No unread Notifications for you. :) ") %>
+
<% end %>
\ No newline at end of file
diff --git a/db/seeds.rb b/db/seeds.rb
index 5a6c3c488..09cbe4a22 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -1914,6 +1914,7 @@ Translation.create_if_not_exists( :locale => 'de', :source => "from", :target =>
Translation.create_if_not_exists( :locale => 'de', :source => "to", :target => "nach" )
Translation.create_if_not_exists( :locale => 'de', :source => "%s ago", :target => "vor %s" )
Translation.create_if_not_exists( :locale => 'de', :source => "in %s", :target => "in %s" )
+Translation.create_if_not_exists( :locale => 'de', :source => "Mark all as seen.", :target => "Alle als gelesen markieren." )
#Translation.create_if_not_exists( :locale => 'de', :source => "", :target => "" )
# install all packages in auto_install