<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Maps</title>
        <meta name="Description" content="Insurgency Map Overview">
	{% include "default_head_content.html" %}
    </head>
    <body class="bg-special">
        {% include 'navbar.html' %}
        <div class="container mt-3 mb-3" role="main">
            <table id="tableMain" class="table table-striped table-bordered table-sm" 
                    cellspacing="0" width="100%">
                <thead>
                    <tr>
                        <th class="th-sm font-weight-bold">Map</th>
                        <th class="th-sm font-weight-bold">Games Played</th>
                        <th class="th-sm font-weight-bold">Insurgent Win</th>
                        <th class="th-sm font-weight-bold">Security Win</th>
                        <th class="th-sm font-weight-bold">Average Time</th>
                        <th class="th-sm font-weight-bold">Rating System Performance</th>
                    </tr>
                </thead>
                <tbody>
                {% for m in maps %}
		    <tr>
                       <td>{{ m.mapName }}</td>
                       <td>{{ m.totalGames }}</td>
                       <td>{{ '%0.2f' | format(m.insurgentWinPercent) }}%</td>
                       <td>{{ '%0.2f' | format(m.securityWinPercent) }}%</td>
                       <td>{{ m.averageTime }}</td>
		       {% if m.ratingSystemDeviation == 0 or m.predictionCorrectPercentage == 0%}
                       <td style="color: grey;">N/A</td>
                       {% elif m.ratingSystemDeviation >= 0 %}
                       <td style="color: green;">
			   +{{ '%0.2f' | format(m.ratingSystemDeviation) }}%
			   ({{ m.predictionCorrectPercentage }}% Correct)
                       </td>
                       {% else %}
                       <td style="color: red;">
                           {{ '%0.2f' | format(m.ratingSystemDeviation) }}%
			   ({{ m.predictionCorrectPercentage }}% Correct)
                       </td>
                       {% endif %}
                    </tr>
		    {# <!--
			{{ m.confidence }}
			{{ m.predictions }}
		    --> #}
                {% endfor %}
                </tbody>
            </table>
	  <div class="mt-2 pt-3 mb-2">
		<small>
		   *Map Tracking was only implemented recently, that is why there are many rounds without a recorded mapname.
		</small>
	  </div>
        </div>
        {% include 'footer.html' %}
        <script defer>
            $(document).ready(function () {
                $('#tableMain').DataTable();
                $('.dataTables_length').addClass('bs-select');
            });
        </script>
    </body>
</html>
