<div class="row-fluid">
	<div class="span1 hidden-phone"></div>
	<div class="span10">
		<ul id="msgops">
			<li>${h.link_to(_("Spam"), url(controller='messages', action='quarantine', section='spam'))}</li>
			<li>${h.link_to(_("Not Spam"), url(controller='messages', action='quarantine', section='policyblocked'))}</li>
			<li>${h.link_to(_("Quarantine"), url(controller='messages', action='quarantine'))}</li>
		</ul>
	</div>
	<div class="span1 hidden-phone"></div>
</div>
<div class="space-6"></div>
<div class="row-fluid">
	<div class="span1 hidden-phone"></div>
	<div class="span10">
		<table class="table table-bordered">
			<thead>
				<tr>
					<th>${_('Status')}</th>
					<th class="hidden-phone">${_('Message-ID')}</th>
					<th>${_('From address')}</th>
					<th class="hidden-phone">${_('To address')}</th>
					<th class="hidden-phone">${_('Errors')}</th>
				</tr>
			</thead>
			<tbody>
				% if c.finished:
				% for msg in c.results:
				<tr>
					<td>
						% if msg['errors']:
						<i class="icon-remove red"></i>
						% else:
						<i class="icon-ok green"></i>
						% endif
					</td>
					<td class="hidden-phone">${msg['message_id']}</td>
					<td>${msg['from_address']}</td>
					<td class="hidden-phone">${msg['to_address']}</td>
					<td class="hidden-phone">
						% for error in msg['errors']:
						${error[0]} : ${error[1]}<br />
						% endfor
					</td>
				</tr>
				% endfor
				% else:
				<tr>
					<td colspan="2" id="stateupdates">
					${h.portable_img('imgs/ajax-pager.gif', alt="")} ${_('The request is being processed. Current status: ')}<span id="status">${c.status}</span> <span id="percent">${c.completed}</span>%
					</td>
					<td colspan="3">
						<div id="progbar"></div>
					</td>
				</tr>
				% endif
			</tbody>
		</table>
	</div>
	<div class="span1 hidden-phone"></div>
</div>
<noscript>
	% if not c.finished:
	<meta http-equiv="refresh" content="5" />
	% endif
</noscript>


<%def name="headers()">\
${h.stylesheet_link(h.media_url() + 'css/vendor/progressbar.css')}
</%def>
<%def name="title()">\
${_('Messages :: Quarantine :: Bulk processing status')}
</%def>
<%def name="heading()">\
${_('Messages :: Quarantine :: Bulk processing status')}
</%def>
<%def name="submenu()">\
<div class="navbar navbar-static-top">
    <div class="navbar-inner">
        <div class="nav-collapse collapse">
            <ul class="nav navbar-nav">
                <li class="nav_item">${h.link_to(_('Full message list'), url(controller='messages', action='listing'))}</li>
				<li class="nav_item">${h.link_to(_('Quarantine'), url(controller='messages', action='quarantine'))}</li>
				<li class="nav_item">${h.link_to(_('Archive'), url(controller='messages', action='archive'))}</li>
            </ul>
        </div>
    </div>
</div>
</%def>
<%def name="localscripts()">\
<script type="text/javascript">
var should_run = ${'true' if not c.finished else 'false'};
</script>
${h.javascript_link(h.media_url() + 'js/vendor/jquery.progressbar.min.js',
h.media_url() + 'js/baruwa/messages.taskstatus.min.js')}
</%def>
<%inherit file="../base.html"/>
