/*
   This JavaScript code was generated by Jemplate, the JavaScript
   Template Toolkit. Any changes made to this file will be lost the next
   time the templates are compiled.

   Copyright 2006 - Ingy döt Net - All rights reserved.
*/

if (typeof(Jemplate) == 'undefined')
    throw('Jemplate.js must be loaded before any Jemplate template files');

Jemplate.templateMap['progress.jmpl'] = function(context) {
    if (! context) throw('Jemplate function called without context\n');
    var stash = context.stash;
    var output = '';

    try {
output += '<span class="progressmeter">\n  <div class="meter">\n    <div class="amount"  style="width: ';
//line 3 "progress.jmpl"
output += stash.get('percent');
output += '%;"></div>\n    <div class="percent" style="width: 100%">';
//line 4 "progress.jmpl"
output += stash.get('percent');
output += '%</div>\n  </div>\n  <table>\n    <tbody>\n      <tr>\n        <th>Status:</th>\n        <td>\n';
//line 17 "progress.jmpl"
if (stash.get('finished')) {
output += '          <span class="finished">Transfer complete  (';
//line 12 "progress.jmpl"
output += stash.get('size');
output += ')</span>\n';
}
else if (stash.get('aborted')) {
output += '          <span class="aborted">Transfer aborted</span>\n';
}
else {
output += '          ';
//line 16 "progress.jmpl"
output += stash.get('received');
output += ' of ';
//line 16 "progress.jmpl"
output += stash.get('size');
output += '\n';
}

output += '        </td>\n      </tr>\n';
//line 29 "progress.jmpl"
if (stash.get('starttime')) {
output += '      <tr>\n        <th>Time:</th>\n        <td>';
//line 23 "progress.jmpl"
output += stash.get('elapsedtime');
output += ' (~ ';
//line 23 "progress.jmpl"
output += stash.get('remainingtime');
output += ' to go)</td>\n      </tr>\n      <tr>\n        <th>Rate:</th>\n        <td>';
//line 27 "progress.jmpl"
output += stash.get('currentrate');
output += ' (avg ';
//line 27 "progress.jmpl"
output += stash.get('rate');
output += ')</td>\n      </tr>\n';
}

output += '    </tbody>\n  </table>\n</span>\n';
    }
    catch(e) {
        var error = context.set_error(e, output);
        throw(error);
    }

    return output;
}

