<div class="alpos">
	<div class="grid_16">
		<ul id="msgops">
	      <li>${h.link_to(_('Release message'), url('message-archive', anchor="q", id=c.id) if c.archived else url('message-detail', id=c.id, anchor="q"))}</li>
		  <li>${h.link_to(_('Return to message'), url('message-archive', id=c.id) if c.archived else url('message-detail', id=c.id))}</li>
		</ul>
	</div>
</div>
<div class="clear"></div>
<div id="content">
% if c.message:
	<div class="grid_16">
		<h3 class="head">${_('Message headers')}</h3>
	</div>
	<div class="clear"></div>
% for header in c.message['headers']:
<div class="grid_16 drow">
    <div class="grid_7">${header.capitalize()}:</div>
    <div class="grid_8">${h.wrap_paragraphs(c.message['headers'][header], 60) if c.message['headers'][header] else ''}</div>
</div>
% endfor
% if c.message['attachments']:
<div class="grid_16 drow">
    <div class="grid_7">${_('Attachments')}:</div>
    <div class="grid_8">
    	% 	for index, name in enumerate(c.message['attachments']):
		<% counter = index + 1 %>
			${h.link_to(h.portable_img('imgs/dl.png', alt="dl") + h.literal('&nbsp;') + name['filename'], url('messages-archived-attach-dw', id=c.id, attachment=counter) if c.archived else url('messages-attach-dw', id=c.id, attachment=counter))}&nbsp;
		%	endfor
    </div>
</div>
% endif
<div class="grid_16">
	<h3 class="head">${_('Message content')}</h3>
</div>
<div class="grid_16">
    <div id="mailpreview">
% if c.message['parts'] and c.message['parts'][0]['type'] == "text":
        ${h.linebreaksbr(c.message['parts'][0]['content'])}
% elif c.message['parts']:
        ${c.message['parts'][0]['content']|n}
% endif
    </div>
</div>
% else:
<div class="grid_16 drow">
    <div>${_('Message: %(msgid)s could not be previewed') % dict(msgid=c.messageid)}</div>
</div>
% endif
</div>

<%def name="title()">
 ${_('Messages :: Previewing message : %(msgid)s') % dict(msgid=c.messageid)}
</%def>

<%def name="heading()">
${_('Messages :: Previewing message : %(msgid)s') % dict(msgid=h.wrap_paragraphs(c.messageid, 70))}
</%def>

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