Update messages UI

This commit is contained in:
Suraj Shetty
2018-08-25 21:22:55 +05:30
parent 88700cf2b9
commit 0e59ec3ed2
6 changed files with 161 additions and 72 deletions

View File

@@ -91,10 +91,10 @@ erpnext.hub.Marketplace = class Marketplace {
<li class="hub-sidebar-item text-muted" data-route="marketplace/publish">
${__('Publish Products')}
</li>
<li class="hub-sidebar-item text-muted" data-route="marketplace/selling-messages">
<li class="hub-sidebar-item text-muted" data-route="marketplace/selling">
${__('Selling')}
</li>
<li class="hub-sidebar-item text-muted" data-route="marketplace/buying-messages">
<li class="hub-sidebar-item text-muted" data-route="marketplace/buying">
${__('Buying')}
</li>
`
@@ -218,20 +218,12 @@ erpnext.hub.Marketplace = class Marketplace {
this.subpages['my-products'] = new erpnext.hub.PublishedProductsPage(this.$body);
}
if (route[1] === 'buying-messages' && !this.subpages['buying-messages']) {
this.subpages['buying-messages'] = new erpnext.hub.Messages(this.$body, 'Buying');
}
if (route[1] === 'selling-messages' && !this.subpages['selling-messages']) {
this.subpages['selling-messages'] = new erpnext.hub.Messages(this.$body, 'Selling');
}
if (route[1] === 'buying' && !this.subpages['buying']) {
this.subpages['buying'] = new erpnext.hub.MessageList(this.$body, 'Buying');
this.subpages['buying'] = new erpnext.hub.Buying(this.$body);
}
if (route[1] === 'selling' && !this.subpages['selling']) {
this.subpages['selling'] = new erpnext.hub.MessageList(this.$body, 'Selling');
this.subpages['selling'] = new erpnext.hub.Selling(this.$body, 'Selling');
}
// dont allow unregistered users to access registered routes