Packages grid/list view are different controller actions now
This commit is contained in:
parent
1c59a5ac74
commit
f940e96014
6 changed files with 32 additions and 31 deletions
|
|
@ -19,17 +19,18 @@ class PackagesController < ApplicationController
|
|||
@packages = @packages.without_screenshots
|
||||
logger.debug 'Limiting packages to those without screenshots'
|
||||
end
|
||||
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
|
||||
def list
|
||||
index
|
||||
@packages = @packages.paginate(page: params[:page], per_page: 12)
|
||||
render 'packages/index-list.slim'
|
||||
end
|
||||
|
||||
def grid
|
||||
index
|
||||
@packages = @packages.paginate(page: params[:page], per_page: 24)
|
||||
render 'packages/index-grid.slim'
|
||||
end
|
||||
|
||||
def details
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue