X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/b5046fdcd02b7ae9c10f22fa0b483e6eb2e06fa3..b8da7922ec4194e61a1eebb43be787f8b55d1647:/app/controllers/notes_controller.rb diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb index 4c1bac193..440a620e8 100644 --- a/app/controllers/notes_controller.rb +++ b/app/controllers/notes_controller.rb @@ -33,5 +33,19 @@ class NotesController < ApplicationController end end + def show + @type = "note" + + if current_user&.moderator? + @note = Note.find(params[:id]) + @note_comments = @note.comments.unscope(:where => :visible) + else + @note = Note.visible.find(params[:id]) + @note_comments = @note.comments + end + rescue ActiveRecord::RecordNotFound + render :template => "browse/not_found", :status => :not_found + end + def new; end end