Merge branch 'navupdate' of github.com:webnotes/erpnext into navupdate

This commit is contained in:
Anand Doshi 2012-02-27 19:16:40 +05:30
commit b37f22dc97
4 changed files with 32 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

@ -38,6 +38,7 @@ wn.pages.messages.onload = function(wrapper) {
wn.pages.messages.onshow = function(wrapper) {
erpnext.messages.show();
setTimeout(erpnext.messages.refresh, 5000);
$('#message-post-text').focus();
}
erpnext.messages = {
@ -83,19 +84,40 @@ erpnext.messages = {
data.creation = dateutil.comment_when(data.creation);
data.comment_by_fullname = wn.boot.user_fullnames[data.owner];
data.reply_html = '';
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 = '';
if(erpnext.messages.contact==user) {
data.reply_html = repl('<a href="#!messages/%(owner)s">\
<i class="icon-share-alt"></i> Reply</a>', data)
}
}
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>\
%(reply_html)s</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']);