mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 16:04:46 +00:00
moved to bootstrap 2.1 and some ui fixes in todo and messages
This commit is contained in:
@@ -24,7 +24,7 @@ wn.pages.messages.onload = function(wrapper) {
|
||||
|
||||
$('<h3 id="message-title">Everyone</h3>\
|
||||
<div id="show-everyone" style="display: none;">\
|
||||
<a href="#messages" style="font-size: 80%;">\
|
||||
<a href="#messages/'+user+'" style="font-size: 80%;">\
|
||||
Show messages from everyone</a></div><hr>\
|
||||
<div id="post-message" style="display: none">\
|
||||
<textarea style="width: 100%; height: 24px;"></textarea>\
|
||||
@@ -36,6 +36,9 @@ wn.pages.messages.onload = function(wrapper) {
|
||||
}
|
||||
|
||||
$(wn.pages.messages).bind('show', function() {
|
||||
// remove alerts
|
||||
$('#alert-container .alert').remove();
|
||||
|
||||
erpnext.messages.show();
|
||||
setTimeout("erpnext.messages.refresh()", 7000);
|
||||
})
|
||||
@@ -78,7 +81,7 @@ erpnext.Messages = Class.extend({
|
||||
});
|
||||
},
|
||||
show: function() {
|
||||
var contact = this.get_contact();
|
||||
var contact = this.get_contact() || this.contact || user;
|
||||
|
||||
$('#message-title').text(contact==user ? "Everyone" :
|
||||
wn.boot.user_info[contact].fullname)
|
||||
@@ -108,7 +111,6 @@ erpnext.Messages = Class.extend({
|
||||
}
|
||||
return name;
|
||||
}
|
||||
return user;
|
||||
},
|
||||
make_list: function() {
|
||||
this.list = new wn.ui.Listing({
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
.todoitem {
|
||||
padding-bottom: 3px;
|
||||
min-height: 45px;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
@@ -25,13 +24,10 @@
|
||||
|
||||
.todoitem .description {
|
||||
padding: 3px 0px;
|
||||
display: inline-block;
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
#todo-list, #assigned-todo-list {
|
||||
float: left;
|
||||
width: 50%;
|
||||
#todo-list {
|
||||
|
||||
}
|
||||
|
||||
.todo-separator {
|
||||
@@ -47,4 +43,8 @@
|
||||
.todo-layout {
|
||||
background-color: #FFFDC9;
|
||||
min-height: 300px;
|
||||
}
|
||||
|
||||
.popup-on-click {
|
||||
margin: 0px 6px;
|
||||
}
|
||||
@@ -3,11 +3,6 @@
|
||||
<div class="layout-main todo-layout">
|
||||
<div>
|
||||
<div id="todo-list">
|
||||
<h4>My List</h4><br>
|
||||
<div class="todo-content"></div>
|
||||
</div>
|
||||
<div id="assigned-todo-list">
|
||||
<h4>Assigned to others</h4><br>
|
||||
<div class="todo-content"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -27,24 +27,17 @@ erpnext.todo.refresh = function() {
|
||||
|
||||
var nothing_to_do = function() {
|
||||
$('#todo-list div.todo-content')
|
||||
.html('<div class="help-box">Nothing to do :)</div>');
|
||||
.html('<div class="alert">Nothing to do :)</div>');
|
||||
}
|
||||
|
||||
var nothing_delegated = function() {
|
||||
$('#assigned-todo-list div.todo-content')
|
||||
.html('<div class="help-box">Nothing assigned to other users. \
|
||||
Use "Assign To" in a form to delegate work.</div>');
|
||||
}
|
||||
|
||||
if(r.message) {
|
||||
for(var i in r.message) {
|
||||
new erpnext.todo.ToDoItem(r.message[i]);
|
||||
}
|
||||
if (!todo_list.html()) { nothing_to_do(); }
|
||||
if (!assigned_todo_list.html()) { nothing_delegated(); }
|
||||
} else {
|
||||
nothing_to_do();
|
||||
nothing_delegated();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -70,7 +63,6 @@ erpnext.todo.ToDoItem = Class.extend({
|
||||
|
||||
var parent_list = "#todo-list";
|
||||
if(todo.owner !== user) {
|
||||
parent_list = "#assigned-todo-list";
|
||||
var owner = wn.boot.user_info[todo.owner];
|
||||
todo.fullname = repl("[To %(fullname)s] ", {
|
||||
fullname: (owner ? owner.fullname : todo.owner),
|
||||
@@ -79,7 +71,7 @@ erpnext.todo.ToDoItem = Class.extend({
|
||||
parent_list += " div.todo-content";
|
||||
|
||||
if(todo.reference_name && todo.reference_type) {
|
||||
todo.link = repl('<br><a href="#!Form/%(reference_type)s/%(reference_name)s">\
|
||||
todo.link = repl('<a href="#!Form/%(reference_type)s/%(reference_name)s">\
|
||||
%(reference_type)s: %(reference_name)s</a>', todo);
|
||||
} else if(todo.reference_type) {
|
||||
todo.link = repl('<br><a href="#!List/%(reference_type)s">\
|
||||
@@ -88,16 +80,14 @@ erpnext.todo.ToDoItem = Class.extend({
|
||||
todo.link = '';
|
||||
}
|
||||
if(!todo.description) todo.description = '';
|
||||
|
||||
todo.desc = wn.markdown(todo.description);
|
||||
|
||||
|
||||
$(parent_list).append(repl('\
|
||||
<div class="todoitem">\
|
||||
<span class="label %(labelclass)s">%(priority)s</span>\
|
||||
<span class="popup-on-click"><a href="#">[edit]</a></span>\
|
||||
<span class="description">\
|
||||
<span class="help" style="margin-right: 7px">%(userdate)s</span>\
|
||||
%(fullname)s%(desc)s\
|
||||
<span class="popup-on-click"><a href="#"> [edit]</a></span>\
|
||||
%(fullname)s: %(description)s\
|
||||
<span class="ref_link">%(link)s</span>\
|
||||
</span>\
|
||||
<span class="close-span"><a href="#" class="close">×</a></span>\
|
||||
@@ -142,8 +132,7 @@ erpnext.todo.make_dialog = function(det) {
|
||||
title: 'To Do',
|
||||
fields: [
|
||||
{fieldtype:'Text', fieldname:'description', label:'Description',
|
||||
reqd:1, description:'Use <a href="#markdown-reference">markdown</a> to \
|
||||
format content'},
|
||||
reqd:1},
|
||||
{fieldtype:'Date', fieldname:'date', label:'Event Date', reqd:1},
|
||||
{fieldtype:'Check', fieldname:'checked', label:'Completed'},
|
||||
{fieldtype:'Select', fieldname:'priority', label:'Priority', reqd:1, 'options':['Medium','High','Low'].join('\n')},
|
||||
|
||||
Reference in New Issue
Block a user