{% extends "base.html" %} {% from "macros.html" import modal_editor, modal_editor_open, player_name_id %} {% block title %}PySkat - Results{% endblock %} {% block head %}{% endblock %} {% macro player_display(id) %} {{ id }} {{ players[id].name }} {% if id in results %} {% set r = results[id] %} {{ r.points }} {{ r.won }} {{ r.lost }} {{ r.remarks }}
{{ modal_editor_open("edit-result-{}".format(id), "Edit", "warning") }} {{ modal_editor_open("remove-result-{}".format(id), "Remove", "danger") }}
{% call modal_editor("edit-result-{}".format(id), url_for("results.update", series_id=series.id, player_id=id), "Edit Result", submit_label="Edit", submit_color="warning") %}
{% endcall %} {% call modal_editor("remove-result-{}".format(id), url_for("results.remove", series_id=series.id, player_id=id), "Remove Result", submit_label="Remove", submit_color="danger") %} Really remove the result for player {{ player_name_id(players[r.player_id]) }}? {% endcall %} {% else %} {{ modal_editor_open("add-result-{}".format(id), "Add Result", "success") }} {% call modal_editor("add-result-{}".format(id), url_for("results.add", series_id=series.id, player_id=id), "Add Result", submit_label="Add", submit_color="success") %}
{% endcall %} {% endif %} {% endmacro %} {% block content %}

Results

{% for t in tables %} {% set player_count = t.player_ids|length %} {{ player_display(t.player1_id) }} {{ player_display(t.player2_id) }}{{ player_display(t.player3_id) }} {% if t.player4_id %} {{ player_display(t.player4_id) }} {% endif %} {% endfor %}
Table ID Player ID Player Name Points Won Lost Remarks Actions
{{ t.table_id }}
{% endblock %}