<!--#set global $topmenu="queue"#-->
<!--#set global $have_refresh=$refresh_rate#-->
<!--#set global $statpath=".."#-->
<!--#set global $helpsubject="GUI+Queue"#-->
<!--#include $webdir + "/inc_top.tmpl"#-->

<span class="SubMenu">
<!--#if $paused#-->
  <a href="./resume?session=$session">$T('link-resume')</a>
<!--#else#-->
  <a href="./pause?session=$session">$T('link-pause')</a>
<!--#end if#-->|
<a href="./sort_by_name?session=$session">$T('link-sortByName')</a> |
<a href="./sort_by_avg_age?session=$session">$T('link-sortByAge')</a> |
<a href="./sort_by_size?session=$session">$T('link-sortBySize')</a> |
<!--#if $isverbose#-->
  <a href="./tog_verbose?session=$session">$T('link-hideFiles')</a>
<!--#else#-->
  <a href="./tog_verbose?session=$session">$T('link-showFiles')</a>|
<!--#end if#-->
$T('onQueueFinish'):
<select onChange="location = './change_queue_complete_action?action='+this.options[this.selectedIndex].value+'&session=$session'">
<option value=""></option>
  <optgroup label="$T('eoq-actions')">
    <!--#if $power_options#-->
    <option value="shutdown_pc" <!--#if $finishaction == 'shutdown_pc' then 'selected' else ''#-->>$T('shutdownPc')</option>
    <option value="standby_pc" <!--#if $finishaction == 'standby_pc' then 'selected' else ''#-->>$T('standbyPc')</option>
    <option value="hibernate_pc" <!--#if $finishaction == 'hibernate_pc' then 'selected' else ''#-->>$T('hibernatePc')</option>
    <!--#end if#-->
    <option value="shutdown_program" <!--#if $finishaction == 'shutdown_program' then 'selected' else ''#-->>$T('shutdownSab')</option>
  </optgroup>
<!--#if $script_list#-->
  <optgroup label="$T('eoq-scripts')">
  <!--#for $sc in $script_list#-->
    <!--#if $sc != 'None'#-->
    <option value="script_$sc" <!--#if $finishaction == 'script_'+$sc then 'selected' else ''#-->>$sc</option>
    <!--#end if#-->
  <!--#end for#-->
  </optgroup>
<!--#end if#-->
</select>
| $T('speedLimit'):
<input id="speedbox" type="text" value="$speedlimit" onChange="location = './set_speedlimit?session=$session&value='+this.value">&nbsp;$T('KBs')
| $T('pauseFor'):
<input id="speedbox" type="text" size=5 value="" onChange="location = './set_pause?session=$session&value='+this.value">&nbsp;$T('minute')
|
<a href="./purge?session=$session" onclick="return confirm('$T('purgeQueueConf').replace("'","`") ');">$T('purgeQueue')</a>
</span>

<br>
<br>
<!--#if $varExists('slots')#-->
  <table id="queueTable">
    <tr> <th></th><th></th><th>$T('order')</th>
      <!--#if $cat_list#--><th>$T('category')</th><!--#end if#-->
      <th>$T('mode')</th><th>$T('priority')</th>
      <!--#if $script_list#--><th>$T('script')</th><!--#end if#-->
      <th>$T('name')</th><th>$T('remainTotal')</th><th>$T('eta')</th><th>$T('age')</th>
    </tr>
  <!--#set $odd = False#-->
  <!--#for $slot in $slots#-->
    <!--#set $odd = not $odd#-->
    <tr class="<!--#if $odd then "odd" else "even"#--> $slot.priority $slot.status">
    <td><a class="verbosity_link" href="./tog_uid_verbose?session=$session&uid=$slot.nzo_id"> <!--#if $slot.active then "-" else "+" #--> </a></td>
    <td>
      <input type="submit" onclick="if (confirm('$T('delFiles').replace("'","`") ')) window.location='delete?uid=$slot.nzo_id&del_files=1&session=$session'; else window.location='delete?uid=$slot.nzo_id&del_files=0&session=$session'; return false;" value="$T('button-del')">
      <!--#if $slot.status == 'Paused'#-->
        <form action="resume_nzo" method="get">
        <input type="hidden" value="$slot.nzo_id" name="uid">
        <input type="hidden" value="$session" name="session">
        <input type="submit" value="$T('button-resume')"></form>
      <!--#else#-->
        <form action="pause_nzo" method="get">
        <input type="hidden" value="$slot.nzo_id" name="uid">
        <input type="hidden" value="$session" name="session">
        <input type="submit" value="$T('button-pause')"></form>
      <!--#end if#-->
      <td><form><select onchange="location = this.options[this.selectedIndex].value;">
      <!--#for $i in xrange($noofslots)#-->
        <option value="switch?session=$session&uid1=$slot.nzo_id&uid2=$slots[i].nzo_id" <!--#if $i == $slot.index then "selected" else ""#-->>$i</option>
      <!--#end for#-->
      </select></form></td>
      <!--#if $cat_list#-->
      <td><form><select onchange="location = this.options[this.selectedIndex].value;">
        <!--#for $ct in $cat_list#-->
          <option value="change_cat?session=$session&nzo_id=$slot.nzo_id&cat=$ct" <!--#if $slot.cat.lower() == $ct.lower() then "selected" else ""#-->>$Tspec($ct)</option>
        <!--#end for#-->
        </select></form>
      </td>
      <!--#end if#-->
      <td><form><select onchange="location = this.options[this.selectedIndex].value;">
        <option value="change_opts?session=$session&nzo_id=$slot.nzo_id&pp=0" <!--#if $slot.unpackopts == "0" then "selected" else ""#-->></option>
        <option value="change_opts?session=$session&nzo_id=$slot.nzo_id&pp=1" <!--#if $slot.unpackopts == "1" then "selected" else ""#-->>$T('pp-r')</option>
        <option value="change_opts?session=$session&nzo_id=$slot.nzo_id&pp=2" <!--#if $slot.unpackopts == "2" then "selected" else ""#-->>$T('pp-u')</option>
        <option value="change_opts?session=$session&nzo_id=$slot.nzo_id&pp=3" <!--#if $slot.unpackopts == "3" then "selected" else ""#-->>$T('pp-d')</option>
        </select></form>
      </td>
      <td>
      <!--#if $slot.priority#-->
      <form>
      <select onchange="location = this.options[this.selectedIndex].value;">
        <option value="set_priority?session=$session&nzo_id=$slot.nzo_id&priority=2" <!--#if $slot.priority == "Force" then "selected" else ""#-->>$T('pr-force')</option>
        <option value="set_priority?session=$session&nzo_id=$slot.nzo_id&priority=1" <!--#if $slot.priority == "High" then "selected" else ""#-->>$T('pr-high')</option>
        <option value="set_priority?session=$session&nzo_id=$slot.nzo_id&priority=0" <!--#if $slot.priority == "Normal" then "selected" else ""#-->>$T('pr-normal')</option>
        <option value="set_priority?session=$session&nzo_id=$slot.nzo_id&priority=-1" <!--#if $slot.priority == "Low" then "selected" else ""#-->>$T('pr-low')</option>
        <option value="set_priority?session=$session&nzo_id=$slot.nzo_id&priority=-4" <!--#if $slot.priority == "Stop" then "selected" else ""#-->>$T('pr-stop')</option>
      </select></form>
      <!--#end if#-->
      </td>
      <!--#if $script_list#-->
      <td><form><select onchange="location = this.options[this.selectedIndex].value;">
        <!--#for $sc in $script_list#-->
          <option value="change_script?session=$session&nzo_id=$slot.nzo_id&script=$sc" <!--#if $slot.script == $sc then "selected" else ""#-->>$Tspec($sc)</option>
        <!--#end for#-->
        </select></form>
      </td>
      <!--#end if#-->
      <td><a href="../nzb/$slot.nzo_id/">$slot.filename</a></td>
      <td class="pre">$slot.sizeleft/$slot.size</td>
      <td>$slot.eta</td>
      <td>$slot.avg_age</td>
    </tr>
    <!--#set $oddLine = False#-->
    <!--#for $line in $slot.finished#-->
      <!--#set $oddLine = not $oddLine#-->
      <tr class="<!--#if $oddLine then "oddLine" else "evenLine"#--> finished"><td></td><td></td><td>Finished</td><td></td><!--#if $cat_list#--><td></td><!--#end if#--><td></td><!--#if $script_list#--><td></td><!--#end if#--><td>$line.filename</td><td class="pre">$line.mbleft/$line.mb MB<td></td><td>$line.age</td></tr>
    <!--#end for#-->
    <!--#set $oddLine = False#-->
    <!--#for $line in $slot.active#-->
      <!--#set $oddLine = not $oddLine#-->
      <tr class="<!--#if $oddLine then "oddLine" else "evenLine"#--> active"><td></td><td><a class="remove" href="./removeNzf?session=$session&nzo_id=$slot.nzo_id&nzf_id=$line.nzf_id">Remove</a></td><td>Active</td><td></td><!--#if $cat_list#--><td></td><!--#end if#--><td></td><!--#if $script_list#--><td></td><!--#end if#--><td>$line.filename</td><td class="pre">$line.mbleft/$line.mb MB</td><td></td><td>$line.age</td></tr>
    <!--#end for#-->
    <!--#set $oddLine = False#-->
    <!--#for $line in $slot.queued#-->
      <!--#set $oddLine = not $oddLine#-->
      <tr class="<!--#if $oddLine then "oddLine" else "evenLine"#--> waiting"><td></td></td><td><td>Waiting</td><td></td><!--#if $cat_list#--><td></td><!--#end if#--><td></td><!--#if $script_list#--><td></td><!--#end if#--><td>$line.filename (set: $line.set)</td><td class="pre">$line.mbleft/$line.mb MB<td></td><td>$line.age</td></tr>
    <!--#end for#-->
  <!--#end for#-->
  </table>
<!--#end if#-->

<!--#include $webdir + "/inc_bottom.tmpl"#-->
