Merge branch 'master' of github.com:webnotes/erpnext

This commit is contained in:
Nabin Hait 2012-10-03 13:33:33 +05:30
commit 061141b3b8
4 changed files with 22 additions and 12 deletions

View File

@ -65,13 +65,15 @@ MyProfile = function(wrapper) {
//
this.make_form = function() {
var div = $a($td(this.tab, 0, 1), 'div');
this.form = new wn.ui.FieldGroup()
this.form.make_fields(div, [
{fieldname:'first_name', fieldtype:'Data',label:'First Name',reqd:1},
{fieldname:'last_name', fieldtype:'Data',label:'Last Name'},
{fieldname:'bio', fieldtype:'Text',label:'Bio'},
{fieldname:'update', fieldtype:'Button',label:'Update'}
]);
this.form = new wn.ui.FieldGroup({
parent: div,
fields: [
{fieldname:'first_name', fieldtype:'Data',label:'First Name',reqd:1},
{fieldname:'last_name', fieldtype:'Data',label:'Last Name'},
{fieldname:'bio', fieldtype:'Text',label:'Bio'},
{fieldname:'update', fieldtype:'Button',label:'Update'}
]
});
this.form.fields_dict.update.input.onclick = function() {
var v = me.form.get_values();
@ -99,7 +101,6 @@ MyProfile = function(wrapper) {
{fieldname:'change', fieldtype:'Button', label:'Change'}
]
})
d.make();
d.fields_dict.change.input.onclick = function() {
var v = d.get_values();
if(v) {

View File

@ -1,6 +1,5 @@
h1, h2, h3, h4, h5 {
font-family: Arial, Helvetica, sans-serif;
margin-top: 0.2em;
}
body {

View File

@ -182,6 +182,8 @@ erpnext.setup_mousetrap = function() {
Mousetrap.bind(["command+s", "ctrl+s"], function() {
if(cur_frm)
cur_frm.save();
else if(wn.container.page.save_action)
wn.container.page.save_action();
return false;
});
}

View File

@ -56,7 +56,7 @@ erpnext.todo.ToDoItem = Class.extend({
todo.fullname = '';
if(todo.assigned_by) {
var assigned_by = wn.boot.user_info[todo.assigned_by]
todo.fullname = repl("[By %(fullname)s]  ", {
todo.fullname = repl("[By %(fullname)s] ".bold(), {
fullname: (assigned_by ? assigned_by.fullname : todo.assigned_by),
});
}
@ -64,7 +64,7 @@ erpnext.todo.ToDoItem = Class.extend({
var parent_list = "#todo-list";
if(todo.owner !== user) {
var owner = wn.boot.user_info[todo.owner];
todo.fullname = repl("[To %(fullname)s]  ", {
todo.fullname = repl("[To %(fullname)s] ".bold(), {
fullname: (owner ? owner.fullname : todo.owner),
});
}
@ -136,7 +136,7 @@ erpnext.todo.make_dialog = function(det) {
{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')},
{fieldtype:'Button', fieldname:'save', label:'Save'}
{fieldtype:'Button', fieldname:'save', label:'Save (Ctrl+S)'}
]
});
@ -187,7 +187,15 @@ wn.pages.todo.onload = function(wrapper) {
erpnext.todo.make_dialog({
date:get_today(), priority:'Medium', checked:0, description:''});
}, 'icon-plus');
wrapper.appframe.add_ripped_paper_effect(wrapper);
// load todos
erpnext.todo.refresh();
// save on click
wrapper.save_action = function() {
if(erpnext.todo.dialog && erpnext.todo.dialog.display) {
erpnext.todo.dialog.fields_dict.save.input.click();
}
};
}