瀏覽代碼

[minor] form sidebar extension

version-14
Rushabh Mehta 10 年之前
父節點
當前提交
b691fd1df5
共有 2 個檔案被更改,包括 10 行新增6 行删除
  1. +3
    -0
      frappe/public/js/frappe/form/form_sidebar.html
  2. +7
    -6
      frappe/public/js/lib/microtemplate.js

+ 3
- 0
frappe/public/js/frappe/form/form_sidebar.html 查看文件

@@ -40,3 +40,6 @@
<li class="modified-by"></li>
<li class="created-by"></li>
</ul>
{% if(frappe.get_form_sidebar_extension) { %}
{{ frappe.get_form_sidebar_extension() }}
{% } %}

+ 7
- 6
frappe/public/js/lib/microtemplate.js 查看文件

@@ -4,14 +4,15 @@
frappe.template = {compiled: {}, debug:{}};
frappe.template.compile = function(str, name) {
var key = name || str;
if(str.indexOf("'")!==-1) {
console.warn("Warning: Single quotes (') may not work in templates");
}

// repace jinja style tags
str = str.replace(/{{/g, "{%=").replace(/}}/g, "%}");

if(!frappe.template.compiled[key]) {
if(str.indexOf("'")!==-1) {
console.warn("Warning: Single quotes (') may not work in templates");
}

// repace jinja style tags
str = str.replace(/{{/g, "{%=").replace(/}}/g, "%}");

fn_str = "var _p=[],print=function(){_p.push.apply(_p,arguments)};" +

// Introduce the data as local variables using with(){}


Loading…
取消
儲存