chore: Wishlist UI (minor)

- Minor wishlist UI refresh, actions on hover, new icon
- Increase max length of wishlist card title
- Dont fetch outdated price in wishlist
- Translate 'out of stock'
- Use ORM
This commit is contained in:
marination
2021-07-14 01:36:50 +05:30
parent f14596a8f3
commit fed3b575eb
5 changed files with 45 additions and 46 deletions

View File

@@ -61,7 +61,7 @@ erpnext.ProductGrid = class {
get_card_body_html(item, title, settings) {
let body_html = `
<div class="card-body text-left card-body-flex" style="width:100%">
<div style="margin-top: 16px; display: flex;">
<div style="margin-top: 1rem; display: flex;">
`;
body_html += this.get_title(item, title);
@@ -76,7 +76,7 @@ erpnext.ProductGrid = class {
}
body_html += `</div>`; // close div on line 50
body_html += `</div>`;
body_html += `<div class="product-category">${ item.item_group || '' }</div>`;
if (item.formatted_price) {
@@ -145,7 +145,7 @@ erpnext.ProductGrid = class {
get_stock_availability(item, settings) {
if (!item.has_variants && !item.in_stock && settings.show_stock_availability) {
return `<span class="out-of-stock">Out of stock</span>`;
return `<span class="out-of-stock">${ __("Out of stock") }</span>`;
}
return ``;
}

View File

@@ -126,7 +126,10 @@ erpnext.ProductList = class {
get_stock_availability(item, settings) {
if (!item.has_variants && !item.in_stock && settings.show_stock_availability) {
return `<br><span class="out-of-stock mt-2">Out of stock</span>`;
return `
<br>
<span class="out-of-stock mt-2">${ __("Out of stock") }</span>
`;
}
return ``;
}