Fix bug related to showing all participants

This commit is contained in:
Christian Wolf 2023-09-29 17:28:00 +02:00
parent 25135cc7d9
commit fac3fe1b34
5 changed files with 20 additions and 4 deletions

View File

@ -26,7 +26,9 @@ def main():
port=cli.getPort() port=cli.getPort()
) )
else: else:
combinedData = batchWorker.run() combinedData = batchWorker.run(
removeFilteredParicipants=not cli.showAllParticipants()
)
consoleOutputtter = solo_turnier.output.ConsoleOutputter() consoleOutputtter = solo_turnier.output.ConsoleOutputter()
consoleOutputtter.output(combinedData) consoleOutputtter.output(combinedData)

View File

@ -29,7 +29,6 @@ class BatchWorker:
importedData = worker.collectAllData(htmlCandidatesPreview, htmlResultFiles) importedData = worker.collectAllData(htmlCandidatesPreview, htmlResultFiles)
combinedData = worker.combineData(importedData) combinedData = worker.combineData(importedData)
if not self.config.showAllParticipants(): worker.filterOutFinalists(combinedData, removeFilteredParicipants)
worker.filterOutFinalists(combinedData, removeFilteredParicipants)
return combinedData return combinedData

View File

@ -4,7 +4,8 @@ import solo_turnier
def startFlask( def startFlask(
batchWorker: solo_turnier.batch.BatchWorker, batchWorker: solo_turnier.batch.BatchWorker,
debug: bool = False, debug: bool = False,
port: int = 8082 port: int = 8082,
showOnlyFinalists: bool = True
): ):
app = flask.Flask(__name__) app = flask.Flask(__name__)
@ -14,4 +15,12 @@ def startFlask(
return flask.render_template('index.html', data=combinedData) return flask.render_template('index.html', data=combinedData)
@app.get('/custom.css')
def css():
ret = flask.render_template(
'custom.css',
onlyFinalists=showOnlyFinalists
)
return flask.Response(ret, mimetype='text/css')
app.run(host='0.0.0.0', port=port, debug=debug) app.run(host='0.0.0.0', port=port, debug=debug)

View File

@ -0,0 +1,5 @@
{% if onlyFinalists %}
.no-finalist {
display: none;
}
{% endif %}

View File

@ -6,6 +6,7 @@
{# <meta name="description" content="Webpage for xxxx"> #} {# <meta name="description" content="Webpage for xxxx"> #}
<!-- http://meyerweb.com/eric/tools/css/reset/ --> <!-- http://meyerweb.com/eric/tools/css/reset/ -->
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
<link rel="stylesheet" href="/custom.css">
</head> </head>
<body> <body>
{# <h1>Finalauswertung Solo-Turniere</h1> #} {# <h1>Finalauswertung Solo-Turniere</h1> #}