diff --git a/src/main.py b/src/main.py index c904985..0ce475a 100644 --- a/src/main.py +++ b/src/main.py @@ -26,7 +26,9 @@ def main(): port=cli.getPort() ) else: - combinedData = batchWorker.run() + combinedData = batchWorker.run( + removeFilteredParicipants=not cli.showAllParticipants() + ) consoleOutputtter = solo_turnier.output.ConsoleOutputter() consoleOutputtter.output(combinedData) diff --git a/src/solo_turnier/batch.py b/src/solo_turnier/batch.py index 8260d63..99de611 100644 --- a/src/solo_turnier/batch.py +++ b/src/solo_turnier/batch.py @@ -29,7 +29,6 @@ class BatchWorker: importedData = worker.collectAllData(htmlCandidatesPreview, htmlResultFiles) combinedData = worker.combineData(importedData) - if not self.config.showAllParticipants(): - worker.filterOutFinalists(combinedData, removeFilteredParicipants) + worker.filterOutFinalists(combinedData, removeFilteredParicipants) return combinedData diff --git a/src/solo_turnier/flask.py b/src/solo_turnier/flask.py index 07cd199..84c977b 100644 --- a/src/solo_turnier/flask.py +++ b/src/solo_turnier/flask.py @@ -4,7 +4,8 @@ import solo_turnier def startFlask( batchWorker: solo_turnier.batch.BatchWorker, debug: bool = False, - port: int = 8082 + port: int = 8082, + showOnlyFinalists: bool = True ): app = flask.Flask(__name__) @@ -14,4 +15,12 @@ def startFlask( 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) diff --git a/src/solo_turnier/templates/custom.css b/src/solo_turnier/templates/custom.css new file mode 100644 index 0000000..7f8c2fa --- /dev/null +++ b/src/solo_turnier/templates/custom.css @@ -0,0 +1,5 @@ +{% if onlyFinalists %} +.no-finalist { + display: none; +} +{% endif %} diff --git a/src/solo_turnier/templates/index.html b/src/solo_turnier/templates/index.html index aadb5f9..055b30a 100644 --- a/src/solo_turnier/templates/index.html +++ b/src/solo_turnier/templates/index.html @@ -6,6 +6,7 @@ {# #} + {#

Finalauswertung Solo-Turniere

#}