{% extends frame.html %}

{% block body %}

<div class="w3-container w3-blue">
  <h1>Usage since {{min_date}}</h1>
</div>

<table class="w3-table-all w3-responsive w3-medium">
  <tr>
      <th>Usage Name</th>
      <th>Usage Count</th>
      <th>Usage ms total</th>
      <th>Usage ms min</th>
      <th>Usage ms mean</th>
      <th>Usage ms max</th>
  </tr>

  {% for usage in usages %}
  <tr>
      <td>{{usage['usage_name']}}</td>
      <td class="w3-right-align">{{usage['usage_cnt']}}</td>
      <td class="w3-right-align">{{usage['usage_ms']}}</td>
      <td class="w3-right-align">{{usage['usage_ms_min']}}</td>
      <td class="w3-right-align">{{usage['usage_ms_mean']}}</td>
      <td class="w3-right-align">{{usage['usage_ms_max']}}</td>
  </tr>
  {% end %}

</table>

<br/><br/>

<div class="w3-container w3-blue">
  <h1>No Usage since {{min_date}}</h1>
</div>

<table class="w3-table-all w3-responsive w3-medium">
  <tr>
    <th>Usage Name</th>
    <th>Usage Count</th>
    <th>Usage ms total</th>
    <th>Usage ms min</th>
    <th>Usage ms mean</th>
    <th>Usage ms max</th>
  </tr>

  {% for usage_name in no_usage_list %}
  <tr>
    <td>{{usage_name}}</td>
    <td class="w3-right-align">0</td>
    <td class="w3-right-align">0</td>
    <td class="w3-right-align">0</td>
    <td class="w3-right-align">0</td>
    <td class="w3-right-align">0</td>
  </tr>
  {% end %}

</table>


{#

<form id="build_confirm" class="w3-card w3-padding" action="{{request.path}}" method="POST">
    {% raw xsrf_form_html() %}

    <p class="w3-medium">
        {% if build_step == 'deploy' %}
        Live version now: <br/>
        {{(live_build and live_build['version']) or 'Not Live'}} <br/>
        Deploying version: <br/>
        {{build_row['version']}} <br/>
        {% elif build_step == 'revert' %}
        Live version now: <br/>
        {{build_row['version']}} <br/>
        Deploying version: <br/>
        {{build_row['previous_version']}} <br/>
        {% end %}
    </p>
    
    <p>
        <label><b>{{build_step.capitalize()}} Message</b> {% if errors.get('message') %}<br/><span class="w3-text-red">{{errors['message']}}</span>{% end %}</label>
        <input class="w3-input {% if errors.get('message') %}w3-border w3-border-red{% end %}" type="text" name="message" value="" placeholder="[required]" />
    </p>

    <div class="w3-center w3-padding">
        <input type="submit" class="w3-button w3-blue w3-center" value="Confirm {{build_step.capitalize()}}"/>
        <br/><br/><a class="w3-right w3-text-blue" href="/admin/build">Cancel</a>
    </div>
    <br/>
</form>

<p>
    <label><b>Difference Between Versions</b></label>
    <ul class="w3-medium">
        {% for commit in commits %}
        <li>{{commit}}</li>
        {% end %}
    </ul>
</p>
#}

{% end %}
