[ui] minor fixes
This commit is contained in:
parent
856e1ce473
commit
d4589ab108
7 changed files with 26 additions and 9 deletions
|
|
@ -13,7 +13,7 @@ wn.core.Workflow = wn.ui.form.Controller.extend({
|
|||
},
|
||||
load_document_type: function(doc) {
|
||||
var me = this;
|
||||
if(!locals.DocType[doc.document_type]) {
|
||||
if(doc.document_type && !locals.DocType[doc.document_type]) {
|
||||
wn.model.with_doctype(doc.document_type, function() {
|
||||
me.update_field_options();
|
||||
});
|
||||
|
|
@ -25,7 +25,7 @@ wn.core.Workflow = wn.ui.form.Controller.extend({
|
|||
fieldtype: ["not in", wn.model.no_value_type]
|
||||
}),
|
||||
function(d) { return d.fieldname; });
|
||||
wn.meta.get_docfield("Workflow Document State", "update_field").options
|
||||
wn.meta.get_docfield("Workflow Document State", "update_field", this.frm.doc.name).options
|
||||
= [""].concat(fields);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -372,6 +372,18 @@ div#freeze {
|
|||
background-color: #e74c3c;
|
||||
}
|
||||
|
||||
.comm-header {
|
||||
font-weight: bold;
|
||||
height: 20px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.comm-header > div {
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* alert */
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ wn.ui.form.Toolbar = Class.extend({
|
|||
this.appframe.set_views_for(this.frm.meta.name, "form");
|
||||
},
|
||||
make: function() {
|
||||
this.appframe.set_title_right(); // clear
|
||||
this.set_title();
|
||||
this.show_title_as_dirty();
|
||||
|
||||
|
|
@ -43,7 +44,6 @@ wn.ui.form.Toolbar = Class.extend({
|
|||
this.appframe.set_title(title + this.get_lock_status(), wn._(this.frm.docname));
|
||||
this.appframe.set_title_left('<i class="icon-angle-left"></i> ' + wn._(this.frm.doctype),
|
||||
function() { wn.set_route("List", me.frm.doctype); });
|
||||
this.appframe.set_title_right();
|
||||
},
|
||||
show_infobar: function() {
|
||||
/* docs:
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ wn.ui.form.States = Class.extend({
|
|||
.empty()
|
||||
.removeClass("hide");
|
||||
|
||||
this.workflow_button = $('<button class="btn btn-default dropdown-toggle">\
|
||||
this.workflow_button = $('<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">\
|
||||
<i class="icon-small"></i> <span class="state-text"></span>\
|
||||
<span class="caret"></span></button>')
|
||||
.appendTo(this.parent).dropdown();
|
||||
|
|
@ -178,7 +178,7 @@ wn.ui.form.States = Class.extend({
|
|||
}
|
||||
|
||||
// hide dropdown
|
||||
$(this).parents(".dropdown-menu:first").prev().dropdown('toggle');
|
||||
me.workflow_button.dropdown('toggle');
|
||||
|
||||
return false;
|
||||
})
|
||||
|
|
|
|||
|
|
@ -57,6 +57,11 @@ $.extend(wn.model, {
|
|||
cached_timestamp: cached_timestamp
|
||||
},
|
||||
callback: function(r) {
|
||||
if(r.exc) {
|
||||
wn.msgprint(wn._("Unable to load") + ": " + wn._(doctype));
|
||||
throw "No doctype";
|
||||
return;
|
||||
}
|
||||
if(r.message=="use_cache") {
|
||||
wn.model.sync(cached_doclist);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ wn.ui.AppFrame = Class.extend({
|
|||
this.title_right = $("<a>")
|
||||
.html((icon ? '<i class="'+icon+'"></i> ' : "") + txt)
|
||||
.click(click)
|
||||
.appendTo($right);
|
||||
.prependTo($right);
|
||||
return this.title_right;
|
||||
} else {
|
||||
$right.empty();
|
||||
|
|
@ -328,7 +328,8 @@ wn.ui.make_app_page = function(opts) {
|
|||
</div>\
|
||||
</div>\
|
||||
<div class="appframe container">\
|
||||
<div class="workflow-button-area btn-group pull-right hide" style="margin-top: 9px;"></div>\
|
||||
<div class="appframe-timestamp hide"></div>\
|
||||
<div class="workflow-button-area btn-group pull-right hide"></div>\
|
||||
</div>\
|
||||
<div class="appframe-footer hide"></div>').appendTo($wrapper);
|
||||
|
||||
|
|
|
|||
|
|
@ -97,8 +97,7 @@ wn.views.CommunicationList = Class.extend({
|
|||
"SMS": "icon-mobile-phone",
|
||||
}[doc.communication_medium] || "icon-envelope";
|
||||
var comm = $(repl('<div class="list-group-item">\
|
||||
<div class="comm-header row" title="'+wn._('Click to Expand / Collapse')+'"\
|
||||
style="font-weight: bold; height: 20px; overflow: hidden;">\
|
||||
<div class="comm-header row" title="'+wn._('Click to Expand / Collapse')+'">\
|
||||
<div class="col-sm-3"><i class="%(icon)s"></i> %(_sender)s</div>\
|
||||
<div class="col-sm-6">%(subject)s</div>\
|
||||
<div class="col-sm-3 text-right">%(when)s</div>\
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue