diff --git a/.gitignore b/.gitignore index 78e3215..04b2c29 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ app/cache/* property_files/* *.log app/settings.py +*.exe diff --git a/app/main.py b/app/main.py index df3103a..485a48c 100644 --- a/app/main.py +++ b/app/main.py @@ -1,7 +1,7 @@ from flask import render_template, Blueprint, send_from_directory -from flask_user import current_user +from flask_user import current_user, login_required -from app.models import Account +from app.models import Account, CharacterInfo, ActivityLog from app.schemas import AccountSchema, CharacterInfoSchema main_blueprint = Blueprint('main', __name__) @@ -25,9 +25,24 @@ def index(): @main_blueprint.route('/about') +@login_required def about(): """About Page""" - return render_template('main/about.html.j2') + mods = Account.query.filter(Account.gm_level > 0).all() + online = 0 + chars = CharacterInfo.query.all() + for char in chars: + last_log = ActivityLog.query.with_entities( + ActivityLog.activity + ).filter( + ActivityLog.character_id == char.id + ).order_by(ActivityLog.id.desc()).first() + print(last_log) + if last_log: + if last_log[0] == 0: + online += 1 + + return render_template('main/about.html.j2', mods=mods, online=online) @main_blueprint.route('/favicon.ico') diff --git a/app/templates/header.html.j2 b/app/templates/header.html.j2 index 475eaf0..a801b4f 100644 --- a/app/templates/header.html.j2 +++ b/app/templates/header.html.j2 @@ -46,6 +46,11 @@ Properties {% endif %} + {% if current_user.is_authenticated and current_user.gm_level == 9 and config.REQUIRE_PLAY_KEY %} + {# Play Keys #} + Play Keys + {% endif %} + {% if current_user.is_authenticated and current_user.gm_level >= 2 %} Reports