Browse Source

Refresh time of the overview pages is now configurable.

pull/14/head
Rogier Neeleman 7 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' @@ -17,6 +17,9 @@ MAX_TIME = '3600'
# Time the players will be shown on the overview after there playtime is over
SHOW_TIME = '120'
# Refresh time for the scoreboard and highscore pages
REFRESH_TIME = '10'
# HTML text for the registration page:
REGISTRATION_DESK = 'You can find the registration desk in the center.'

5
nfgame.py

@ -21,6 +21,7 @@ app.config.update(dict( @@ -21,6 +21,7 @@ app.config.update(dict(
START_KEY = 'None',
MAX_TIME = '3600',
SHOW_TIME = '120',
REFRESH_TIME = '10',
SECRET_KEY = 'Very secret key!',
ADMIN_PASSWORD = 'changeme!'
))
@ -86,7 +87,7 @@ def index(): @@ -86,7 +87,7 @@ def index():
if found_tag == tag:
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')
def highscores():
@ -120,7 +121,7 @@ def highscores(): @@ -120,7 +121,7 @@ def highscores():
if found_tag == tag:
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/<string:newhash>/', methods=['GET', 'POST'])

2
templates/layout-overview.html

@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
<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-icons.min.js') }}"></script>
<meta http-equiv="refresh" content="10">
<meta http-equiv="refresh" content="{{ refresh }}">
</head>
<body>
<div>

Loading…
Cancel
Save