From 2ae80fd000646bf31ad89c69770a1a6fcee13bdc Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Tue, 31 Jul 2018 12:02:20 +0530 Subject: [PATCH] wip --- erpnext/public/js/hub/marketplace.js | 45 ++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/erpnext/public/js/hub/marketplace.js b/erpnext/public/js/hub/marketplace.js index 28309f3caf0..2c2a29d5255 100644 --- a/erpnext/public/js/hub/marketplace.js +++ b/erpnext/public/js/hub/marketplace.js @@ -332,6 +332,11 @@ erpnext.hub.SearchPage = class SearchPage extends SubPage { } erpnext.hub.Item = class Item extends SubPage { + make_wrapper() { + super.make_wrapper(); + this.setup_events(); + } + refresh() { this.show_skeleton(); this.hub_item_code = frappe.get_route()[2]; @@ -370,6 +375,29 @@ erpnext.hub.Item = class Item extends SubPage { this.$wrapper.html(skeleton); } + setup_events() { + this.$wrapper.on('click', '.btn-contact-seller', () => { + const d = new frappe.ui.Dialog({ + title: __('Send a message'), + fields: [ + { + fieldname: 'to', + fieldtype: 'Read Only', + label: __('To'), + default: this.item.company + }, + { + fieldtype: 'Text', + fieldname: 'message', + label: __('Message') + } + ] + }); + + d.show(); + }); + } + get_item(hub_item_code) { return hub.call('get_item_details', { hub_item_code }); } @@ -414,7 +442,7 @@ erpnext.hub.Item = class Item extends SubPage { -
+

${title}

${where}${dot_spacer}${when}

@@ -430,6 +458,11 @@ erpnext.hub.Item = class Item extends SubPage {
${edit_buttons_html}
+
+ +
@@ -438,11 +471,11 @@ erpnext.hub.Item = class Item extends SubPage {
-
- ${seller} -

- Contact Seller -

+
+ +