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


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

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

#destroyObject


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

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

#indexObject


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

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