Fix filtering w.r.t finalists in web styling

Mutiple rows were colored similarly of some are hidden
This commit is contained in:
Christian Wolf 2023-10-06 18:17:37 +02:00
parent 6f11554c18
commit 1d69d9fe8a
3 changed files with 9 additions and 2 deletions

View File

@ -23,7 +23,8 @@ def main():
solo_turnier.flask.startFlask(
batchWorker,
debug=cli.getLogLevel() > 0,
port=cli.getPort()
port=cli.getPort(),
showOnlyFinalists=not cli.showAllParticipants()
)
else:
combinedData = batchWorker.run(

View File

@ -1,5 +1,8 @@
import flask
import solo_turnier
import logging
_l = logging.getLogger(__name__)
def startFlask(
batchWorker: solo_turnier.batch.BatchWorker,
@ -12,8 +15,9 @@ def startFlask(
@app.route('/')
def index():
combinedData = batchWorker.run(False)
_l.debug('Show only finalists %s', showOnlyFinalists)
return flask.render_template('index.html', data=combinedData)
return flask.render_template('index.html', data=combinedData, onlyFinalists=showOnlyFinalists)
@app.get('/custom.css')
def css():

View File

@ -28,6 +28,7 @@
{% if not participant.finalist %}
{% set rowCls = "no-finalist" %}
{% endif %}
{% if participant.finalist or not onlyFinalists %}
<tr class="{{ rowCls }}">
<td>{{ participant.name }} ({{ participant.id }})</td>
{% for dance in data.results[group].dances %}
@ -47,6 +48,7 @@
{% endblock %}
{% endfor %}
</tr>
{% endif %}
{% endblock %}
{% endfor %}
</table>