diff --git a/core/doctype/workflow/workflow.js b/core/doctype/workflow/workflow.js index dd207e84a2..b66a92fa10 100644 --- a/core/doctype/workflow/workflow.js +++ b/core/doctype/workflow/workflow.js @@ -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); } }); diff --git a/public/css/common.css b/public/css/common.css index b0b307e2b2..71891d7e31 100644 --- a/public/css/common.css +++ b/public/css/common.css @@ -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 */ diff --git a/public/js/wn/form/toolbar.js b/public/js/wn/form/toolbar.js index effb8b3f97..8b9b2ee18e 100644 --- a/public/js/wn/form/toolbar.js +++ b/public/js/wn/form/toolbar.js @@ -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(' ' + wn._(this.frm.doctype), function() { wn.set_route("List", me.frm.doctype); }); - this.appframe.set_title_right(); }, show_infobar: function() { /* docs: diff --git a/public/js/wn/form/workflow.js b/public/js/wn/form/workflow.js index 7275de7230..05db3694cd 100644 --- a/public/js/wn/form/workflow.js +++ b/public/js/wn/form/workflow.js @@ -24,7 +24,7 @@ wn.ui.form.States = Class.extend({ .empty() .removeClass("hide"); - this.workflow_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; }) diff --git a/public/js/wn/model/model.js b/public/js/wn/model/model.js index 4d5237ae32..b578cb7773 100644 --- a/public/js/wn/model/model.js +++ b/public/js/wn/model/model.js @@ -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 { diff --git a/public/js/wn/ui/appframe.js b/public/js/wn/ui/appframe.js index 5d22f4a31e..07adfb6596 100644 --- a/public/js/wn/ui/appframe.js +++ b/public/js/wn/ui/appframe.js @@ -59,7 +59,7 @@ wn.ui.AppFrame = Class.extend({ this.title_right = $("") .html((icon ? ' ' : "") + 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) { \ \
\ -
\ +
\ +
\
\ ').appendTo($wrapper); diff --git a/public/js/wn/views/communication.js b/public/js/wn/views/communication.js index 24e334c4c8..4489597b90 100644 --- a/public/js/wn/views/communication.js +++ b/public/js/wn/views/communication.js @@ -97,8 +97,7 @@ wn.views.CommunicationList = Class.extend({ "SMS": "icon-mobile-phone", }[doc.communication_medium] || "icon-envelope"; var comm = $(repl('
\ -
\ +
\
%(_sender)s
\
%(subject)s
\
%(when)s
\