[IMP] mail: composition form: improved usability of Post / Send an email -> Send / Comment.

bzr revid: tde@openerp.com-20120712124440-1ofy1big9xqsosg2
This commit is contained in:
Thibault Delavallée 2012-07-12 14:44:40 +02:00
parent 3facefce28
commit 617a3b7552
2 changed files with 15 additions and 3 deletions

View File

@ -317,13 +317,22 @@ openerp.mail = function(session) {
* in the function. */
bind_events: function() {
var self = this;
// event: click on 'Send a Message' link that toggles the form for
// event: click on 'Send an Email' link that toggles the form for
// sending an email (partner_ids)
this.$element.find('a.oe_mail_compose_message_email').click(function (event) {
event.preventDefault();
self.params.email_mode = ! self.params.email_mode;
// update context of datasetsearch
self.ds_compose.context.email_mode = self.params.email_mode;
// update 'Post' button -> 'Send'
// update 'Send an Email' link -> 'Post a comment'
if (self.params.email_mode) {
self.$element.find('button.oe_form_button').html('<img width="16" height="16" src="http://localhost:8069/web/static/src/img/icons/gtk-ok.png"><span>Send</span>');
self.$element.find('a.oe_mail_compose_message_email').html('Comment');
} else {
self.$element.find('button.oe_form_button').html('<img width="16" height="16" src="http://localhost:8069/web/static/src/img/icons/gtk-ok.png"><span>Post</span>');
self.$element.find('a.oe_mail_compose_message_email').html('Send an Email');
}
// toggle display
self.$element.find('div.oe_mail_compose_message_partner_ids').toggleClass('oe_mail_compose_message_invisible');
});

View File

@ -52,9 +52,12 @@
<field name="body_html" colspan="4" nolabel="1" placeholder="What are you working on HTML ?"
class="oe_mail_compose_message_body_html oe_mail_compose_message_invisible" widget="text_html"/>
<field name="dest_partner_ids" colspan="4" nolabel="1" widget="many2many_tags"
placeholder="Add contacts to notify..."
class="oe_mail_compose_message_partner_ids oe_mail_compose_message_invisible"/>
<button icon="gtk-ok" name="send_mail" string="Post" type="object"/>
<a href="#" class="oe_mail_compose_message_email">Send an email</a>
<div>
<button icon="gtk-ok" name="send_mail" string="Post" type="object"/>
or <a href="#" class="oe_mail_compose_message_email">Send an Email</a>
</div>
<div class='oe_mail_compose_message_icons'>
<a href="#" class="oe_mail_compose_message_checklist">
<img src='/mail/static/src/img/checklist.png/' alt='Checklist'