From 80bab7d73f338e100beed1dd0d372b446ae0872c Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 23 Sep 2016 14:46:26 +0530 Subject: [PATCH] [minor] refactor --- .../desk/doctype/bulk_update/bulk_update.json | 19 ++++++++++------ .../js/frappe/ui/toolbar/awesome_bar.js | 22 +++++++++---------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/frappe/desk/doctype/bulk_update/bulk_update.json b/frappe/desk/doctype/bulk_update/bulk_update.json index 7272b7d877..11ea4d0b4d 100644 --- a/frappe/desk/doctype/bulk_update/bulk_update.json +++ b/frappe/desk/doctype/bulk_update/bulk_update.json @@ -14,6 +14,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "document_type", "fieldtype": "Link", "hidden": 0, @@ -31,7 +32,7 @@ "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, - "reqd": 0, + "reqd": 1, "search_index": 0, "set_only_once": 0, "unique": 0 @@ -40,6 +41,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "field", "fieldtype": "Select", "hidden": 0, @@ -56,7 +58,7 @@ "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, - "reqd": 0, + "reqd": 1, "search_index": 0, "set_only_once": 0, "unique": 0 @@ -65,6 +67,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "update_value", "fieldtype": "Small Text", "hidden": 0, @@ -81,15 +84,16 @@ "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, - "reqd": 0, + "reqd": 1, "search_index": 0, "set_only_once": 0, "unique": 0 }, { "allow_on_submit": 0, - "bold": 0, + "bold": 1, "collapsible": 0, + "columns": 0, "description": "SQL Conditions. Example: status=\"Open\"", "fieldname": "condition", "fieldtype": "Small Text", @@ -114,8 +118,9 @@ }, { "allow_on_submit": 0, - "bold": 0, + "bold": 1, "collapsible": 0, + "columns": 0, "default": "500", "description": "Max 500 records at a time", "fieldname": "limit", @@ -150,7 +155,7 @@ "issingle": 1, "istable": 0, "max_attachments": 0, - "modified": "2016-07-15 06:24:42.575613", + "modified": "2016-09-23 05:10:19.377701", "modified_by": "Administrator", "module": "Desk", "name": "Bulk Update", @@ -178,7 +183,7 @@ "write": 1 } ], - "quick_entry": 0, + "quick_entry": 1, "read_only": 0, "read_only_onload": 0, "sort_field": "modified", diff --git a/frappe/public/js/frappe/ui/toolbar/awesome_bar.js b/frappe/public/js/frappe/ui/toolbar/awesome_bar.js index 22a2327c71..988a783420 100644 --- a/frappe/public/js/frappe/ui/toolbar/awesome_bar.js +++ b/frappe/public/js/frappe/ui/toolbar/awesome_bar.js @@ -132,7 +132,7 @@ frappe.search = { var ret = frappe.search.find(values, txt, function(match) { return { - label: __(doctype) + " " + match + "", + label: __(doctype) + " " match.bold(), value: __(doctype) + " " + match, route: ["Form", doctype, match] } @@ -191,7 +191,7 @@ frappe.search.verbs = [ var options = {}; options[search_field] = ["like", "%" + txt + "%"]; frappe.search.options.push({ - label: __('Find {0} in {1}', [""+txt+"", "" + route[1] + ""]), + label: __('Find {0} in {1}', [txt.bold(), route[1].bold()]), value: __('Find {0} in {1}', [txt, route[1]]), route_options: options, onclick: function() { @@ -208,7 +208,7 @@ frappe.search.verbs = [ if(txt.split(" ")[0]==="new") { frappe.search.find(frappe.boot.user.can_create, txt.substr(4), function(match) { return { - label: __("New {0}", [""+match+""]), + label: __("New {0}", [match.bold()]), value: __("New {0}", [match]), onclick: function() { frappe.new_doc(match, true); } } @@ -226,19 +226,19 @@ frappe.search.verbs = [ frappe.search.find(frappe.boot.user.can_read, txt, function(match) { if(in_list(frappe.boot.single_types, match)) { return { - label: __("{0}", [""+__(match)+""]), + label: __("{0}", [__(match).bold()]), value: __(match), route:["Form", match, match] } } else if(in_list(frappe.boot.treeviews, match)) { return { - label: __("{0} Tree", [""+__(match)+""]), + label: __("{0} Tree", [__(match).bold()]), value: __(match), route:["Tree", match] } } else { return { - label: __("{0} List", [""+__(match)+""]), + label: __("{0} List", [__(match).bold()]), value: __("{0} List", [__(match)]), route:["List", match] } @@ -257,7 +257,7 @@ frappe.search.verbs = [ route = ["query-report", match]; return { - label: __("Report {0}", [""+__(match)+""]), + label: __("Report {0}", [__(match).bold()]), value: __("Report {0}", [__(match)]), route: route } @@ -268,7 +268,7 @@ frappe.search.verbs = [ function(txt) { frappe.search.find(keys(frappe.search.pages), txt, function(match) { return { - label: __("Open {0}", [""+__(match)+""]), + label: __("Open {0}", [__(match).bold()]), value: __("Open {0}", [__(match)]), route: [frappe.search.pages[match].route || frappe.search.pages[match].name] } @@ -283,7 +283,7 @@ frappe.search.verbs = [ if(module._doctype) return; ret = { - label: __("Open {0}", [""+__(match)+""]), + label: __("Open {0}", [__(match).bold()]), value: __("Open {0}", [__(match)]), } if(module.link) { @@ -301,7 +301,7 @@ frappe.search.verbs = [ parts = txt.split(" in "); frappe.search.find(frappe.boot.user.can_read, parts[1], function(match) { return { - label: __('Find {0} in {1}', [""+__(parts[0])+"", ""+__(match)+""]), + label: __('Find {0} in {1}', [__(parts[0]).bold(), __(match).bold()]), value: __('Find {0} in {1}', [__(parts[0]), __(match)]), route_options: {"name": ["like", "%" + parts[0] + "%"]}, route: ["List", match] @@ -320,7 +320,7 @@ frappe.search.verbs = [ try { var val = eval(txt); - var formatted_value = __('{0} = {1}', [txt, ""+val+""]); + var formatted_value = __('{0} = {1}', [txt, (val + '').bold()]); frappe.search.options.push({ label: formatted_value, value: __('{0} = {1}', [txt, val]),