diff --git a/erpnext/public/js/hub/marketplace.js b/erpnext/public/js/hub/marketplace.js index e29ae6fc235..18a1bb06294 100644 --- a/erpnext/public/js/hub/marketplace.js +++ b/erpnext/public/js/hub/marketplace.js @@ -4,6 +4,7 @@ import './pages/favourites'; import './pages/search'; import './pages/category'; import './pages/item'; +import './pages/seller'; import './pages/register'; import './pages/profile'; import './pages/publish'; @@ -164,6 +165,10 @@ erpnext.hub.Marketplace = class Marketplace { this.subpages.item = new erpnext.hub.Item(this.$body); } + if (route[1] === 'seller' && !this.subpages['seller']) { + this.subpages['seller'] = new erpnext.hub.Seller(this.$body); + } + if (route[1] === 'register' && !this.subpages.register) { if (this.registered) { frappe.set_route('marketplace', 'home'); diff --git a/erpnext/public/js/hub/pages/seller.js b/erpnext/public/js/hub/pages/seller.js new file mode 100644 index 00000000000..94e83414c74 --- /dev/null +++ b/erpnext/public/js/hub/pages/seller.js @@ -0,0 +1,85 @@ +import SubPage from './subpage'; + +erpnext.hub.Seller = class Seller extends SubPage { + make_wrapper() { + super.make_wrapper(); + } + + refresh() { + this.show_skeleton(); + this.company = frappe.get_route()[2]; + this.get_hub_seller_profile() + .then(this.render.bind(this)); + } + + get_hub_seller_profile() { + return hub.call('get_hub_seller_profile', { company: this.company }); + } + + // get_hub_seller_items(profile) { + // this.profile = profile; + // console.log(profile); + // return hub.call('get_items', { hub_seller: profile.user }); + // } + + show_skeleton() { + const skeleton = `
Details
+Ratings
+Desc
+Desc
+${p.country}
+${p.site_name}
+${__(`Joined ${comment_when(p.creation)}`)}
+${p.company_description}
` + : `__('No description')
+