{% extends "sabnzbd-base.html" %}

{% block sabnzbd_content %}
  <div class="status" id="status" status="{{ sabnzbd.paused }}" title="Toggle paused/downloading">
    {{ sabnzbd.status }}
    <img class="pause_arrow" src="{{ url_for('static', filename='images/arrow_down.png') }}">
    <ul class="pause_list">
      <li>Pause for: </li>
      <li class="pause_time" data-time="5">5 minutes</li>
      <li class="pause_time" data-time="15">15 minutes</li>
      <li class="pause_time" data-time="30">30 minutes</li>
      <li class="pause_time" data-time="60">1 hour</li>
      <li class="pause_time" data-time="180">3 hours</li>
      <li class="pause_time" data-time="360">6 hours</li>
      <li class="pause_for">Other...</li>
    </ul>
  </div>
  <div class="speed"><input type="text" value="{{ download_speed[:-4] }}" title="Adjust Speed" size="5"/>{{ download_speed[-4:] }}</div>

  {% if item %}
    <p>{{ item.filename }}</p>

    <div class="bar">
      <div class="inner" style="width: {{ item.percentage }}%;"></div>
    </div>

    <div class="clearfix">
      <p class="remaining"><strong>Remaining:</strong> {{ item.timeleft }} / {{ item.mbleft }} MB</p>
      <p class="percentage_complete">{{ item.percentage }}% complete</p>
    </div>
{% endif %}

<div class="queue-title {% if not item %}hide{% endif %}">
	<table width=100%>
		<tr>
			<td align=left><b>Total Remaining:</b> {{sabnzbd.timeleft}} / {{sabnzbd.sizeleft}}</td>
			<td align=right><span>
				{% if queue_status == 'hide' %} <img src="{{ url_for('static', filename='images/arrow_down.png')}}">More
				{% else %} <img	src="{{ url_for('static', filename='images/arrow_up.png') }}">Less
				{% endif %}
			</span></td>
		</tr>
	</table>
</div>

<div class="queue {% if item %}{{ queue_status }}{% else %}show{% endif %}">
    <table>
    {% for x in sabnzbd.slots %}
      <tr id="{{x.nzo_id}}" data-action={% if x.status == 'Paused' %}resume{% else %}pause{% endif %}>
        <td class="pause"><img src="{% if x.status == 'Paused' %}{{ url_for('static', filename='images/pause.png') }}{% else %}{{ url_for('static', filename='images/play.png') }}{% endif %}" ></td>
        <td class="name">{{x.filename}}</td>
        <td class="size">{{x.size}}</td>
        <td class="delete"><img src="{{ url_for('static', filename='images/remove_icon.png') }}" ></td>
      </tr>
    {% endfor %}
    </table>
  </div>
{% endblock %}
