From eb70ed8735093e27ab951ac15e5a7acf17346de2 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 11 Jun 2014 13:16:54 +0530 Subject: [PATCH 01/46] removed inline styling and fancy formatting for emails --- .../doctype/communication/communication.py | 1 + frappe/templates/emails/new_message.html | 2 +- frappe/templates/emails/new_user.html | 6 +- frappe/templates/emails/standard.html | 263 +----------------- frappe/utils/email_lib/email_body.py | 8 +- requirements.txt | 2 - 6 files changed, 12 insertions(+), 270 deletions(-) diff --git a/frappe/core/doctype/communication/communication.py b/frappe/core/doctype/communication/communication.py index d55d89cdea..dc7f150909 100644 --- a/frappe/core/doctype/communication/communication.py +++ b/frappe/core/doctype/communication/communication.py @@ -110,6 +110,7 @@ def get_customer_supplier(args=None): def send_comm_email(d, name, sent_via=None, print_html=None, attachments='[]', send_me_a_copy=False): footer = None + if sent_via: if hasattr(sent_via, "get_sender"): d.sender = sent_via.get_sender(d) or d.sender diff --git a/frappe/templates/emails/new_message.html b/frappe/templates/emails/new_message.html index b51e7129f4..a4a2ea933d 100644 --- a/frappe/templates/emails/new_message.html +++ b/frappe/templates/emails/new_message.html @@ -2,4 +2,4 @@

You have a new message from: {{ from }}

{{ message }}


-

Login and view in Browser

\ No newline at end of file +

Login and view in Browser

diff --git a/frappe/templates/emails/new_user.html b/frappe/templates/emails/new_user.html index 8c6b099c29..ef46f02dc3 100644 --- a/frappe/templates/emails/new_user.html +++ b/frappe/templates/emails/new_user.html @@ -2,9 +2,9 @@

Dear {{ first_name }}{% if last_name %} {{ last_name}}{% endif %},

A new account has been created for you.

Your login id is: {{ user }} -

Click on the button below to complete your registration and set a new password.

-

Complete Registration

+

Click on the link below to complete your registration and set a new password.

+

Complete Registration


You can also copy-paste this link in your browser {{ link }}

Thank you,
-{{ user_fullname }}

\ No newline at end of file +{{ user_fullname }}

diff --git a/frappe/templates/emails/standard.html b/frappe/templates/emails/standard.html index a8f8ffd4de..d3a719a9b9 100644 --- a/frappe/templates/emails/standard.html +++ b/frappe/templates/emails/standard.html @@ -4,273 +4,16 @@ {{ subject or "" }} - - - -
- - - - - - - -
- - -
- - - - -
- {{ content }} -
-
- - -
- +
{{ content }}
- - - - - - - - -
- - diff --git a/frappe/utils/email_lib/email_body.py b/frappe/utils/email_lib/email_body.py index 0ceecb6f5d..f65d60613f 100644 --- a/frappe/utils/email_lib/email_body.py +++ b/frappe/utils/email_lib/email_body.py @@ -6,13 +6,14 @@ import frappe from frappe import msgprint, throw, _ from frappe.utils import scrub_urls, cstr import email.utils +from markdown2 import markdown + def get_email(recipients, sender='', msg='', subject='[No Subject]', text_content = None, footer=None, print_html=None, formatted=None): """send an html email as multipart with attachments and all""" emailobj = EMail(sender, recipients, subject) - if (not '
' in msg) and (not '

' in msg) and (not '') + msg = markdown(msg) emailobj.set_html(msg, text_content, footer=footer, print_html=print_html, formatted=formatted) return emailobj @@ -189,7 +190,6 @@ class EMail: def get_formatted_html(subject, message, footer=None, print_html=None): # imported here to avoid cyclic import - import inlinestyler.utils message = scrub_urls(message) rendered_email = frappe.get_template("templates/emails/standard.html").render({ @@ -204,7 +204,7 @@ def get_formatted_html(subject, message, footer=None, print_html=None): if frappe.local.flags.in_test: return rendered_email - return cstr(inlinestyler.utils.inline_css(rendered_email)) + return rendered_email def get_footer(footer=None): """append a footer (signature)""" diff --git a/requirements.txt b/requirements.txt index 76e3d85520..c309d80ebd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,8 +16,6 @@ slugify termcolor werkzeug semantic_version -lxml -inlinestyler rauth>=0.6.2 requests==1.2.3 celery From 320cea88b589b98894ba13cf4a101f186b704454 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 11 Jun 2014 13:19:44 +0530 Subject: [PATCH 02/46] removed inline styling and fancy formatting for emails --- frappe/utils/email_lib/email_body.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/frappe/utils/email_lib/email_body.py b/frappe/utils/email_lib/email_body.py index f65d60613f..126d7f56ea 100644 --- a/frappe/utils/email_lib/email_body.py +++ b/frappe/utils/email_lib/email_body.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe from frappe import msgprint, throw, _ -from frappe.utils import scrub_urls, cstr +from frappe.utils import scrub_urls import email.utils from markdown2 import markdown @@ -200,10 +200,6 @@ def get_formatted_html(subject, message, footer=None, print_html=None): "subject": subject }) - # if in a test case, do not inline css - if frappe.local.flags.in_test: - return rendered_email - return rendered_email def get_footer(footer=None): From 6ef0b2f2bb286b37e681880aebb8e5d6746c3e31 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 11 Jun 2014 14:51:36 +0530 Subject: [PATCH 03/46] fix frappe/frappe#516 --- frappe/core/page/desktop/desktop.css | 2 +- frappe/public/js/frappe/misc/user.js | 1 - frappe/widgets/reportview.py | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frappe/core/page/desktop/desktop.css b/frappe/core/page/desktop/desktop.css index 710882b873..084053fe8a 100644 --- a/frappe/core/page/desktop/desktop.css +++ b/frappe/core/page/desktop/desktop.css @@ -20,7 +20,7 @@ @media (max-width: 768px) { .case-wrapper { - margin: 12px; + margin: 9px; width: 70px; height: 80px; } diff --git a/frappe/public/js/frappe/misc/user.js b/frappe/public/js/frappe/misc/user.js index cfe614af37..6dcd55c959 100644 --- a/frappe/public/js/frappe/misc/user.js +++ b/frappe/public/js/frappe/misc/user.js @@ -41,7 +41,6 @@ frappe.ui.set_user_background = function(src, selector, style) { frappe.dom.set_style(repl('%(selector)s { \ background: url("%(src)s") center center;\ background-attachment: fixed; \ - background-size: 100%; \ %(style)s \ }', {src:src, selector:selector, style: style==="Fill Screen" ? "background-size: cover;" : ""})); } diff --git a/frappe/widgets/reportview.py b/frappe/widgets/reportview.py index 840f5f0670..304b874f21 100644 --- a/frappe/widgets/reportview.py +++ b/frappe/widgets/reportview.py @@ -150,6 +150,8 @@ def scrub_user_tags(tagcount): rdict = {} tagdict = dict(tagcount) for t in tagdict: + if not t: + continue alltags = t.split(',') for tag in alltags: if tag: From 99734d82d39c3dd36ac904ce3cfb0eb5dd6294bb Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 12 Jun 2014 18:51:58 +0530 Subject: [PATCH 04/46] added feature to add print formats to reports using john resig's microtemplates --- frappe/public/build.json | 2 +- frappe/public/js/frappe/misc/utils.js | 9 ++++++ frappe/public/js/frappe/views/query_report.js | 30 ++++++++++++++++++- frappe/widgets/query_report.py | 19 +++++++----- 4 files changed, 51 insertions(+), 9 deletions(-) diff --git a/frappe/public/build.json b/frappe/public/build.json index 53fb50072b..7e122a7279 100644 --- a/frappe/public/build.json +++ b/frappe/public/build.json @@ -32,7 +32,6 @@ "public/css/tag-it.css", "public/css/bootstrap.css", - "public/css/bootstrap-responsive.css", "public/css/font-awesome.css", "public/css/desk.css", "public/css/appframe.css", @@ -51,6 +50,7 @@ "public/js/lib/center_image.js", "public/js/lib/bootstrap.min.js", "public/js/lib/nprogress.js", + "public/js/lib/microtemplate.js", "public/js/lib/beautify-html.js", "public/js/lib/moment/moment.min.js", "public/js/lib/moment/moment-timezone.min.js", diff --git a/frappe/public/js/frappe/misc/utils.js b/frappe/public/js/frappe/misc/utils.js index 5096536c80..3da001d209 100644 --- a/frappe/public/js/frappe/misc/utils.js +++ b/frappe/public/js/frappe/misc/utils.js @@ -247,5 +247,14 @@ frappe.utils = { var dataURL = canvas.toDataURL("image/jpeg"); setTimeout(function() { callback(dataURL); }, 10 ); } + }, + + with_print_template: function(fn) { + if(!frappe.print_template) { + $.get("/assets/frappe/html/print_template.html?q=4", + function(html) { frappe.print_template = html; fn(); }); + } else { + fn(); + } } }; diff --git a/frappe/public/js/frappe/views/query_report.js b/frappe/public/js/frappe/views/query_report.js index cdb3f67d19..52c8ef5012 100644 --- a/frappe/public/js/frappe/views/query_report.js +++ b/frappe/public/js/frappe/views/query_report.js @@ -107,8 +107,9 @@ frappe.views.QueryReport = Class.extend({ }, callback: function(r) { me.appframe.set_title(__("Query Report")+": " + __(me.report_name)); - frappe.dom.eval(r.message || ""); + frappe.dom.eval(r.message.script || ""); me.setup_filters(); + me.setup_html_format(r.message.html_format); me.refresh(); } }); @@ -124,6 +125,33 @@ frappe.views.QueryReport = Class.extend({ this.wrapper.find(".no-report-area").html(msg).toggle(true); } }, + setup_html_format: function(html_format) { + var me = this; + if(html_format) { + this.appframe.add_primary_action(__('Print'), function() { + if(!me.data) { + msgprint(__("Run the report first")); + return; + } + frappe.utils.with_print_template(function() { + var data = []; + $.each(me.data, function(i, d) { + var newd = {}; data.push(newd); + $.each(d, function(k, v) { + newd[k.replace(/ /g, "_").toLowerCase()] = v; }); + }); + var content = tmpl.render(html_format, {data: data, filters:me.get_values(), report:me}); + + var html = $.format(frappe.print_template, [ + __(me.report_name), content]); + var w = window.open(); + w.document.write(html); + w.document.close(); + }) + }, "icon-print"); + + } + }, setup_filters: function() { this.clear_filters(); var me = this; diff --git a/frappe/widgets/query_report.py b/frappe/widgets/query_report.py index a81dcb1a1f..8d1b859870 100644 --- a/frappe/widgets/query_report.py +++ b/frappe/widgets/query_report.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals import frappe import os, json -import types from frappe import _ from frappe.modules import scrub, get_module_path @@ -31,11 +30,16 @@ def get_script(report_name): module_path = get_module_path(module) report_folder = os.path.join(module_path, "report", scrub(report.name)) script_path = os.path.join(report_folder, scrub(report.name) + ".js") + print_path = os.path.join(report_folder, scrub(report.name) + ".html") - script = None + script, html_format = None, None if os.path.exists(script_path): - with open(script_path, "r") as script: - script = script.read() + with open(script_path, "r") as f: + script = f.read() + + if os.path.exists(print_path): + with open(print_path, "r") as f: + html_format = f.read() if not script and report.javascript: script = report.javascript @@ -47,7 +51,10 @@ def get_script(report_name): if frappe.lang != "en": frappe.response["__messages"] = frappe.get_lang_dict("report", report_name) - return script + return { + "script": script, + "html_format": html_format + } @frappe.whitelist() def run(report_name, filters=()): @@ -148,8 +155,6 @@ def get_linked_doctypes(columns): def get_user_match_filters(doctypes, ref_doctype): match_filters = {} - doctypes_meta = {} - tables = [] for dt in doctypes: match_filters.update(frappe.widgets.reportview.build_match_conditions(dt, False)) From f0b8922e282798565cdec0f34ff2f9c1e82f2308 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 12 Jun 2014 18:53:07 +0530 Subject: [PATCH 05/46] added feature to add print formats to reports using john resig's microtemplates --- frappe/public/html/print_template.html | 17 +++++++++++++ frappe/public/js/lib/microtemplate.js | 33 ++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 frappe/public/html/print_template.html create mode 100644 frappe/public/js/lib/microtemplate.js diff --git a/frappe/public/html/print_template.html b/frappe/public/html/print_template.html new file mode 100644 index 0000000000..ab8d6f634f --- /dev/null +++ b/frappe/public/html/print_template.html @@ -0,0 +1,17 @@ + + + + + + + + + {0} + + + +

+ {1} +
+ + diff --git a/frappe/public/js/lib/microtemplate.js b/frappe/public/js/lib/microtemplate.js new file mode 100644 index 0000000000..f72d21057d --- /dev/null +++ b/frappe/public/js/lib/microtemplate.js @@ -0,0 +1,33 @@ +// Simple JavaScript Templating +// Adapted from John Resig - http://ejohn.org/ - MIT Licensed +tmpl = {compiled: {}, debug:{}}; +tmpl.compile = function(str) { + if(str.indexOf("'")!==-1) { + console.log("Warning: Single quotes (') may not work in templates"); + } + if(!tmpl.compiled[str]) { + fn_str = "var p=[],print=function(){try{p.push.apply(p,arguments)}catch(e){console.log([p, e]);};};" + + + // Introduce the data as local variables using with(){} + "with(obj){p.push('" + + + // Convert the template into pure JavaScript + str + .replace(/[\r\t\n]/g, " ") + .split("{%").join("\t") + .replace(/((^|%})[^\t]*)'/g, "$1\r") + .replace(/\t=(.*?)%}/g, "',$1,'") + .split("\t").join("');") + .split("%}").join("p.push('") + .split("\r").join("\\'") + + "');}return p.join('');"; + + tmpl.debug[str] = fn_str; + tmpl.compiled[str] = new Function("obj", fn_str); + } + + return tmpl.compiled[str]; +}; +tmpl.render = function(str, data, debug) { + return tmpl.compile(str)(data); +}; From 2a3684a02c9c8a1f2c6f63016b4e0915d66d806c Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 13 Jun 2014 10:41:48 +0530 Subject: [PATCH 06/46] build: ability to add html files as frappe.templates[filename] and related fixes to query report --- frappe/build.py | 43 +++++++++++-------- frappe/public/build.json | 4 +- frappe/public/html/print_template.html | 6 +-- frappe/public/js/frappe/misc/utils.js | 9 ---- frappe/public/js/frappe/provide.js | 7 +-- frappe/public/js/frappe/views/query_report.js | 34 ++++++++------- frappe/public/js/lib/microtemplate.js | 19 ++++---- frappe/templates/includes/login.js | 1 + frappe/templates/pages/login.html | 4 +- 9 files changed, 67 insertions(+), 60 deletions(-) diff --git a/frappe/build.py b/frappe/build.py index 3f49530dfa..fb057934b0 100644 --- a/frappe/build.py +++ b/frappe/build.py @@ -1,5 +1,5 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors -# MIT License. See license.txt +# MIT License. See license.txt from __future__ import unicode_literals from frappe.utils.minify import JavascriptMinify @@ -16,7 +16,7 @@ def bundle(no_compress, make_copy=False): # build js files make_asset_dirs(make_copy=make_copy) build(no_compress) - + def watch(no_compress): """watch and rebuild if necessary""" import time @@ -25,18 +25,18 @@ def watch(no_compress): while True: if files_dirty(): build(no_compress=True) - + time.sleep(3) def make_asset_dirs(make_copy=False): assets_path = os.path.join(frappe.local.sites_path, "assets") for dir_path in [ - os.path.join(assets_path, 'js'), + os.path.join(assets_path, 'js'), os.path.join(assets_path, 'css')]: - + if not os.path.exists(dir_path): os.makedirs(dir_path) - + # symlink app/public > assets/app for app_name in frappe.get_all_apps(True): pymodule = frappe.get_module(app_name) @@ -53,7 +53,7 @@ def build(no_compress=False): assets_path = os.path.join(frappe.local.sites_path, "assets") for target, sources in get_build_maps().iteritems(): - pack(os.path.join(assets_path, target), sources, no_compress) + pack(os.path.join(assets_path, target), sources, no_compress) shutil.copy(os.path.join(os.path.dirname(os.path.abspath(frappe.__file__)), 'data', 'languages.txt'), frappe.local.sites_path) # reset_app_html() @@ -79,39 +79,46 @@ def get_build_maps(): else: s = os.path.join(app_path, source) source_paths.append(s) - + build_maps[target] = source_paths except Exception, e: print path raise - + return build_maps timestamps = {} def pack(target, sources, no_compress): from cStringIO import StringIO - + outtype, outtxt = target.split(".")[-1], '' jsm = JavascriptMinify() - + for f in sources: suffix = None if ':' in f: f, suffix = f.split(':') if not os.path.exists(f) or os.path.isdir(f): continue timestamps[f] = os.path.getmtime(f) try: - with open(f, 'r') as sourcefile: + with open(f, 'r') as sourcefile: data = unicode(sourcefile.read(), 'utf-8', errors='ignore') - - if outtype=="js" and (not no_compress) and suffix!="concat" and (".min." not in f): + + extn = f.rsplit(".", 1)[1] + + if outtype=="js" and extn=="js" and (not no_compress) and suffix!="concat" and (".min." not in f): tmpin, tmpout = StringIO(data.encode('utf-8')), StringIO() jsm.minify(tmpin, tmpout) outtxt += unicode(tmpout.getvalue() or '', 'utf-8').strip('\n') + ';' + elif outtype=="js" and extn=="html": + # add to frappe.templates + content = data.replace("\n", " ").replace("'", "\'") + outtxt += """frappe.templates["{key}"] = '{content}';\n""".format(\ + key=f.rsplit("/", 1)[1][:-5], content=content) else: outtxt += ('\n/*\n *\t%s\n */' % f) outtxt += '\n' + data + '\n' - + except Exception, e: print "--Error in:" + f + "--" print frappe.get_traceback() @@ -119,10 +126,10 @@ def pack(target, sources, no_compress): if not no_compress and outtype == 'css': pass #outtxt = cssmin(outtxt) - + with open(target, 'w') as f: f.write(outtxt.encode("utf-8")) - + print "Wrote %s - %sk" % (target, str(int(os.path.getsize(target)/1024))) def files_dirty(): @@ -135,4 +142,4 @@ def files_dirty(): return True else: return False - + diff --git a/frappe/public/build.json b/frappe/public/build.json index 7e122a7279..a033d26f14 100644 --- a/frappe/public/build.json +++ b/frappe/public/build.json @@ -50,7 +50,6 @@ "public/js/lib/center_image.js", "public/js/lib/bootstrap.min.js", "public/js/lib/nprogress.js", - "public/js/lib/microtemplate.js", "public/js/lib/beautify-html.js", "public/js/lib/moment/moment.min.js", "public/js/lib/moment/moment-timezone.min.js", @@ -67,6 +66,9 @@ "public/js/frappe/router.js", "public/js/frappe/desk.js", "public/js/frappe/defaults.js", + "public/js/lib/microtemplate.js", + + "public/html/print_template.html", "public/js/legacy/globals.js", "public/js/legacy/datatype.js", diff --git a/frappe/public/html/print_template.html b/frappe/public/html/print_template.html index ab8d6f634f..aba7ff57dc 100644 --- a/frappe/public/html/print_template.html +++ b/frappe/public/html/print_template.html @@ -6,12 +6,12 @@ - {0} - + {%= title %} +
- {1} + {%= content %}
diff --git a/frappe/public/js/frappe/misc/utils.js b/frappe/public/js/frappe/misc/utils.js index 3da001d209..d4b418a7d2 100644 --- a/frappe/public/js/frappe/misc/utils.js +++ b/frappe/public/js/frappe/misc/utils.js @@ -248,13 +248,4 @@ frappe.utils = { setTimeout(function() { callback(dataURL); }, 10 ); } }, - - with_print_template: function(fn) { - if(!frappe.print_template) { - $.get("/assets/frappe/html/print_template.html?q=4", - function(html) { frappe.print_template = html; fn(); }); - } else { - fn(); - } - } }; diff --git a/frappe/public/js/frappe/provide.js b/frappe/public/js/frappe/provide.js index a6091ec58b..6438b46839 100644 --- a/frappe/public/js/frappe/provide.js +++ b/frappe/public/js/frappe/provide.js @@ -1,8 +1,8 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors -// MIT License. See license.txt +// MIT License. See license.txt // provide a namespace -if(!window.frappe) +if(!window.frappe) window.frappe = {}; frappe.provide = function(namespace) { // docs: create a namespace // @@ -22,4 +22,5 @@ frappe.provide("locals"); frappe.provide("frappe.settings"); frappe.provide("frappe.utils"); frappe.provide("frappe.ui"); -frappe.provide("frappe.modules"); \ No newline at end of file +frappe.provide("frappe.modules"); +frappe.provide("frappe.templates"); diff --git a/frappe/public/js/frappe/views/query_report.js b/frappe/public/js/frappe/views/query_report.js index 52c8ef5012..c6f0b8feee 100644 --- a/frappe/public/js/frappe/views/query_report.js +++ b/frappe/public/js/frappe/views/query_report.js @@ -133,21 +133,25 @@ frappe.views.QueryReport = Class.extend({ msgprint(__("Run the report first")); return; } - frappe.utils.with_print_template(function() { - var data = []; - $.each(me.data, function(i, d) { - var newd = {}; data.push(newd); - $.each(d, function(k, v) { - newd[k.replace(/ /g, "_").toLowerCase()] = v; }); - }); - var content = tmpl.render(html_format, {data: data, filters:me.get_values(), report:me}); - - var html = $.format(frappe.print_template, [ - __(me.report_name), content]); - var w = window.open(); - w.document.write(html); - w.document.close(); - }) + + var data = []; + $.each(me.data, function(i, d) { + var newd = {}; data.push(newd); + $.each(d, function(k, v) { + newd[k.replace(/ /g, "_").toLowerCase()] = v; }); + }); + + var content = frappe.render(html_format, + {data: data, filters:me.get_values(), report:me}); + + var html = frappe.render(frappe.templates.print_template, { + title: __(me.report_name), content: content + }); + + var w = window.open(); + w.document.write(html); + w.document.close(); + }, "icon-print"); } diff --git a/frappe/public/js/lib/microtemplate.js b/frappe/public/js/lib/microtemplate.js index f72d21057d..361bd3dd8d 100644 --- a/frappe/public/js/lib/microtemplate.js +++ b/frappe/public/js/lib/microtemplate.js @@ -1,12 +1,13 @@ // Simple JavaScript Templating // Adapted from John Resig - http://ejohn.org/ - MIT Licensed -tmpl = {compiled: {}, debug:{}}; -tmpl.compile = function(str) { + +frappe.template = {compiled: {}, debug:{}}; +frappe.template.compile = function(str) { if(str.indexOf("'")!==-1) { console.log("Warning: Single quotes (') may not work in templates"); } - if(!tmpl.compiled[str]) { - fn_str = "var p=[],print=function(){try{p.push.apply(p,arguments)}catch(e){console.log([p, e]);};};" + + if(!frappe.template.compiled[str]) { + fn_str = "var p=[],print=function(){p.push.apply(p,arguments)};" + // Introduce the data as local variables using with(){} "with(obj){p.push('" + @@ -22,12 +23,12 @@ tmpl.compile = function(str) { .split("\r").join("\\'") + "');}return p.join('');"; - tmpl.debug[str] = fn_str; - tmpl.compiled[str] = new Function("obj", fn_str); + frappe.template.debug[str] = fn_str; + frappe.template.compiled[str] = new Function("obj", fn_str); } - return tmpl.compiled[str]; + return frappe.template.compiled[str]; }; -tmpl.render = function(str, data, debug) { - return tmpl.compile(str)(data); +frappe.render = function(str, data, debug) { + return frappe.template.compile(str)(data); }; diff --git a/frappe/templates/includes/login.js b/frappe/templates/includes/login.js index e79af5dfad..3b5dbec159 100644 --- a/frappe/templates/includes/login.js +++ b/frappe/templates/includes/login.js @@ -124,5 +124,6 @@ frappe.ready(function() { window.location.hash = "#login"; login.bind_events(); login.login(); + $(".form-signup, .form-forgot").removeClass("hide"); $(document).trigger('login_rendered'); }); diff --git a/frappe/templates/pages/login.html b/frappe/templates/pages/login.html index 604d57e23d..c3f923d098 100644 --- a/frappe/templates/pages/login.html +++ b/frappe/templates/pages/login.html @@ -43,7 +43,7 @@ - -