Browse Source

Refresh time of the overview pages is now configurable.

pull/14/head
Rogier Neeleman 8 years ago
parent
commit
b37bff072b
  1. 3
      nfgame.cfg-example
  2. 5
      nfgame.py
  3. 2
      templates/layout-overview.html

3
nfgame.cfg-example

@ -17,6 +17,9 @@ MAX_TIME = '3600'
# Time the players will be shown on the overview after there playtime is over # Time the players will be shown on the overview after there playtime is over
SHOW_TIME = '120' SHOW_TIME = '120'
# Refresh time for the scoreboard and highscore pages
REFRESH_TIME = '10'
# HTML text for the registration page: # HTML text for the registration page:
REGISTRATION_DESK = 'You can find the registration desk in the center.' REGISTRATION_DESK = 'You can find the registration desk in the center.'

5
nfgame.py

@ -21,6 +21,7 @@ app.config.update(dict(
START_KEY = 'None', START_KEY = 'None',
MAX_TIME = '3600', MAX_TIME = '3600',
SHOW_TIME = '120', SHOW_TIME = '120',
REFRESH_TIME = '10',
SECRET_KEY = 'Very secret key!', SECRET_KEY = 'Very secret key!',
ADMIN_PASSWORD = 'changeme!' ADMIN_PASSWORD = 'changeme!'
)) ))
@ -86,7 +87,7 @@ def index():
if found_tag == tag: if found_tag == tag:
user[entry['id']][tag] = 'Found' user[entry['id']][tag] = 'Found'
return render_template('overview.html', entries=entries, tags=app.config['TAGS'], user=user, type='Current players') return render_template('overview.html', entries=entries, tags=app.config['TAGS'], user=user, type='Current players', refresh=app.config['REFRESH_TIME'])
@app.route('/highscores') @app.route('/highscores')
def highscores(): def highscores():
@ -120,7 +121,7 @@ def highscores():
if found_tag == tag: if found_tag == tag:
user[entry['id']][tag] = 'Found' user[entry['id']][tag] = 'Found'
return render_template('overview.html', entries=entries, tags=app.config['TAGS'], user=user, type='Highscores') return render_template('overview.html', entries=entries, tags=app.config['TAGS'], user=user, type='Highscores', refresh=app.config['REFRESH_TIME'])
@app.route('/newuser/', methods=['GET', 'POST']) @app.route('/newuser/', methods=['GET', 'POST'])
@app.route('/newuser/<string:newhash>/', methods=['GET', 'POST']) @app.route('/newuser/<string:newhash>/', methods=['GET', 'POST'])

2
templates/layout-overview.html

@ -6,7 +6,7 @@
<script src="{{ url_for('static', filename='js/jquery-min.js') }}"></script> <script src="{{ url_for('static', filename='js/jquery-min.js') }}"></script>
<script src="{{ url_for('static', filename='js/uikit.min.js') }}"></script> <script src="{{ url_for('static', filename='js/uikit.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/uikit-icons.min.js') }}"></script> <script src="{{ url_for('static', filename='js/uikit-icons.min.js') }}"></script>
<meta http-equiv="refresh" content="10"> <meta http-equiv="refresh" content="{{ refresh }}">
</head> </head>
<body> <body>
<div> <div>

Loading…
Cancel
Save