X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/b92c699a66fcf6433915ca7771206c61de205a67..49fc17c6b6f60eba8737fcde85bd679d1b6de8c1:/app/controllers/diary_entries_controller.rb diff --git a/app/controllers/diary_entries_controller.rb b/app/controllers/diary_entries_controller.rb index 1e113e09f..58671652f 100644 --- a/app/controllers/diary_entries_controller.rb +++ b/app/controllers/diary_entries_controller.rb @@ -157,7 +157,7 @@ class DiaryEntriesController < ApplicationController @page = (params[:page] || 1).to_i @page_size = 20 - @entries = @entries.visible + @entries = @entries.visible unless current_user&.administrator? @entries = @entries.order("created_at DESC") @entries = @entries.offset((@page - 1) * @page_size) @entries = @entries.limit(@page_size) @@ -214,6 +214,12 @@ class DiaryEntriesController < ApplicationController redirect_to :action => "index", :display_name => entry.user.display_name end + def unhide + entry = DiaryEntry.find(params[:id]) + entry.update(:visible => true) + redirect_to :action => "index", :display_name => entry.user.display_name + end + def hidecomment comment = DiaryComment.find(params[:comment]) comment.update(:visible => false)