]> git.openstreetmap.org Git - rails.git/blob - app/controllers/notifications_controller.rb
Merge remote-tracking branch 'upstream/pull/7283'
[rails.git] / app / controllers / notifications_controller.rb
1 # frozen_string_literal: true
2
3 class NotificationsController < ApplicationController
4   include PaginationMethods
5
6   LISTABLE_NOTIFICATIONS = %w[
7     ChangesetCommentNotifier::Notification
8     DiaryCommentNotifier::Notification
9     GpxImportFailureNotifier::Notification
10     GpxImportSuccessNotifier::Notification
11     NewFollowerNotifier::Notification
12     NoteCommentNotifier::Notification
13   ].freeze
14
15   layout :site_layout
16
17   before_action :authorize_web
18   before_action :set_locale
19
20   authorize_resource :class => false
21
22   before_action :check_database_readable
23
24   def index
25     notifications = current_user.notifications.where(:type => LISTABLE_NOTIFICATIONS)
26     @notifications = get_page_items(notifications)
27     @params = params.permit
28   end
29 end