moved to bootstrap 2.1 and some ui fixes in todo and messages
This commit is contained in:
parent
079df382f9
commit
3009c46ba5
@ -1290,7 +1290,7 @@ d.set_search=function(dt){if(d.style!='Search'){d.rows['Result'].innerHTML='';d.
|
||||
d.style='Search';if(d.input){d.input=null;sel_type=null;}
|
||||
d.sel_type=get_label_doctype(dt);d.set_title('Quick Search for '+dt);}
|
||||
$(inp).keydown(function(e){if(e.which==13){if(!btn.disabled)btn.onclick();}})
|
||||
d.set_query_description=function(txt){txt=d.input&&d.input.query_description||txt;if(txt){d.rows['Help'].innerHTML='<div class="help-box" style="margin-top:0px">'+txt+'</div>';}else{d.rows['Help'].innerHTML=''}}
|
||||
d.set_query_description=function(txt){txt=d.input&&d.input.query_description||txt;if(txt){d.rows['Help'].innerHTML='<div class="alert" style="margin-top:0px">'+txt+'</div>';}else{d.rows['Help'].innerHTML=''}}
|
||||
d.onshow=function(){if(d.set_doctype!=d.sel_type){d.rows['Result'].innerHTML='';d.values_len=0;}
|
||||
inp.value='';if(d.input&&d.input.txt.value){inp.value=d.input.txt.value;}
|
||||
try{inp.focus();}catch(e){}
|
||||
@ -1808,9 +1808,9 @@ this.setup_print();}
|
||||
_f.Frm.prototype.setup_sidebar=function(){this.sidebar=new wn.widgets.form.sidebar.Sidebar(this);}
|
||||
_f.Frm.prototype.setup_footer=function(){var me=this;var f=this.page_layout.footer;f.save_area=$a(this.page_layout.footer,'div','',{display:'none',marginTop:'11px'});f.help_area=$a(this.page_layout.footer,'div');var b=$btn(f.save_area,'Save',function(){cur_frm.save('Save');},{marginLeft:'0px'},'green');f.show_save=function(){$ds(me.page_layout.footer.save_area);}
|
||||
f.hide_save=function(){$dh(me.page_layout.footer.save_area);}}
|
||||
_f.Frm.prototype.set_intro=function(txt){if(!this.intro_area){this.intro_area=$('<div class="help-box form-intro-area">').insertBefore(this.page_layout.body.firstChild);}
|
||||
_f.Frm.prototype.set_intro=function(txt){if(!this.intro_area){this.intro_area=$('<div class="alert form-intro-area">').insertBefore(this.page_layout.body.firstChild);}
|
||||
if(txt){if(txt.search(/<p>/)==-1)txt='<p>'+txt+'</p>';this.intro_area.html(txt);}else{this.intro_area.remove();this.intro_area=null;}}
|
||||
_f.Frm.prototype.set_footnote=function(txt){if(!this.footnote_area){this.footnote_area=$('<div class="help-box form-intro-area">').insertAfter(this.page_layout.body.lastChild);}
|
||||
_f.Frm.prototype.set_footnote=function(txt){if(!this.footnote_area){this.footnote_area=$('<div class="alert form-intro-area">').insertAfter(this.page_layout.body.lastChild);}
|
||||
if(txt){if(txt.search(/<p>/)==-1)txt='<p>'+txt+'</p>';this.footnote_area.html(txt);}else{this.footnote_area.remove();this.footnote_area=null;}}
|
||||
_f.Frm.prototype.setup_fields_std=function(){var fl=wn.meta.docfield_list[this.doctype];fl.sort(function(a,b){return a.idx-b.idx});if(fl[0]&&fl[0].fieldtype!="Section Break"||get_url_arg('embed')){this.layout.addrow();if(fl[0].fieldtype!="Column Break"){var c=this.layout.addcell();$y(c.wrapper,{padding:'8px'});}}
|
||||
var sec;for(var i=0;i<fl.length;i++){var f=fl[i];if(f.fieldtype=='Section Break'&&fl[i+1]&&fl[i+1].fieldtype=='Section Break')
|
||||
|
@ -21,7 +21,7 @@ wn.require('lib/js/lib/jQuery.Gantt/js/jquery.fn.gantt.min.js');
|
||||
|
||||
erpnext.show_task_gantt = function(parent, project) {
|
||||
|
||||
$(parent).css('min-height', '300px').html('<div class="help-box">Loading...</div>')
|
||||
$(parent).css('min-height', '300px').html('<div class="alert">Loading...</div>')
|
||||
|
||||
var get_source = function(r) {
|
||||
var source = [];
|
||||
@ -56,7 +56,7 @@ erpnext.show_task_gantt = function(parent, project) {
|
||||
callback: function(r) {
|
||||
$(parent).empty();
|
||||
if(!r.message.length) {
|
||||
$(parent).html('<div class="help-box">No Tasks Yet.</div>');
|
||||
$(parent).html('<div class="alert">No Tasks Yet.</div>');
|
||||
} else {
|
||||
var gantt_area = $('<div class="gantt">').appendTo(parent);
|
||||
gantt_area.gantt({
|
||||
|
@ -139,7 +139,7 @@ var set_sales_bom_help = function(doc) {
|
||||
$(cur_frm.fields_dict.packing_list.row.wrapper).toggle(true);
|
||||
|
||||
if (inList(['Delivery Note', 'Sales Invoice'], doc.doctype)) {
|
||||
help_msg = "<div class='help-box'> \
|
||||
help_msg = "<div class='alert'> \
|
||||
For 'Sales BOM' items, warehouse, serial no and batch no \
|
||||
will be considered from the 'Packing List' table. \
|
||||
If warehouse and batch no are same for all packing items for any 'Sales BOM' item, \
|
||||
|
@ -1,7 +1,5 @@
|
||||
// render
|
||||
wn.doclistviews['Support Ticket'] = wn.views.ListView.extend({
|
||||
me: this,
|
||||
|
||||
init: function(d) {
|
||||
this._super(d)
|
||||
this.fields = this.fields.concat([
|
||||
@ -13,22 +11,22 @@ wn.doclistviews['Support Ticket'] = wn.views.ListView.extend({
|
||||
this.show_hide_check_column();
|
||||
},
|
||||
|
||||
label_style: {
|
||||
"status": {
|
||||
"Open": "danger",
|
||||
"Closed": "success",
|
||||
"Hold": "info",
|
||||
"Waiting for Customer": "info"
|
||||
}
|
||||
},
|
||||
|
||||
prepare_data: function(data) {
|
||||
this._super(data);
|
||||
if(data.status=='Open' || data.status=='To Reply') {
|
||||
data.label_type = 'important'
|
||||
}
|
||||
else if(data.status=='Closed') {
|
||||
data.label_type = 'success'
|
||||
}
|
||||
else if(data.status=='Hold') {
|
||||
data.label_type = 'info'
|
||||
}
|
||||
else if(data.status=='Waiting for Customer') {
|
||||
data.label_type = 'info'
|
||||
data.status = 'Waiting'
|
||||
}
|
||||
data.status_html = repl('<span class="label label-%(label_type)s">%(status)s</span>', data);
|
||||
|
||||
data.label_style = this.label_style.status[data.status];
|
||||
|
||||
data.status_html = repl('<span class="label \
|
||||
label-%(label_style)s">%(status)s</span>', data);
|
||||
|
||||
// escape double quotes
|
||||
data.description = cstr(data.subject)
|
||||
|
@ -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')},
|
||||
|
@ -7,4 +7,8 @@
|
||||
.login-banner {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.login-box td {
|
||||
padding: 8px;
|
||||
}
|
||||
</style>
|
@ -7,7 +7,7 @@
|
||||
{% block body %}
|
||||
|
||||
<header>
|
||||
<div class="navbar navbar-fixed-top">
|
||||
<div class="navbar navbar-fixed-top navbar-inverse">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<a class="brand" href="index.html">{{ brand }}</a>
|
||||
|
@ -51,8 +51,8 @@ erpnext.login.doLogin = function(){
|
||||
var args = {};
|
||||
args['usr']=$i("login_id").value;
|
||||
args['pwd']=$i("password").value;
|
||||
if($i('remember_me').checked)
|
||||
args['remember_me'] = 1;
|
||||
//if($i('remember_me').checked)
|
||||
//args['remember_me'] = 1;
|
||||
|
||||
$('#login_btn').set_working();
|
||||
$('#login_message').empty();
|
||||
|
@ -21,7 +21,7 @@
|
||||
</div>
|
||||
<div class="layout-main" style="padding: 15px;">
|
||||
<form autocomplete="on">
|
||||
<table border="0" cellspacing="8">
|
||||
<table border="0" class="login-box">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Login Id</td>
|
||||
@ -31,21 +31,21 @@
|
||||
<td>Password</td>
|
||||
<td><input id="password" type="password" style="width: 180px" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<!--<tr>
|
||||
<td style="text-align:right"><input id="remember_me" type="checkbox" /></td>
|
||||
<td>Remember Me</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td id="login_message"> </td>
|
||||
</tr>
|
||||
</tr>-->
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>
|
||||
<button type="submit" id="login_btn" class="btn btn-small btn-primary">Login</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td id="login_message"> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<p style="margin-left: 72px;"><span class="link_type"
|
||||
|
Loading…
x
Reference in New Issue
Block a user