diff --git a/frappe/public/css/bootstrap.css b/frappe/public/css/bootstrap.css index c6e36fc3e6..2219328ac1 100644 --- a/frappe/public/css/bootstrap.css +++ b/frappe/public/css/bootstrap.css @@ -895,7 +895,7 @@ html { -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } body { - font-family: "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.42857143; color: #333; diff --git a/frappe/public/css/desk.css b/frappe/public/css/desk.css index f05dc91157..154f9abe2d 100644 --- a/frappe/public/css/desk.css +++ b/frappe/public/css/desk.css @@ -1,3 +1,5 @@ +@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,700); + html { min-height: 100%; position: relative; diff --git a/frappe/public/js/frappe/form/grid.js b/frappe/public/js/frappe/form/grid.js index bffeb47ebd..c36174acac 100644 --- a/frappe/public/js/frappe/form/grid.js +++ b/frappe/public/js/frappe/form/grid.js @@ -274,7 +274,8 @@ frappe.ui.form.GridRow = Class.extend({ if(this.grid.template) { $('
').appendTo(this.row) - .html(frappe.render(this.grid.template, {doc:this.doc, frm:this.frm, grid_row: this})); + .html(frappe.render(this.grid.template, { + doc:this.doc || null, frm:this.frm, row: this})); } else { this.add_visible_columns(); } @@ -315,7 +316,7 @@ frappe.ui.form.GridRow = Class.extend({ var df = this.static_display_template[ci][0]; var colsize = this.static_display_template[ci][1]; var txt = this.doc ? - frappe.format(this.doc[df.fieldname], df, null, this.doc) : + this.get_formatted(df.fieldname) : __(df.label); if(this.doc && df.fieldtype === "Select") { txt = __(txt); @@ -455,11 +456,12 @@ frappe.ui.form.GridRow = Class.extend({ frm: this.frm, }); this.layout.make(); - this.layout.refresh(this.doc); this.fields = this.layout.fields; this.fields_dict = this.layout.fields_dict; + this.layout.refresh(this.doc); + // copy get_query to fields $.each(this.grid.fieldinfo || {}, function(fieldname, fi) { $.extend(me.fields_dict[fieldname], fi); @@ -538,8 +540,7 @@ frappe.ui.form.GridRow = Class.extend({ refresh_field: function(fieldname) { var $col = this.row.find("[data-fieldname='"+fieldname+"']"); if($col.length) { - var value = frappe.model.get_value(this.doc.doctype, this.doc.name, fieldname); - $col.html(frappe.format(value, $col.data("df"), null, this.doc)); + $col.html(this.get_formatted(fieldname)); } // in form @@ -547,4 +548,9 @@ frappe.ui.form.GridRow = Class.extend({ this.fields_dict[fieldname].refresh(); } }, + get_formatted: function(fieldname) { + var df = frappe.meta.get_docfield(this.grid.doctype, fieldname, this.frm.docname); + return frappe.format(this.doc[fieldname], df, null, this.doc); + }, + }); diff --git a/frappe/public/js/legacy/clientscriptAPI.js b/frappe/public/js/legacy/clientscriptAPI.js index 0e63ba01b3..5cfa219060 100644 --- a/frappe/public/js/legacy/clientscriptAPI.js +++ b/frappe/public/js/legacy/clientscriptAPI.js @@ -268,3 +268,9 @@ _f.Frm.prototype.set_read_only = function() { }); cur_frm.perm = perm; } + +_f.Frm.prototype.get_formatted = function(fieldname) { + return frappe.format(this.doc[fieldname], + frappe.meta.get_docfield(this.doctype, fieldname, this.docname), + {no_icon:true}, this.doc); +} diff --git a/frappe/public/js/lib/microtemplate.js b/frappe/public/js/lib/microtemplate.js index 3da5dad3ce..cdad572bd9 100644 --- a/frappe/public/js/lib/microtemplate.js +++ b/frappe/public/js/lib/microtemplate.js @@ -19,12 +19,21 @@ frappe.template.compile = function(str) { .replace(/((^|%})[^\t]*)'/g, "$1\r") .replace(/\t=(.*?)%}/g, "',$1,'") .split("\t").join("');") - .split("%}").join("p.push('") + .split("%}").join("\np.push('") .split("\r").join("\\'") + "');}return p.join('');"; frappe.template.debug[str] = fn_str; - frappe.template.compiled[str] = new Function("obj", fn_str); + try { + frappe.template.compiled[str] = new Function("obj", fn_str); + } catch (e) { + console.log("Error in Template:"); + console.log(fn_str); + if(e.lineNumber) { + console.log("Error in Line 9, Col 11:"); + console.log(fn_str.split("\n")[8]); + } + } } return frappe.template.compiled[str]; diff --git a/frappe/templates/base.html b/frappe/templates/base.html index 682fbf89f8..48a497f69a 100644 --- a/frappe/templates/base.html +++ b/frappe/templates/base.html @@ -8,12 +8,15 @@ Built on Frappe.io. Free and Open Source Framework for the Web. https://frappe.i {{ title }} - + + href="{{ favicon or "/assets/frappe/images/favicon.ico" }}" + type="image/x-icon"> + href="{{ favicon or "/assets/frappe/images/favicon.ico" }}" + type="image/x-icon"> {%- block head_include %}{% endblock -%} {%- block head -%} {% if meta_block is defined %}