refactor: rename hub-card-container to hub-items-container

This commit is contained in:
Faris Ansari 2018-08-17 14:29:22 +05:30
parent 460e2798cd
commit aa46567439
5 changed files with 7 additions and 12 deletions

View File

@ -3,13 +3,13 @@ import { get_item_card_html } from './item_card';
function get_item_card_container_html(items, title='', get_item_html = get_item_card_html, action='') { function get_item_card_container_html(items, title='', get_item_html = get_item_card_html, action='') {
const items_html = (items || []).map(item => get_item_html(item)).join(''); const items_html = (items || []).map(item => get_item_html(item)).join('');
const title_html = title const title_html = title
? `<div class="hub-card-container-header col-sm-12 margin-bottom flex"> ? `<div class="hub-items-header col-sm-12 margin-bottom flex">
<h4>${title}</h4> <h4>${title}</h4>
${action} ${action}
</div>` </div>`
: ''; : '';
const html = `<div class="row hub-card-container"> const html = `<div class="row hub-items-container">
${title_html} ${title_html}
${items_html} ${items_html}
</div>`; </div>`;

View File

@ -11,7 +11,7 @@ erpnext.hub.Category = class Category extends SubPage {
} }
get_items_for_category(category) { get_items_for_category(category) {
this.$wrapper.find('.hub-card-container').empty(); this.$wrapper.find('.hub-items-container').empty();
return hub.call('get_items', { return hub.call('get_items', {
filters: { filters: {
hub_category: category hub_category: category

View File

@ -20,7 +20,7 @@ erpnext.hub.Home = class Home extends SubPage {
} }
get_items_and_render() { get_items_and_render() {
this.$wrapper.find('.hub-card-container').empty(); this.$wrapper.find('.hub-items-container').empty();
this.get_data() this.get_data()
.then(data => { .then(data => {
this.render(data); this.render(data);

View File

@ -3,7 +3,7 @@ import { get_item_card_container_html } from '../components/items_container';
erpnext.hub.PublishedProducts = class PublishedProducts extends SubPage { erpnext.hub.PublishedProducts = class PublishedProducts extends SubPage {
get_items_and_render() { get_items_and_render() {
this.$wrapper.find('.hub-card-container').empty(); this.$wrapper.find('.hub-items-container').empty();
this.get_published_products() this.get_published_products()
.then(items => this.render(items)); .then(items => this.render(items));
} }

View File

@ -223,15 +223,10 @@ body[data-route^="marketplace/"] {
border-bottom: none; border-bottom: none;
} }
.hub-card-container { .hub-items-container {
.hub-card-container-header { .hub-items-header {
margin-top: 32px;
justify-content: space-between; justify-content: space-between;
align-items: baseline; align-items: baseline;
h4 {
font-weight: 500;
}
} }
} }