<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Rounds Played</title>
        <meta name="Description" content="Insurgency games played on the AtlantisHQ">
        {% include 'default_head_content.html' %}
    </head>
    <body class="bg-special">
        {% include 'navbar.html' %}
        <div class="container mt-3 mb-3" role="main">
            
            <div class="row">
                <div class="col-sm">
                    <h1>Round {{ r.id }}</h1>
                    <h4>{{ r.startTime }}</h4>
                    <h4>Map: {{ r.mapName }}</h4>
                    <h4>Duration: {{ r.duration }}</h4>

                    {% if r.invalid %}
                    <div>
                        <h5 style="color: red;">{{ r.invalid | safe }}</h5>
                    </div>
                    {% endif %}
                </div>
            </div>
            
            <hr>
            <div class="row">
                <div class="col-sm">
                    <h5>Winners ({{ r.winnerSideString }})</h5>
                </div>
                <div class="col-sm">
                    <h5>Losers ({{ r.loserSideString }})</h5>
                </div>
            </div>

            <div class="row">
                <div class="col-sm">
                    {% for p in r.winners %}
                    <div class="row">
                        <div class="col-sm" style="overflow: hidden;">
                            <a href="/player?id={{ p.playerId }}">{{ p.name }}</a>
                        </div>
                        <div class="col-sm">
                            {% if not r.invalid %}
                            <small style="color: green;">
                                {{ p.ratingChangeString | safe }}
                            </small>
                            {% endif %}
                        </div>
                    </div>
                    {% endfor %}
                </div>
                <div class="col-sm">
                    {% for p in r.losers %}
                    <div class="row">
                        <div class="col-sm" style="overflow: hidden;">
                            <a href="/player?id={{ p.playerId }}">{{ p.name }}</a>
                        </div>
                        <div class="col-sm">
                            {% if not r.invalid %}
                            <small style="color: red;">
                                {{ p.ratingChangeString | safe }}
                            </small>
                            {% endif %}
                        </div>
                    </div>
                    {% endfor %}
                </div>
            </div>
            <hr>
            <div class="mt-3">
                <small style="font-weight: bold;">Stats for nerds</small><br>
                <small>Balance: {{ 100 - r.confidence }}%</small><br>
            </div>
        </div>
        {% include 'footer.html' %}
    </body>
</html>
