mirror of
https://github.com/NaN-tic/flask-galatea_tutorial.git
synced 2023-12-13 20:50:13 +01:00
Grid/List view
This commit is contained in:
parent
ba34cd11d9
commit
7005b348d1
1 changed files with 21 additions and 0 deletions
21
tutorial.py
21
tutorial.py
|
@ -222,6 +222,13 @@ def key(lang, key):
|
|||
abort(404)
|
||||
website, = websites
|
||||
|
||||
# view
|
||||
if request.args.get('view'):
|
||||
view = 'list'
|
||||
if request.args.get('view') == 'grid':
|
||||
view = 'grid'
|
||||
session['tutorial_view'] = view
|
||||
|
||||
try:
|
||||
page = int(request.args.get('page', 1))
|
||||
except ValueError:
|
||||
|
@ -291,6 +298,13 @@ def users(lang, user):
|
|||
abort(404)
|
||||
user, = users
|
||||
|
||||
# view
|
||||
if request.args.get('view'):
|
||||
view = 'list'
|
||||
if request.args.get('view') == 'grid':
|
||||
view = 'grid'
|
||||
session['tutorial_view'] = view
|
||||
|
||||
try:
|
||||
page = int(request.args.get('page', 1))
|
||||
except ValueError:
|
||||
|
@ -351,6 +365,13 @@ def tutorials(lang):
|
|||
abort(404)
|
||||
website, = websites
|
||||
|
||||
# view
|
||||
if request.args.get('view'):
|
||||
view = 'list'
|
||||
if request.args.get('view') == 'grid':
|
||||
view = 'grid'
|
||||
session['tutorial_view'] = view
|
||||
|
||||
try:
|
||||
page = int(request.args.get('page', 1))
|
||||
except ValueError:
|
||||
|
|
Loading…
Reference in a new issue