Add initial support for 'messages' views.
This commit is contained in:
parent
c2a6b0dd50
commit
84ebb158bc
6 changed files with 447 additions and 0 deletions
27
tailbone/templates/messages/archive/index.mako
Normal file
27
tailbone/templates/messages/archive/index.mako
Normal file
|
@ -0,0 +1,27 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
<%inherit file="/messages/index.mako" />
|
||||
|
||||
<%def name="title()">Message Archive</%def>
|
||||
|
||||
<%def name="head_tags()">
|
||||
${parent.head_tags()}
|
||||
<script type="text/javascript">
|
||||
destination = "Inbox";
|
||||
</script>
|
||||
</%def>
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
${parent.context_menu_items()}
|
||||
<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>
|
||||
</%def>
|
||||
|
||||
<%def name="grid_tools()">
|
||||
${h.form(url('messages.move_bulk'), name='move-selected')}
|
||||
${h.hidden('destination', value='inbox')}
|
||||
${h.hidden('uuids')}
|
||||
<button type="submit">Move 0 selected to Inbox</button>
|
||||
${h.end_form()}
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
27
tailbone/templates/messages/inbox/index.mako
Normal file
27
tailbone/templates/messages/inbox/index.mako
Normal file
|
@ -0,0 +1,27 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
<%inherit file="/messages/index.mako" />
|
||||
|
||||
<%def name="title()">Message Inbox</%def>
|
||||
|
||||
<%def name="head_tags()">
|
||||
${parent.head_tags()}
|
||||
<script type="text/javascript">
|
||||
destination = "Archive";
|
||||
</script>
|
||||
</%def>
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
${parent.context_menu_items()}
|
||||
<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>
|
||||
</%def>
|
||||
|
||||
<%def name="grid_tools()">
|
||||
${h.form(url('messages.move_bulk'), name='move-selected')}
|
||||
${h.hidden('destination', value='archive')}
|
||||
${h.hidden('uuids')}
|
||||
<button type="submit">Move 0 selected to Archive</button>
|
||||
${h.end_form()}
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
58
tailbone/templates/messages/index.mako
Normal file
58
tailbone/templates/messages/index.mako
Normal file
|
@ -0,0 +1,58 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
<%inherit file="/master/index.mako" />
|
||||
|
||||
<%def name="head_tags()">
|
||||
${parent.head_tags()}
|
||||
<script type="text/javascript">
|
||||
|
||||
var destination = null;
|
||||
|
||||
function update_move_button() {
|
||||
var count = $('.newgrid tbody td.checkbox input:checked').length;
|
||||
$('form[name="move-selected"] button')
|
||||
.button('option', 'label', "Move " + count + " selected to " + destination)
|
||||
.button('option', 'disabled', count < 1);
|
||||
}
|
||||
|
||||
$(function() {
|
||||
|
||||
update_move_button();
|
||||
|
||||
$('.newgrid-wrapper').on('click', 'thead th.checkbox input', function() {
|
||||
update_move_button();
|
||||
});
|
||||
|
||||
$('.newgrid-wrapper').on('click', 'tbody td.checkbox input', function() {
|
||||
update_move_button();
|
||||
});
|
||||
|
||||
$('form[name="move-selected"]').submit(function() {
|
||||
var uuids = [];
|
||||
$('.newgrid tbody td.checkbox input:checked').each(function() {
|
||||
uuids.push($(this).parents('tr:first').data('uuid'));
|
||||
});
|
||||
if (! uuids.length) {
|
||||
return false;
|
||||
}
|
||||
$(this).find('[name="uuids"]').val(uuids.toString());
|
||||
$(this).find('button')
|
||||
.button('option', 'label', "Moving " + uuids.length + " messages to " + destination + "...")
|
||||
.button('disable');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.newgrid table {
|
||||
position: relative;
|
||||
top: -32px;
|
||||
}
|
||||
.newgrid .pager {
|
||||
position: relative;
|
||||
top: -32px;
|
||||
}
|
||||
</style>
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
12
tailbone/templates/messages/sent/index.mako
Normal file
12
tailbone/templates/messages/sent/index.mako
Normal file
|
@ -0,0 +1,12 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
<%inherit file="/master/index.mako" />
|
||||
|
||||
<%def name="title()">Sent Messages</%def>
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
${parent.context_menu_items()}
|
||||
<li>${h.link_to("Go to my Message Inbox", url('messages.inbox'))}</li>
|
||||
<li>${h.link_to("Go to my Message Archive", url('messages.archive'))}</li>
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
31
tailbone/templates/messages/view.mako
Normal file
31
tailbone/templates/messages/view.mako
Normal file
|
@ -0,0 +1,31 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
<%inherit file="/master/view.mako" />
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
% if recipient:
|
||||
% if recipient.status == rattail.enum.MESSAGE_STATUS_INBOX:
|
||||
<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>
|
||||
<li>${h.link_to("Go to my Message Inbox", url('messages.inbox'))}</li>
|
||||
<li>${h.link_to("Go to my Message Archive", url('messages.archive'))}</li>
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
${parent.body()}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue