Add initial reply / reply-all support for messages.
This commit is contained in:
parent
415fc439b7
commit
46923d40da
5 changed files with 154 additions and 34 deletions
|
@ -21,9 +21,9 @@
|
|||
% endif
|
||||
</div>
|
||||
|
||||
% if not _focus_rendered and (fieldset.focus == field or fieldset.focus is True):
|
||||
% if not _focus_rendered and (fieldset.focus is True or fieldset.focus is field):
|
||||
% if not field.is_readonly() and getattr(field.renderer, 'needs_focus', True):
|
||||
<script language="javascript" type="text/javascript">
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
% if hasattr(field.renderer, 'focus_name'):
|
||||
$('#${field.renderer.focus_name}').focus();
|
||||
|
|
|
@ -6,12 +6,20 @@
|
|||
${h.javascript_link(request.static_url('tailbone:static/js/lib/tag-it.min.js'))}
|
||||
${h.stylesheet_link(request.static_url('tailbone:static/css/jquery.tagit.css'))}
|
||||
<script type="text/javascript">
|
||||
|
||||
% if initial_recipient_names is not Undefined:
|
||||
var initial_recipients = {
|
||||
% for i, (uuid, name) in enumerate(initial_recipient_names.iteritems(), 1):
|
||||
'${uuid}': "${name.replace('"', '\\""')|n}"${',' if i < len(initial_recipient_names) else ''}
|
||||
% endfor
|
||||
};
|
||||
% endif
|
||||
|
||||
$(function() {
|
||||
|
||||
var recipients = $('.recipients ul');
|
||||
var recipients = $('.recipients input');
|
||||
|
||||
recipients.tagit({
|
||||
fieldName: 'Message--recipients',
|
||||
autocomplete: {
|
||||
delay: 0,
|
||||
minLength: 2,
|
||||
|
@ -29,7 +37,11 @@
|
|||
var label = ui.tagLabel.split(',');
|
||||
var value = label.shift();
|
||||
$(ui.tag).find('.tagit-hidden-field').val(value);
|
||||
$(ui.tag).find('.tagit-label').text(label.join());
|
||||
if (label.length) {
|
||||
$(ui.tag).find('.tagit-label').text(label.join());
|
||||
} else {
|
||||
$(ui.tag).find('.tagit-label').text(initial_recipients[value]);
|
||||
}
|
||||
},
|
||||
removeConfirmation: true
|
||||
});
|
||||
|
@ -41,7 +53,8 @@
|
|||
</script>
|
||||
<style type="text/css">
|
||||
|
||||
.field-wrapper.subject .field input[type="text"] {
|
||||
.field-wrapper.subject .field input[type="text"],
|
||||
.field-wrapper.body .field textarea {
|
||||
width: 99%;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
border-top: 1px solid black;
|
||||
border-bottom: 1px solid black;
|
||||
margin-bottom: 15px;
|
||||
padding-top: 15px;
|
||||
white-space: pre-line;
|
||||
}
|
||||
.message-body p {
|
||||
margin-bottom: 15px;
|
||||
|
@ -43,6 +43,8 @@
|
|||
<%def name="message_tools()">
|
||||
% if recipient:
|
||||
<div class="message-tools">
|
||||
${h.link_to("Reply", url('messages.reply', uuid=instance.uuid), class_='button')}
|
||||
${h.link_to("Reply to All", url('messages.reply_all', uuid=instance.uuid), class_='button')}
|
||||
% 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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue