Sha256: 8e92734e6f13d68dedd3a0bce0ce267fac6579f2893708e770f98f86c72976e7

Contents?: true

Size: 956 Bytes

Versions: 36

Compression:

Stored size: 956 Bytes

Contents

module Hyrax
  class NotificationsController < ApplicationController
    before_action :authenticate_user!
    with_themed_layout 'dashboard'

    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

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

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

    private

      def user_mailbox
        UserMailbox.new(current_user)
      end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
hyrax-2.9.6 app/controllers/hyrax/notifications_controller.rb
hyrax-2.9.5 app/controllers/hyrax/notifications_controller.rb
hyrax-2.9.4 app/controllers/hyrax/notifications_controller.rb
hyrax-2.9.3 app/controllers/hyrax/notifications_controller.rb
hyrax-2.9.2 app/controllers/hyrax/notifications_controller.rb
hyrax-2.9.1 app/controllers/hyrax/notifications_controller.rb
hyrax-2.9.0 app/controllers/hyrax/notifications_controller.rb
hyrax-2.8.0 app/controllers/hyrax/notifications_controller.rb
hyrax-2.7.2 app/controllers/hyrax/notifications_controller.rb
hyrax-2.7.1 app/controllers/hyrax/notifications_controller.rb
hyrax-2.7.0 app/controllers/hyrax/notifications_controller.rb
hyrax-2.6.0 app/controllers/hyrax/notifications_controller.rb
hyrax-3.0.0.pre.rc1 app/controllers/hyrax/notifications_controller.rb
hyrax-3.0.0.pre.beta3 app/controllers/hyrax/notifications_controller.rb
hyrax-2.5.1 app/controllers/hyrax/notifications_controller.rb
hyrax-2.5.0 app/controllers/hyrax/notifications_controller.rb
hyrax-3.0.0.pre.beta2 app/controllers/hyrax/notifications_controller.rb
hyrax-2.4.1 app/controllers/hyrax/notifications_controller.rb
hyrax-3.0.0.pre.beta1 app/controllers/hyrax/notifications_controller.rb
hyrax-2.4.0 app/controllers/hyrax/notifications_controller.rb