]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/diary_entry_controller.rb
Fixed link to DiaryComments
[rails.git] / app / controllers / diary_entry_controller.rb
index 7c38e58a8a57eff382e43f6be231b66750a86ec0..ed5a640579b713d4f63683ad824f94cb5b3e04f4 100644 (file)
@@ -1,13 +1,13 @@
 class DiaryEntryController < ApplicationController
   layout "site", :except => :rss
 
-  before_filter :authorize_web
-  before_filter :set_locale
-  before_filter :require_user, :only => [:new, :edit, :comment, :hide, :hidecomment]
-  before_filter :lookup_this_user, :only => [:view, :comments]
-  before_filter :check_database_readable
-  before_filter :check_database_writable, :only => [:new, :edit]
-  before_filter :require_administrator, :only => [:hide, :hidecomment]
+  before_action :authorize_web
+  before_action :set_locale
+  before_action :require_user, :only => [:new, :edit, :comment, :hide, :hidecomment]
+  before_action :lookup_this_user, :only => [:view, :comments]
+  before_action :check_database_readable
+  before_action :check_database_writable, :only => [:new, :edit]
+  before_action :require_administrator, :only => [:hide, :hidecomment]
 
   def new
     @title = t "diary_entry.new.title"
@@ -152,6 +152,9 @@ class DiaryEntryController < ApplicationController
     @entry = @this_user.diary_entries.visible.where(:id => params[:id]).first
     if @entry
       @title = t "diary_entry.view.title", :user => params[:display_name], :title => @entry.title
+      if params[:comment_id]
+        @reported_comment = DiaryComment.where(id: params[:comment_id])
+      end
     else
       @title = t "diary_entry.no_such_entry.title", :id => params[:id]
       render :action => "no_such_entry", :status => :not_found
@@ -205,12 +208,6 @@ class DiaryEntryController < ApplicationController
     end
   end
 
-  ##
-  # is this list user specific?
-  def user_specific_list?
-    params[:friends] || params[:nearby]
-  end
-
   ##
   # decide on a location for the diary entry map
   def set_map_location