Class: Hyrax::NotificationsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/hyrax/notifications_controller.rb

Instance Method Summary collapse

Instance Method Details

#delete_allObject


16
17
18
19
# File 'app/controllers/hyrax/notifications_controller.rb', line 16

def delete_all
  user_mailbox.delete_all
  redirect_to hyrax.notifications_path, alert: t('hyrax.mailbox.notifications_deleted')
end

#destroyObject


21
22
23
24
25
# File 'app/controllers/hyrax/notifications_controller.rb', line 21

def destroy
  message_id = params[:id]
  alert = user_mailbox.destroy(message_id)
  redirect_to hyrax.notifications_path, alert: alert
end

#indexObject


7
8
9
10
11
12
13
14
# File 'app/controllers/hyrax/notifications_controller.rb', line 7

def index
  add_breadcrumb t(:'hyrax.controls.home'), root_path
  add_breadcrumb t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path
  add_breadcrumb t(:'hyrax.admin.sidebar.notifications'), hyrax.notifications_path
  @messages = user_mailbox.inbox
  # Update the notifications now that there are zero unread
  StreamNotificationsJob.perform_later(current_user)
end