diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb new file mode 100644 index 00000000..49d9e32c --- /dev/null +++ b/app/controllers/notifications_controller.rb @@ -0,0 +1,19 @@ +class NotificationsController < ApplicationController + def index + @notifications = current_user.mailbox.notifications + + respond_to do |format| + format.html + format.json { render json: @notifications.to_json } + end + end + + def show + @notification = current_user.mailbox.notifications.find_by(id: params[:id]) + + respond_to do |format| + format.html + format.json { render json: @notification.to_json } + end + end +end diff --git a/app/models/user.rb b/app/models/user.rb index 22072edc..e70114d5 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -110,4 +110,8 @@ class User < ApplicationRecord def settings=(val) self[:settings] = val end + + def mailboxer_email(object) + nil # email + end end diff --git a/app/views/notifications/index.html.erb b/app/views/notifications/index.html.erb new file mode 100644 index 00000000..9efae3d6 --- /dev/null +++ b/app/views/notifications/index.html.erb @@ -0,0 +1,18 @@ +<% content_for :title, 'Notifications | Metamaps' %> +<% content_for :mobile_title, 'Notifications' %> + +
+
+

Notifications

+ +
+
diff --git a/app/views/notifications/show.html.erb b/app/views/notifications/show.html.erb new file mode 100644 index 00000000..14aedd75 --- /dev/null +++ b/app/views/notifications/show.html.erb @@ -0,0 +1,12 @@ +<% content_for :title, 'Notifications | Metamaps' %> +<% content_for :mobile_title, 'Notifications' %> + +
+
+

<%= @notification.subject %>

+
+ <%= @notification.body %> +
+ <%= link_to 'Back', notifications_path %> +
+