My views improved. Own screenshots view added

This commit is contained in:
Christoph Haas 2021-03-09 22:43:50 +01:00
parent 15b58548cc
commit 0207d6b392
7 changed files with 93 additions and 39 deletions

View file

@ -5,19 +5,24 @@ class MyController < ApplicationController
# Show audit logs
def logs
@logs = Log.paginate(page: params[:page], per_page: 20)
render :logs
end
# Show the user's own uploaded screenshots
def screenshots
@screenshots = current_user.screenshots.paginate(page: params[:page], per_page: 10)
end
# def profile
# end
def uploads
# @current_users_screenshots gets filled in ApplicationController
#
# Get packages that the uploaded screenshots belong to.
@packages = Package.joins(:screenshots).where(
'screenshots.id' => @current_users_screenshots)
end
# def uploads
# # @current_users_screenshots gets filled in ApplicationController
# #
# # Get packages that the uploaded screenshots belong to.
# @packages = Package.joins(:screenshots).where(
# 'screenshots.id' => @current_users_screenshots)
# end
def moderate_list
# First package with pending screenshots