message delete

This commit is contained in:
Rushabh Mehta 2012-02-27 18:41:11 +05:30
parent 07a36a4baa
commit ef29e55469
4 changed files with 24 additions and 12 deletions

View File

@ -28,6 +28,7 @@ div.cal_head div {
}
div.cal_toolbar {
width: 80%;
}
div.cal_toolbar .btn {
@ -155,14 +156,6 @@ div.cal_week_unit{
cursor:pointer;
}
div.cal_event {
overflow-x: hidden;
font-size: 11px;
color: #00B;
margin-bottom: 2px;
text-decoration: underline;
}
div.cal_event_Public {
color: GREEN;
}

View File

@ -1,5 +1,5 @@
<div class="cal_body">
<a class="close" href="#" onclick="window.history.back();return false;">&times;</a>
<a class="close" onclick="window.history.back();">&times;</a>
<div class="cal_toolbar btn-group">
<button class="btn btn-small" onclick="erpnext.calendar.add_event()">
<i class="icon-plus"></i> Add Event

View File

@ -86,16 +86,30 @@ erpnext.messages = {
if(data.owner==user) {
data.cls = 'message-self';
data.comment_by_fullname = 'You';
data.delete_html = repl('<a class="close" onclick="erpnext.messages.delete(this)"\
data-name="%(name)s">&times;</a>', data);
} else {
data.cls = 'message-other'
data.cls = 'message-other';
data.delete_html = '';
}
wrapper.innerHTML = repl('<div class="message %(cls)s"><b>%(comment)s</b>\
<div class="help">by %(comment_by_fullname)s, %(creation)s</div></div>\
wrapper.innerHTML = repl('<div class="message %(cls)s">%(delete_html)s\
<b>%(comment)s</b>\
<div class="help">by %(comment_by_fullname)s, %(creation)s</div></div>\
<div style="clear: both;"></div>', data);
}
});
},
delete: function(ele) {
$(ele).parent().css('opacity', 0.6);
wn.call({
method:'utilities.page.messages.messages.delete',
args: {name : $(ele).attr('data-name')},
callback: function() {
$(ele).parent().toggle(false);
}
});
},
show_active_users: function() {
wn.call({
module:'utilities',

View File

@ -47,4 +47,9 @@ def post(arg=None):
d.comment_docname = arg['contact']
d.comment_doctype = 'Message'
d.save()
@webnotes.whitelist()
def delete(arg=None):
webnotes.conn.sql("""delete from `tabComment Widget Record` where name=%s""",
webnotes.form_dict['name']);