Browse Source

address now not in dialog, added slideshows in products and groups and removed transaction history from customer / supplier / sales partner

version-14
Rushabh Mehta 12 years ago
parent
commit
8c43cbf5c5
5 changed files with 28 additions and 20 deletions
  1. +3
    -0
      public/css/legacy/fields.css
  2. +14
    -14
      public/js/legacy/widgets/form/fields.js
  3. +3
    -0
      public/js/legacy/widgets/form/form.js
  4. +4
    -6
      public/js/wn/ui/listing.js
  5. +4
    -0
      webnotes/__init__.py

+ 3
- 0
public/css/legacy/fields.css View File

@@ -16,6 +16,9 @@
}
.datainputcell { padding: 2px 0px; }

.field-wrapper .help {
margin-top: -5px;
}

.help ol {
padding-left: 19px;


+ 14
- 14
public/js/legacy/widgets/form/fields.js View File

@@ -47,26 +47,30 @@ Field.prototype.make_body = function() {
else
this.wrapper = document.createElement((this.with_label || this.df.fieldtype=="HTML" ? 'div' : 'span'));

$(this.wrapper).addClass("field-wrapper");
this.label_area = $a(this.wrapper, 'div', '',
{margin:'0px 0px 2px 0px', minHeight:'1em'});

var label_wrapper = this.label_area;
if(ischk && !this.in_grid) {
this.input_area = $a(this.label_area, 'span', '', {marginRight:'4px'});
this.disp_area = $a(this.label_area, 'span', '', {marginRight:'4px'});
var label_wrapper = $("<div style='margin-bottom: 9px'>").appendTo(this.label_area).get(0);
this.input_area = $a(label_wrapper, 'span', '', {marginRight:'4px'});
this.disp_area = $a(label_wrapper, 'span', '', {marginRight:'4px'});
}
// label
if(this.with_label) {
this.label_span = $a(this.label_area, 'span', 'small')
if(this.with_label) {
this.label_span = $a(label_wrapper, 'span', 'small')
// error icon
this.label_icon = $('<i class="icon icon-warning-sign">').toggle(false)
.appendTo(this.label_area).css('margin-left','7px')
.appendTo(label_wrapper).css('margin-left','7px')
.attr("title", "This field is mandatory.");

} else {
this.label_span = $a(this.label_area, 'span', '', {marginRight:'4px'})
$dh(this.label_area);
this.label_span = $a(label_wrapper, 'span', '', {marginRight:'4px'})
$dh(label_wrapper);
}

// make the input areas
@@ -873,15 +877,12 @@ CheckField.prototype.validate = function(v) {
return v;
};
CheckField.prototype.onmake = function() {
this.checkimg = $a(this.disp_area, 'div');
var img = $a(this.checkimg, 'img');
img.src = 'lib/images/ui/tick.gif';
$dh(this.checkimg);
this.checkimg = $("<i class='icon-check'></i>").appendTo(this.disp_area);
}

CheckField.prototype.make_input = function() { var me = this;
this.input = $a_input(this.input_area,'checkbox');
$y(this.input, {width:"16px", border:'0px', margin:'2px'}); // no specs for checkbox
$y(this.input, {width:"16px", border:'0px', marginTop:'-2px'}); // no specs for checkbox
$(this.input).click(function() {
me.set(this.checked?1:0);
@@ -900,8 +901,7 @@ CheckField.prototype.make_input = function() { var me = this;

}
CheckField.prototype.set_disp = function(val) {
if (val){ $ds(this.checkimg); }
else { $dh(this.checkimg); }
this.checkimg.toggle(val);
}

// ======================================================================================


+ 3
- 0
public/js/legacy/widgets/form/form.js View File

@@ -458,6 +458,9 @@ _f.Frm.prototype.refresh_header = function() {
if(!this.meta.in_dialog || this.in_form) {
set_title(this.meta.issingle ? this.doctype : this.docname);
}

if(wn.ui.toolbar.recent)
wn.ui.toolbar.recent.add(this.doctype, this.docname, 1);
// show / hide buttons
if(this.frm_head)this.frm_head.refresh();


+ 4
- 6
public/js/wn/ui/listing.js View File

@@ -96,7 +96,7 @@ wn.ui.Listing = Class.extend({
</div>\
\
<div style="margin-bottom:9px" class="list-toolbar-wrapper">\
<div class="list-toolbar" style="display:inline-block; margin-right: 10px;">\
<div class="list-toolbar btn-group" style="display:inline-block; margin-right: 10px;">\
</div>\
<div style="display:inline-block; width: 24px; margin-left: 4px">\
<img src="lib/images/ui/button-load.gif" \
@@ -133,10 +133,8 @@ wn.ui.Listing = Class.extend({
} else {
$button = $('<button class="btn"></button>')
.appendTo(this.$w.find('.list-toolbar'))
if(icon) {
$('<i>').addClass(icon).appendTo($button);
}
$button.html(label).click(click);
.html((icon ? ("<i class='"+icon+"'></i> ") : "") + label)
.click(click);
return $button
}
},
@@ -164,7 +162,7 @@ wn.ui.Listing = Class.extend({
// hide-refresh
if(!(this.hide_refresh || this.no_refresh)) {
this.add_button('Refresh', function() {
this.add_button('', function() {
me.run();
}, 'icon-refresh');


+ 4
- 0
webnotes/__init__.py View File

@@ -304,6 +304,10 @@ def delete_doc(doctype=None, name=None, doclist = None, force=0):
def clear_perms(doctype):
conn.sql("""delete from tabDocPerm where parent=%s""", doctype)

def reset_perms(doctype):
clear_perms(doctype)
reload_doc(conn.get_value("DocType", doctype, "module"), "DocType", doctype)

def reload_doc(module, dt=None, dn=None):
import webnotes.modules
return webnotes.modules.reload_doc(module, dt, dn)


Loading…
Cancel
Save