<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Leaderboard</title>
        <meta name="Description" content="Insurgency Leaderboard">
        <script src="static/buttons.js" defer></script>
        {% include "default_head_content.html" %}
    </head>
    <body class="bg-special">
        {% include 'navbar_leaderboard.html' %}

        <div class="container mt-3 mb-3" role="main">
            <table id="tableMain" class="table table-striped table-bordered table-sm"
                    cellspacing="0">
                <thead>
                    <tr>
                        <th class="th-sm font-weight-bold">Rank</th>
                        <th class="th-sm font-weight-bold">Player</th>
                        <th class="th-sm font-weight-bold">Games</th>
                        <th class="th-sm font-weight-bold">Rating</th>
                        <th class="th-sm font-weight-bold">Winratio %</th>
                    </tr>
                </thead>
                <tbody>
                    {% for p in playerList %}
                    {% set count = loop.index + start %}
                    <tr {% if searchName and searchName == p.name %} id="targetPlayer" {% endif %}>
                       <td>{% if doNotComputeRank %} {{ count }} {% else %} {{ p.rankStr }} {% endif %}</td>
                       <td><a href="/player?id={{ p.playerId }}">{{ p.name }}</a></td>
                       <td>{{ p.games }}</td>
                       <td>{{ p.rating }}</td>
                       <td>{{ p.winratio }}%</td>
		           </tr>
		           {% endfor %}
                </tbody>
            </table>    
	        {{ endOfBoardIndicator }}
        </div>

        {% if not doNotComputeRank %}
        <script defer>
            $(document).ready(function () {
                $('#tableMain').DataTable();
                $('.dataTables_length').addClass('bs-select');
            });
        </script>
        {% endif %}

    </body>
        {% include 'footer.html' %}
</html>
