[minor fixes] minor ui cleanups
This commit is contained in:
parent
e5ed3cfdb5
commit
2ec99e1a4d
10 changed files with 82 additions and 44 deletions
|
|
@ -265,4 +265,14 @@ textarea[data-fieldtype="Small Text"] {
|
|||
|
||||
.ui-datepicker select.ui-datepicker-month, .ui-datepicker select.ui-datepicker-year {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.btn-text {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.btn-text {
|
||||
display: inline;
|
||||
}
|
||||
}
|
||||
|
|
@ -58,37 +58,41 @@ wn.ui.form.AssignTo = Class.extend({
|
|||
this.dialog.hide();
|
||||
}
|
||||
|
||||
for(var i=0; i<d.length; i++) {
|
||||
var info = wn.user_info(d[i]);
|
||||
info.owner = d[i];
|
||||
info.avatar = wn.avatar(d[i]);
|
||||
|
||||
$(repl('<div class="alert alert-success" style="margin-bottom: 7px;">\
|
||||
%(avatar)s %(fullname)s \
|
||||
<a class="close" href="#" style="top: 1px;"\
|
||||
data-owner="%(owner)s">×</a></div>', info))
|
||||
.appendTo(this.$list);
|
||||
|
||||
this.$list.find(".avatar").css("margin-top", "-7px")
|
||||
this.$list.find('.avatar img').centerImage();
|
||||
}
|
||||
if(d.length) {
|
||||
for(var i=0; i<d.length; i++) {
|
||||
var info = wn.user_info(d[i]);
|
||||
info.owner = d[i];
|
||||
info.avatar = wn.avatar(d[i]);
|
||||
|
||||
// set remove
|
||||
this.$list.find('a.close').click(function() {
|
||||
wn.call({
|
||||
method:'webnotes.widgets.form.assign_to.remove',
|
||||
args: {
|
||||
doctype: me.frm.doctype,
|
||||
name: me.frm.docname,
|
||||
assign_to: $(this).attr('data-owner')
|
||||
},
|
||||
callback:function(r,rt) {
|
||||
me.render(r.message);
|
||||
me.frm.toolbar.show_infobar();
|
||||
}
|
||||
$(repl('<div class="alert alert-success" style="margin-bottom: 7px;">\
|
||||
%(avatar)s %(fullname)s \
|
||||
<a class="close" href="#" style="top: 1px;"\
|
||||
data-owner="%(owner)s">×</a></div>', info))
|
||||
.appendTo(this.$list);
|
||||
|
||||
this.$list.find(".avatar").css("margin-top", "-7px")
|
||||
this.$list.find('.avatar img').centerImage();
|
||||
}
|
||||
|
||||
// set remove
|
||||
this.$list.find('a.close').click(function() {
|
||||
wn.call({
|
||||
method:'webnotes.widgets.form.assign_to.remove',
|
||||
args: {
|
||||
doctype: me.frm.doctype,
|
||||
name: me.frm.docname,
|
||||
assign_to: $(this).attr('data-owner')
|
||||
},
|
||||
callback:function(r,rt) {
|
||||
me.render(r.message);
|
||||
me.frm.toolbar.show_infobar();
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
$('<p class="text-muted">' + wn._("No one") + '</p>').appendTo(this.$list);
|
||||
}
|
||||
},
|
||||
add: function() {
|
||||
var me = this;
|
||||
|
|
|
|||
|
|
@ -63,8 +63,12 @@ wn.ui.form.Attachments = Class.extend({
|
|||
var file_names = keys(attachments).sort();
|
||||
|
||||
// add attachment objects
|
||||
for(var i=0; i<file_names.length; i++) {
|
||||
this.add_attachment(file_names[i], attachments);
|
||||
if(file_names.length) {
|
||||
for(var i=0; i<file_names.length; i++) {
|
||||
this.add_attachment(file_names[i], attachments);
|
||||
}
|
||||
} else {
|
||||
$('<p class="text-muted">' + wn._("None") + '</p>').appendTo(this.$list);
|
||||
}
|
||||
|
||||
// refresh select fields with options attach_files:
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ wn.ui.form.Footer = Class.extend({
|
|||
<div class="form-tags">\
|
||||
<h4 style="display: inline-block"><i class="icon-tag"></i> Tags</h4>\
|
||||
<span class="tag-area"></span><br>\
|
||||
</div>\
|
||||
</div><hr>\
|
||||
<div class="form-comments">\
|
||||
<h4><i class="icon-comments"></i> Comments</h4>\
|
||||
</div>\
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ wn.ui.form.Toolbar = Class.extend({
|
|||
this.appframe.add_button("Edit", function() {
|
||||
me.frm.edit_doc();
|
||||
return false;
|
||||
})
|
||||
}, 'icon-pencil')
|
||||
this.frm.$print_view_select =
|
||||
this.appframe.add_select("Print Format", this.frm.print_formats)
|
||||
.val(this.frm.print_formats[0])
|
||||
|
|
@ -216,7 +216,7 @@ wn.ui.form.Toolbar = Class.extend({
|
|||
this.make_save_button();
|
||||
}
|
||||
else if(docstatus==1 && p[CANCEL]) {
|
||||
this.appframe.add_dropdown_button("File", 'Cancel', function() {
|
||||
this.appframe.add_button('Cancel', function() {
|
||||
me.frm.savecancel(this) }, 'icon-remove');
|
||||
}
|
||||
else if(docstatus==2 && p[AMEND]) {
|
||||
|
|
|
|||
|
|
@ -31,20 +31,28 @@ wn.model.DocList = Class.extend({
|
|||
save: function(action, callback, btn) {
|
||||
this.check_name();
|
||||
if(this.check_mandatory()) {
|
||||
var me = this;
|
||||
this._call({
|
||||
method: "webnotes.widgets.form.save.savedocs",
|
||||
args: { docs: wn.model.compress(this.doclist), action:action},
|
||||
callback: callback,
|
||||
callback: function(r) {
|
||||
$(document).trigger("save", me.doc);
|
||||
callback(r);
|
||||
},
|
||||
btn: btn
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
cancel: function(callback, btn) {
|
||||
var me = this;
|
||||
this._call({
|
||||
method: "webnotes.widgets.form.save.cancel",
|
||||
args: { doctype: this.doctype, name: this.name },
|
||||
callback: callback,
|
||||
callback: function(r) {
|
||||
$(document).trigger("save", wn.model.get_doc(me.doctype, me.name));
|
||||
callback(r);
|
||||
},
|
||||
btn: btn
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ wn.ui.AppFrame = Class.extend({
|
|||
this.buttons[label] && this.buttons[label].remove();
|
||||
|
||||
this.buttons[label] = $(repl('<button class="btn btn-default">\
|
||||
%(icon)s %(label)s</button>', args))
|
||||
%(icon)s <span class="btn-text">%(label)s</span></button>', args))
|
||||
.appendTo(this.toolbar.find(".btn-group").css({"margin-right": "5px"}))
|
||||
//.appendTo(title_toolbar ? this.$w.find(".title-button-area") : this.toolbar.find(".btn-group"))
|
||||
.attr("title", wn._(label))
|
||||
|
|
|
|||
|
|
@ -229,8 +229,10 @@ wn.ui.Listing = Class.extend({
|
|||
type: "GET",
|
||||
args: this.get_call_args(a0),
|
||||
callback: function(r) {
|
||||
if(!me.opts.no_loading)me.set_working(false);
|
||||
me.render_results(r)
|
||||
if(!me.opts.no_loading)
|
||||
me.set_working(false);
|
||||
me.dirty = false;
|
||||
me.render_results(r);
|
||||
},
|
||||
no_spinner: this.opts.no_loading
|
||||
});
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ wn.views.doclistview.show = function(doctype) {
|
|||
var page_name = "List/" + route[1];
|
||||
if(wn.pages[page_name]) {
|
||||
wn.container.change_to(wn.pages[page_name]);
|
||||
if(wn.container.page.doclistview)
|
||||
if(wn.container.page.doclistview && wn.container.page.doclistview.dirty)
|
||||
wn.container.page.doclistview.run();
|
||||
} else {
|
||||
if(route[1]) {
|
||||
|
|
@ -23,10 +23,19 @@ wn.views.doclistview.show = function(doctype) {
|
|||
}
|
||||
}
|
||||
|
||||
$(document).on("save", function(event, doc) {
|
||||
var list_page = "List/" + doc.doctype;
|
||||
if(wn.pages[list_page]) {
|
||||
if(wn.pages[list_page].doclistview)
|
||||
wn.pages[list_page].doclistview.dirty = true;
|
||||
}
|
||||
})
|
||||
|
||||
wn.views.DocListView = wn.ui.Listing.extend({
|
||||
init: function(doctype) {
|
||||
this.doctype = doctype;
|
||||
this.label = wn._(doctype);
|
||||
this.dirty = true;
|
||||
this.label = (this.label.toLowerCase().substr(-4) == 'list') ?
|
||||
wn._(this.label) : (wn._(this.label) + ' ' + wn._('List'));
|
||||
this.make_page();
|
||||
|
|
@ -71,7 +80,7 @@ wn.views.DocListView = wn.ui.Listing.extend({
|
|||
this.appframe.add_breadcrumb("icon-list");
|
||||
this.appframe.set_views_for(this.doctype, "list");
|
||||
},
|
||||
|
||||
|
||||
setup: function() {
|
||||
var me = this;
|
||||
me.can_delete = wn.model.can_delete(me.doctype);
|
||||
|
|
|
|||
|
|
@ -151,10 +151,11 @@ wn.views.ListView = Class.extend({
|
|||
});
|
||||
|
||||
// row #2
|
||||
var row2 = $('<div class="col col-lg-12 hidden-sm">\
|
||||
var row2 = $('<div class="col col-lg-12">\
|
||||
<div class="row">\
|
||||
<div class="col col-lg-7 col-offset-3 list-tag"></div>\
|
||||
<div class="col col-lg-2 timestamp" style="font-size: 90%; padding-right: 0px;\
|
||||
<div class="col col-lg-7 col-offset-3">\
|
||||
<div class="list-tag hidden-sm"></div></div>\
|
||||
<div class="col col-lg-2 timestamp" style="font-size: 90%; padding-right: 4px;\
|
||||
color: #aaa; margin-top: -3px; text-align: right;">\
|
||||
</div>\
|
||||
</div>\
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue