emails: add /emails index page.
Add emails index page at https://danbooru.donmai.us/emails. Mods can use this page to view and search emails belonging to users below mod level.
This commit is contained in:
@@ -1,8 +1,19 @@
|
||||
class EmailsController < ApplicationController
|
||||
respond_to :html, :xml, :json
|
||||
|
||||
def index
|
||||
@email_addresses = authorize EmailAddress.visible(CurrentUser.user).paginated_search(params, count_pages: true)
|
||||
@email_addresses = @email_addresses.includes(:user)
|
||||
respond_with(@email_addresses)
|
||||
end
|
||||
|
||||
def show
|
||||
@email_address = authorize EmailAddress.find_by_user_id!(params[:user_id])
|
||||
if params[:user_id]
|
||||
@email_address = authorize EmailAddress.find_by_user_id!(params[:user_id])
|
||||
else
|
||||
@email_address = authorize EmailAddress.find(params[:id])
|
||||
end
|
||||
|
||||
respond_with(@email_address)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user