Mostly fixed the packages list, grid and detail views
This commit is contained in:
parent
43a8ea9dd3
commit
1c59a5ac74
7 changed files with 206 additions and 1 deletions
|
|
@ -12,7 +12,24 @@ class PackagesController < ApplicationController
|
|||
@packages = @packages.where("screenshots.approved"=>true)
|
||||
end
|
||||
|
||||
@packages = @packages.page(params[:page]).per(12)
|
||||
if params[:show]=='with'
|
||||
@packages = @packages.with_screenshots
|
||||
logger.debug 'Limiting packages to those with screenshots'
|
||||
elsif params[:show]=='without'
|
||||
@packages = @packages.without_screenshots
|
||||
logger.debug 'Limiting packages to those without screenshots'
|
||||
end
|
||||
|
||||
# Show packages as list or grid
|
||||
if params['view']=='list'
|
||||
# List view
|
||||
@packages = @packages.paginate(page: params[:page], per_page: 12)
|
||||
render 'packages/index-list.slim'
|
||||
else
|
||||
# Grid view
|
||||
@packages = @packages.paginate(page: params[:page], per_page: 24)
|
||||
render 'packages/index-grid.slim'
|
||||
end
|
||||
end
|
||||
|
||||
def details
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue