X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/b70da7b8ea15ab48bb2f34155567cea6dffc8fc9..7e5cbe87ed37f9cba8224fa4049047d7f981f66a:/app/controllers/diary_entries_controller.rb diff --git a/app/controllers/diary_entries_controller.rb b/app/controllers/diary_entries_controller.rb index 12f31bad2..467c4a38f 100644 --- a/app/controllers/diary_entries_controller.rb +++ b/app/controllers/diary_entries_controller.rb @@ -60,9 +60,8 @@ class DiaryEntriesController < ApplicationController @title = t "diary_entries.edit.title" @diary_entry = DiaryEntry.find(params[:id]) - if current_user != @diary_entry.user - redirect_to diary_entry_path(@diary_entry.user, @diary_entry) - elsif params[:diary_entry] && @diary_entry.update(entry_params) + if current_user != @diary_entry.user || + (params[:diary_entry] && @diary_entry.update(entry_params)) redirect_to diary_entry_path(@diary_entry.user, @diary_entry) else set_map_location @@ -235,6 +234,8 @@ class DiaryEntriesController < ApplicationController end def comments + @title = t ".title", :user => @user.display_name + conditions = { :user_id => @user } conditions[:visible] = true unless can? :unhidecomment, DiaryEntry