automatic sorting for easy shoppin
This commit is contained in:
13
shop.py
13
shop.py
@@ -162,7 +162,8 @@ def show_shop(shopid):
|
||||
shared_to.append(get_username(row[1]))
|
||||
return render_template('show_shop.html', entries=entries, shop=shopname,
|
||||
shopid=shopid, content=content,shares=shared_to,
|
||||
date=get_shop_date(shopid),date_bkp=get_shop_backup_date(shopid))
|
||||
date=get_shop_date(shopid),date_bkp=get_shop_backup_date(shopid),
|
||||
autosort=session['sort_view'])
|
||||
|
||||
@app.route('/')
|
||||
def list_shops():
|
||||
@@ -419,6 +420,14 @@ def remove_shop():
|
||||
flash('successfully deleted shop %s'%(shopname))
|
||||
return redirect(url_for('list_shops'))
|
||||
|
||||
@app.route('/sort_flip',methods=['POST'])
|
||||
def sort_flip():
|
||||
if not session.get('sort_view'):
|
||||
session['sort_view']=True
|
||||
else:
|
||||
session['sort_view']=False
|
||||
shopid=int(request.form['shopid'])
|
||||
return redirect(url_for('show_shop',shopid=shopid))
|
||||
|
||||
@app.route('/login', methods=['GET', 'POST'])
|
||||
def login():
|
||||
@@ -481,8 +490,6 @@ def profile():
|
||||
return redirect(url_for('profile'))
|
||||
return render_template('profile.html', error=error,user=user)
|
||||
|
||||
|
||||
|
||||
@app.route('/logout')
|
||||
def logout():
|
||||
session.pop('logged_in', None)
|
||||
|
||||
Reference in New Issue
Block a user