From e4fb5b75931c42a20446f101e8a0f592e4c30b94 Mon Sep 17 00:00:00 2001 From: Akhilesh Darjee Date: Tue, 28 Jan 2014 12:12:58 +0530 Subject: [PATCH 1/5] webnotes/erpnext#1348 alphabetically listing of print formats --- public/js/wn/model/meta.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/public/js/wn/model/meta.js b/public/js/wn/model/meta.js index b98d7ffa71..355b3d6b5a 100644 --- a/public/js/wn/model/meta.js +++ b/public/js/wn/model/meta.js @@ -93,13 +93,8 @@ $.extend(wn.meta, { }, get_print_formats: function(doctype) { - // if default print format is given, use it - var print_format_list = []; - if(locals.DocType[doctype].default_print_format) - print_format_list.push(locals.DocType[doctype].default_print_format) - - if(!in_list(print_format_list, "Standard")) - print_format_list.push("Standard"); + var print_format_list = ["Standard"]; + var default_print_format = locals.DocType[doctype].default_print_format; var print_formats = wn.model.get("Print Format", {doc_type: doctype}) .sort(function(a, b) { return (a > b) ? 1 : -1; }); @@ -107,6 +102,12 @@ $.extend(wn.meta, { if(!in_list(print_format_list, d.name)) print_format_list.push(d.name); }); + + if(default_print_format && default_print_format != "Standard") { + var index = print_format_list.indexOf(default_print_format) - 1; + print_format_list.sort().splice(index, 1); + print_format_list.unshift(default_print_format); + } return print_format_list; }, From 31012e964a0bb011a2ef8097adf595c376a53982 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 28 Jan 2014 12:51:30 +0530 Subject: [PATCH 2/5] Don't walk in files and backups folder for translate and pyc removal --- webnotes/build.py | 3 +++ webnotes/translate.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/webnotes/build.py b/webnotes/build.py index 72837522d1..d83328a948 100644 --- a/webnotes/build.py +++ b/webnotes/build.py @@ -55,6 +55,9 @@ def clear_pyc_files(): from webnotes.utils import get_base_path for path, folders, files in os.walk(get_base_path()): if 'locale' in folders: folders.remove('locale') + if 'files' in folders: folders.remove('files') + if 'backups' in folders: folders.remove('backups') + for f in files: if f.decode("utf-8").endswith(".pyc"): os.remove(os.path.join(path, f)) diff --git a/webnotes/translate.py b/webnotes/translate.py index 41f6bd3c20..3a2dacea43 100644 --- a/webnotes/translate.py +++ b/webnotes/translate.py @@ -309,6 +309,9 @@ def import_messages(lang, infile): data = dict(get_all_messages_from_file(infile)) for (basepath, folders, files) in os.walk('.'): + if 'files' in folders: folders.remove('files') + if 'backups' in folders: folders.remove('backups') + def _update_lang_file(mtype): """create a langauge file for the given message type""" messages = get_messages(basepath, mtype) From 852d37c7240e2e196dd8f49b4750b55f60b50635 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 28 Jan 2014 12:53:09 +0530 Subject: [PATCH 3/5] Don't walk in files and backups folder for translate --- webnotes/translate.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/webnotes/translate.py b/webnotes/translate.py index 3a2dacea43..476ce19b97 100644 --- a/webnotes/translate.py +++ b/webnotes/translate.py @@ -277,6 +277,9 @@ def export_messages(lang, outfile): messages = {} # extract messages for (basepath, folders, files) in os.walk('.'): + if 'files' in folders: folders.remove('files') + if 'backups' in folders: folders.remove('backups') + def _get_messages(messages, basepath, mtype): mlist = get_messages(basepath, mtype) if not mlist: From 12960331d0234394f0c981e542f8820e1722b93d Mon Sep 17 00:00:00 2001 From: Akhilesh Darjee Date: Thu, 30 Jan 2014 12:14:34 +0530 Subject: [PATCH 4/5] ignored image for cleanup html in text editor --- public/js/wn/ui/editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/wn/ui/editor.js b/public/js/wn/ui/editor.js index c1d6d705b5..e2574f125b 100644 --- a/public/js/wn/ui/editor.js +++ b/public/js/wn/ui/editor.js @@ -125,7 +125,7 @@ bsEditor = Class.extend({ clean_html: function() { var html = this.editor.html() || ""; - if(!strip(this.editor.text())) html = ""; + if(!strip(this.editor.text()) && !(this.editor.find("img"))) html = ""; // html = html.replace(/(
|\s|

<\/div>| )*$/, ''); // remove custom typography (use CSS!) From e222e6224c2a715609f640c79ba9dde62a04d28d Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Thu, 30 Jan 2014 14:29:30 +0600 Subject: [PATCH 5/5] bumped to version 3.9.0 --- config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.json b/config.json index 6ca9e453c8..51d656b777 100644 --- a/config.json +++ b/config.json @@ -1,6 +1,6 @@ { "base_template": "lib/website/templates/base.html", - "framework_version": "3.8.0", + "framework_version": "3.9.0", "modules": { "Calendar": { "color": "#2980b9",