Small reformat
This commit is contained in:
parent
38843173d5
commit
7ca0e36946
3 changed files with 22 additions and 15 deletions
|
@ -1,20 +1,23 @@
|
||||||
__author__ = 'feliciaan'
|
|
||||||
|
|
||||||
from flask import url_for, render_template, abort, redirect, request, abort
|
|
||||||
from flask.ext.login import current_user, login_required
|
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
from app import app, db
|
from flask import url_for, render_template, abort
|
||||||
from models import Order, OrderItem, Location
|
from flask.ext.login import login_required
|
||||||
|
|
||||||
|
from app import app
|
||||||
|
from models import Order, Location
|
||||||
|
|
||||||
# import views
|
# import views
|
||||||
from views.order import get_orders
|
from views.order import get_orders
|
||||||
|
from views import stats
|
||||||
|
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def home():
|
def home():
|
||||||
prev_day = datetime.now() - timedelta(days=1)
|
prev_day = datetime.now() - timedelta(days=1)
|
||||||
recently_closed = get_orders(((Order.stoptime > prev_day) & (Order.stoptime < datetime.now())))
|
recently_closed = get_orders(
|
||||||
return render_template('home.html', orders=get_orders(), recently_closed=recently_closed)
|
((Order.stoptime > prev_day) & (Order.stoptime < datetime.now())))
|
||||||
|
return render_template('home.html', orders=get_orders(),
|
||||||
|
recently_closed=recently_closed)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/location')
|
@app.route('/location')
|
||||||
|
@ -30,15 +33,12 @@ def location(id):
|
||||||
abort(404)
|
abort(404)
|
||||||
return render_template('location.html', location=loc)
|
return render_template('location.html', location=loc)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/about/')
|
@app.route('/about/')
|
||||||
def about():
|
def about():
|
||||||
return render_template('about.html')
|
return render_template('about.html')
|
||||||
|
|
||||||
|
|
||||||
@app.route('/stats/')
|
|
||||||
def stats():
|
|
||||||
return render_template('stats.html')
|
|
||||||
|
|
||||||
@app.route('/profile/')
|
@app.route('/profile/')
|
||||||
@login_required
|
@login_required
|
||||||
def profile():
|
def profile():
|
||||||
|
|
7
app/views/stats.py
Normal file
7
app/views/stats.py
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
from app import app
|
||||||
|
from flask import render_template
|
||||||
|
|
||||||
|
|
||||||
|
@app.route('/stats/')
|
||||||
|
def stats():
|
||||||
|
return render_template('stats.html')
|
Loading…
Reference in a new issue