<div class="row-fluid">
	<div class="span1 hidden-phone"></div>
	<div class="span10">
		<ul id="msgops">
		  	<li>${h.link_to(_('Inbound Queue'), url('mailq-status-directed', queue='inbound'))}</li>
		    <li>${h.link_to(_('Outbound Queue'), url('mailq-status-directed', queue='outbound'))}</li>
		    <li>${h.link_to(_('Preview message'), url('mailq-preview', queueid=c.mailqitem.id))}</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" id="msgdetail">
		<div class="row-fluid">
			<h3 class="head smaller lighter blue">${_('Message Details')}</h3>
		</div>
		<div class="row-fluid">
			<div class="span6 real-half">${_('Message ID')}</div>
			<div class="span6 real-half">${h.wrap_paragraphs(c.mailqitem.messageid, 60)}</div>
		</div>
		<div class="row-fluid">
			<div class="span6 real-half">${_('Received on')}</div>
			<div class="span6 real-half">${h.format_date(c.mailqitem.timestamp, c.tzinfo)}</div>
		</div>
		<div class="row-fluid">
			<div class="span6 real-half">${_('Subject')}</div>
			<div class="span6 real-half">${h.wrap_paragraphs(c.mailqitem.subject, 20) or '---'}</div>
		</div>
		<div class="row-fluid">
			<div class="span6 real-half">${_('From address')}</div>
			<div class="span6 real-half">${h.wrap_paragraphs(c.mailqitem.from_address, 20) or '---'}</div>
		</div>
		<div class="row-fluid">
			<div class="span6 real-half">${_('To address')}</div>
			<div class="span6 real-half">${h.wrap_paragraphs(h.do_breaks(c.mailqitem.to_address), 20)}</div>
		</div>
		<div class="row-fluid">
			<div class="span6 real-half">${_('From domain')}</div>
			<div class="span6 real-half">${c.mailqitem.from_domain or '---'}</div>
		</div>
		<div class="row-fluid">
			<div class="span6 real-half">${_('To domain')}</div>
			<div class="span6 real-half">${c.mailqitem.to_domain or '---'}</div>
		</div>
		<div class="row-fluid">
			<div class="span6 real-half">${_('Received by')}</div>
			<div class="span6 real-half">${c.mailqitem.hostname}</div>
		</div>
		<div class="row-fluid">
			<div class="span6 real-half">${_('Size')}</div>
			<div class="span6 real-half">${h.format_byte_size(c.mailqitem.size)}</div>
		</div>
		<div class="row-fluid">
			<div class="span6 real-half">${_('Number of delivery attempts')}</div>
			<div class="span6 real-half">${c.mailqitem.attempts}</div>
		</div>
		<div class="row-fluid">
			<div class="span6 real-half">${_('Last delivery attempt at')}</div>
			<div class="span6 real-half">${h.format_date(c.mailqitem.lastattempt, c.tzinfo)}</div>
		</div>
		<div class="row-fluid">
			<div class="span6 real-half">${_('Reason for queuing')}</div>
			<div class="span6 real-half">${h.linebreaksbr(c.mailqitem.reason) or 'undetermined'}</div>
		</div>
		<div class="row-fluid">
			<h3 class="head smaller lighter blue" id="q">${_('Process message')}</h3>
		</div>
		<!-- <div class="row-fluid">
			<div class="span8"></div>
			<div class="span2">${_('Action')}</div>
			<div class="span2">${_('Process')}</div>
		</div> -->
		${h.form(url('mailq-process'), method='post', id="mailqdform")}
		<div class="row-fluid">
			<div class="span8">${u', '.join([unicode(e) for e in c.form.queue_action.errors]) if c.form.queue_action.errors else h.literal('&nbsp;')}</div>
			<div class="span2">${c.form.queue_action(class_="searchrow")}</div>
			<div class="span2"><button class="btn btn-small btn-success" id="submit_q_request"><i class="icon-cog"></i> ${_('Process')}</button></div>
		</div>
		${h.HTML.div(c.form.csrf_token, style="display: none;")}
		${h.HTML.div(h.hidden('id', c.mailqitem.id), style="display: none;")}
		${h.end_form()}\
	</div>
	<div class="span1 hidden-phone"></div>
</div>
<%def name="headers()">\
</%def>

<%def name="title()">\
 ${_('Showing Mail queue message :: %(i)s') % dict(i=h.wrap_paragraphs(c.mailqitem.messageid, 60))}
</%def>

<%def name="heading()">\
${self.title()}
</%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"><a href="${url('mailq-status')}">${_("Mail Queues")}</a></li>
				% if c.user.is_superadmin:
				<li class="nav_item"><a href="${url('status-audit-logs')}">${_("Audit Logs")}</a></li>
				% endif
            </ul>
        </div>
    </div>
</div>
</%def>

<%def name="localscripts()">\
</%def>
<%inherit file="../base.html"/>
