Add 'Move' button to message view template.

Get rid of context menu link.
This commit is contained in:
Lance Edgar 2016-02-10 15:22:47 -06:00
parent 4713e25ffe
commit 84f85f0870

View file

@ -1,6 +1,24 @@
## -*- coding: utf-8 -*-
<%inherit file="/master/view.mako" />
<%def name="head_tags()">
${parent.head_tags()}
<style type="text/css">
.message-tools {
margin-bottom: 15px;
}
.message-body {
border-top: 1px solid black;
border-bottom: 1px solid black;
margin-bottom: 15px;
padding-top: 15px;
}
.message-body p {
margin-bottom: 15px;
}
</style>
</%def>
<%def name="context_menu_items()">
% if request.has_perm('messages.create'):
<li>${h.link_to("Send a new Message", url('messages.create'))}</li>
@ -10,12 +28,10 @@
<li>${h.link_to("Back to Message Inbox", url('messages.inbox'))}</li>
<li>${h.link_to("Go to my Message Archive", url('messages.archive'))}</li>
<li>${h.link_to("Go to my Sent Messages", url('messages.sent'))}</li>
<li>${h.link_to("Move this Message to my Archive", url('messages.move', uuid=instance.uuid) + '?dest=archive')}</li>
% else:
<li>${h.link_to("Back to Message Archive", url('messages.archive'))}</li>
<li>${h.link_to("Go to my Message Inbox", url('messages.inbox'))}</li>
<li>${h.link_to("Go to my Sent Messages", url('messages.sent'))}</li>
<li>${h.link_to("Move this Message to my Inbox", url('messages.move', uuid=instance.uuid) + '?dest=inbox')}</li>
% endif
% else:
<li>${h.link_to("Back to Sent Messages", url('messages.sent'))}</li>
@ -24,11 +40,28 @@
% endif
</%def>
<%def name="message_tools()">
% if recipient:
<div class="message-tools">
% if recipient.status == rattail.enum.MESSAGE_STATUS_INBOX:
${h.link_to("Move to Archive", url('messages.move', uuid=instance.uuid) + '?dest=archive', class_='button')}
% else:
${h.link_to("Move to Inbox", url('messages.move', uuid=instance.uuid) + '?dest=inbox', class_='button')}
% endif
</div>
% endif
</%def>
<%def name="message_body()">
${instance.body}
</%def>
${parent.body()}
${self.message_tools()}
<div class="message-body">
${self.message_body()}
</div>
${self.message_tools()}