Add season codes and overview page.
This commit is contained in:
18
app.py
18
app.py
@@ -66,11 +66,7 @@ def logout():
|
||||
@app.route('/')
|
||||
@authorize
|
||||
def landing():
|
||||
if 'editor' in session['role']:
|
||||
print('editor')
|
||||
else:
|
||||
print('not editor')
|
||||
return render_template('seasons.html')
|
||||
return redirect('/seasons')
|
||||
|
||||
|
||||
@app.route('/seasons')
|
||||
@@ -81,6 +77,7 @@ def seasons():
|
||||
model = {
|
||||
'seasons': results,
|
||||
'columns': [
|
||||
('code', '#'),
|
||||
('game', 'Game'),
|
||||
('description', 'Season Description'),
|
||||
('start', 'Started At'),
|
||||
@@ -117,6 +114,17 @@ def save_season():
|
||||
return redirect('/seasons')
|
||||
|
||||
|
||||
@app.route('/seasons/<id>', methods=['GET'])
|
||||
@authorize
|
||||
def season_overview(id: int):
|
||||
sql, args = db.load_season(id)
|
||||
db_season = db.query_db(sql, args, one=True, cls=models.Season)
|
||||
model = {
|
||||
'title': f'{db_season.code} {db_season.game}'
|
||||
}
|
||||
return render_template('seasonoverview.html', model=model)
|
||||
|
||||
|
||||
@app.route('/newplayer', methods=['GET'])
|
||||
@authorize
|
||||
def new_player():
|
||||
|
||||
Reference in New Issue
Block a user