{% extends "layout.html" %}
{% set title = "Task in progress" %}


{% block header %}
  <div id="header" style="background-position: center bottom">
    <div class="container">
        <h1 class="display-1 fw-lighter">Processing...</h1>
    </div>
  </div>
{% endblock %}


{% block container %}

<div class="container">
    <div class="row mt-5 mb-5">
        <div class="col-6">
            <div class="progress">
                {% if total and total > 1 %}
                  {% if completed > 0 %}
                    <div class="progress-bar bg-success progress-bar-striped progress-bar-animated" role="progressbar" style="width: {{ completed / total * 100}}%;">
                        {{ completed }} / {{ total }}
                    </div>
                  {% else %}
                    <div class="progress-bar bg-info" role="progressbar" style="width: 100%;">
                        Tasks are waiting in queue...
                    </div>
                  {% endif %}
                {% elif running %}
                <div class="progress-bar progress-bar-striped bg-success progress-bar-animated" role="progressbar" style="width: 100%">
                    Task is in progress...
                </div>
                {% else %}
                <div class="progress-bar bg-info" role="progressbar" style="width: 100%">
                    Task is waiting in queue...
                </div>
                {% endif %}
            </div>
        </div>
    </div>
</div>
<script>
setTimeout(function(){location.reload()}, 2000)
</script>

{% endblock %}