From 7affeb49d17bbf2b15a43afb094b945993a897b2 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 13 Feb 2014 13:04:30 +0530 Subject: [PATCH 1/5] minor fixes --- webnotes/model/__init__.py | 9 +++++++-- webnotes/widgets/query_report.py | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/webnotes/model/__init__.py b/webnotes/model/__init__.py index 3786649d2d..7eac3cd314 100644 --- a/webnotes/model/__init__.py +++ b/webnotes/model/__init__.py @@ -105,12 +105,17 @@ def rename_field(doctype, old_fieldname, new_fieldname): where doctype=%s and field=%s""", (new_fieldname, doctype, old_fieldname)) else: + # copy field value webnotes.conn.sql("""update `tab%s` set `%s`=`%s`""" % \ (doctype, new_fieldname, old_fieldname)) - + + # update in property setter webnotes.conn.sql("""update `tabProperty Setter` set field_name = %s where doc_type=%s and field_name=%s""", (new_fieldname, doctype, old_fieldname)) + update_users_report_view_settings(doctype, old_fieldname) + +def update_users_report_view_settings(doctype, ref_fieldname): import json user_report_cols = webnotes.conn.sql("""select defkey, defvalue from `tabDefaultValue` where defkey like '_list_settings:%'""") @@ -118,7 +123,7 @@ def rename_field(doctype, old_fieldname, new_fieldname): new_columns = [] columns_modified = False for field, field_doctype in json.loads(value): - if field == old_fieldname and field_doctype == doctype: + if field == ref_fieldname and field_doctype == doctype: new_columns.append([field, field_doctype]) columns_modified=True if columns_modified: diff --git a/webnotes/widgets/query_report.py b/webnotes/widgets/query_report.py index bba8569c8a..599535e6ac 100644 --- a/webnotes/widgets/query_report.py +++ b/webnotes/widgets/query_report.py @@ -75,7 +75,7 @@ def run(report_name, filters=()): if report.is_standard=="Yes": method_name = webnotes.local.module_app[scrub(module)] + "." + scrub(module) \ + ".report." + scrub(report.name) + "." + scrub(report.name) + ".execute" - columns, result = webnotes.get_attr(method_name)(filters or {}) + columns, result = webnotes.get_attr(method_name)(webnotes._dict(filters)) result = get_filtered_data(report.ref_doctype, columns, result) From acbaa61d71ecf0c77e26b8342cd248303ac7609f Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Thu, 13 Feb 2014 14:45:22 +0530 Subject: [PATCH 2/5] fix svg path in font-awesome --- webnotes/public/css/font-awesome.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webnotes/public/css/font-awesome.css b/webnotes/public/css/font-awesome.css index 1592b9cebd..f124df5738 100644 --- a/webnotes/public/css/font-awesome.css +++ b/webnotes/public/css/font-awesome.css @@ -36,7 +36,7 @@ @media screen and (-webkit-min-device-pixel-ratio:0) { @font-face { font-family: 'FontAwesome'; - src: url('../lib/css/font/fontawesome-webfont.svg#fontawesomeregular?v=3.2.1') format('svg'); + src: url('../webnotes/css/font/fontawesome-webfont.svg#fontawesomeregular?v=3.2.1') format('svg'); } } From 61e648c49b4b4933a53a0da90f80da7329de109f Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Thu, 13 Feb 2014 14:45:39 +0530 Subject: [PATCH 3/5] fix params in verify command --- webnotes/utils/verified_command.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webnotes/utils/verified_command.py b/webnotes/utils/verified_command.py index 600bc5e591..9c43aa2ac7 100644 --- a/webnotes/utils/verified_command.py +++ b/webnotes/utils/verified_command.py @@ -14,7 +14,7 @@ def get_url(params, nonce, secret=None): return ''.join([webnotes.local.request.url_root, '?', urllib.urlencode(params)]) def get_signature(params, nonce, secret=None): - params = "".join((cstr(p) for p in params)) + params = "".join((cstr(p) for p in params.values())) if not secret: secret = webnotes.local.conf.get("secret") or "secret" From 17652dd1f7936c4bc440855c6ec69d4766a2cd12 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 13 Feb 2014 15:42:59 +0530 Subject: [PATCH 4/5] title, header, sidebar and breadcrumbs are default blocks, show nprogress bar when loading via pushstate and ajax --- webnotes/public/js/wn/website/editable.js | 9 +++++++-- webnotes/templates/base.html | 2 +- webnotes/templates/generators/blog_post.html | 4 ---- webnotes/templates/generators/web_page.html | 12 ++---------- .../templates/generators/website_group.html | 11 ++--------- webnotes/templates/includes/breadcrumbs.html | 4 ++-- webnotes/templates/pages/blog.html | 4 ---- webnotes/templates/pages/login.html | 6 +++--- webnotes/templates/pages/login.py | 2 +- webnotes/templates/pages/website_script.js | 17 ++++++++--------- webnotes/templates/pages/website_script.py | 11 +++++++---- webnotes/templates/pages/writers.html | 4 ---- webnotes/templates/website_group/forum.html | 2 +- webnotes/website/css/website.css | 2 +- webnotes/website/js/website.js | 6 +++++- webnotes/website/js/website_group.js | 13 +++++++++++-- webnotes/webutils.py | 15 +++++++++++++++ 17 files changed, 66 insertions(+), 58 deletions(-) diff --git a/webnotes/public/js/wn/website/editable.js b/webnotes/public/js/wn/website/editable.js index 93c37cd6cb..d3d8ab1e56 100644 --- a/webnotes/public/js/wn/website/editable.js +++ b/webnotes/public/js/wn/website/editable.js @@ -1,5 +1,5 @@ wn.make_editable = function(editor, doctype, name, fieldname) { - wn.require("assets/js/editor.min.js"); + wn.require("/assets/js/editor.min.js"); WebPageEditor = bsEditor.extend({ onhide: function(action) { @@ -15,7 +15,12 @@ wn.make_editable = function(editor, doctype, name, fieldname) { this._super(bool); if(!bool) { - var $edit_btn = $(repl('
  • Edit %(doctype)s
  • \ + // remove existing web page editor toggles + $('li.editable-toggle + li').remove(); + $('li.editable-toggle').remove(); + + var $edit_btn = $(repl('
  • \ + Edit %(doctype)s
  • \
  • ', {doctype: doctype})) .prependTo($("#website-post-login ul.dropdown-menu")); diff --git a/webnotes/templates/base.html b/webnotes/templates/base.html index 16d79ce870..6f616d2cf5 100644 --- a/webnotes/templates/base.html +++ b/webnotes/templates/base.html @@ -49,7 +49,7 @@