Added route for /my_uploads
This commit is contained in:
parent
5c879d579c
commit
20cf3e0f10
2 changed files with 9 additions and 0 deletions
|
|
@ -203,6 +203,14 @@ class PackagesController < ApplicationController
|
|||
render '_reviews', layout: false
|
||||
end
|
||||
|
||||
def my_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
|
||||
|
||||
private
|
||||
|
||||
# Send a dummy thumbnail reading "No screenshot available. Sorry."
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ Debshots::Application.routes.draw do
|
|||
get 'packages/list' => 'packages#list', as: :packages_list
|
||||
get 'moderate' => 'moderate#index'
|
||||
get 'logs' => 'logs#index'
|
||||
get 'my_uploads' => 'packages#my_uploads'
|
||||
get 'package/:name' => 'packages#details', as: :package, name: /[^\/]+/
|
||||
get 'package_reviews/:name' => 'packages#reviews', as: :package_reviews, name: /[^\/]+/
|
||||
get 'upload', to: redirect('/packages'), as: :upload_legacy # legacy upload form
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue