32 lines
679 B
Ruby
32 lines
679 B
Ruby
class PackagesController < ApplicationController
|
|
def index
|
|
@packages = Package.includes(:screenshots)
|
|
|
|
if params[:search]
|
|
@packages = @packages.text_search(params[:search][:query])
|
|
end
|
|
|
|
#if params[:with_screenshots]=='yes'
|
|
# # Limit the packages to those that have approved screenshots.
|
|
# # Also eager-load the screenshots.
|
|
# @packages = @packages.where("screenshots.approved"=>true)
|
|
#end
|
|
|
|
@packages = @packages.page(params[:page]).per(12)
|
|
|
|
if params[:search][:display]=='list'
|
|
@view='list'
|
|
else
|
|
@view='grid'
|
|
end
|
|
end
|
|
|
|
def with_screenshots
|
|
end
|
|
|
|
def without_screenshots
|
|
end
|
|
|
|
def moderate
|
|
end
|
|
end
|