mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-16 03:29:16 +00:00
fix: Empty states and miscellanous fixes
- Added Wishlist and Product Listing empty states - Hide ‘Write Review’ button f user is not Customer - Fixed grid view title (missing arg) - Render empty state if no items form server side - Removed unused function - Guest user redirected to login on clicking Wishlist button - Fixed ‘Notes’ field clearing issue
This commit is contained in:
@@ -5,11 +5,11 @@
|
||||
{{ ratings_summary(reviews, reviews_per_rating, average_rating, average_whole_rating) }}
|
||||
|
||||
<!-- Write a Review for legitimate users -->
|
||||
{% if frappe.session.user != "Guest" %}
|
||||
<button class="btn btn-light btn-write-review mr-2 mt-4 mb-4 w-100"
|
||||
data-web-item="{{ doc.name }}">
|
||||
{{ _("Write a Review") }}
|
||||
</button>
|
||||
{% if frappe.session.user != "Guest" and user_is_customer %}
|
||||
<button class="btn btn-light btn-write-review mr-2 mt-4 mb-4 w-100"
|
||||
data-web-item="{{ doc.name }}">
|
||||
{{ _("Write a Review") }}
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ $.extend(shopping_cart, {
|
||||
shopping_cart.bind_request_quotation();
|
||||
shopping_cart.bind_change_qty();
|
||||
shopping_cart.bind_change_notes();
|
||||
shopping_cart.bind_dropdown_cart_buttons();
|
||||
shopping_cart.bind_coupon_code();
|
||||
},
|
||||
|
||||
@@ -129,8 +128,14 @@ $.extend(shopping_cart, {
|
||||
}
|
||||
}
|
||||
input.val(newVal);
|
||||
|
||||
let notes = input.closest("td").siblings().find(".notes").text().trim();
|
||||
var item_code = input.attr("data-item-code");
|
||||
shopping_cart.shopping_cart_update({item_code, qty: newVal});
|
||||
shopping_cart.shopping_cart_update({
|
||||
item_code,
|
||||
qty: newVal,
|
||||
additional_notes: notes
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
{{ _('Variant of') }} <a href="{{frappe.db.get_value('Item', variant_of, 'route')}}">{{ variant_of }}</a>
|
||||
</span>
|
||||
{% endif %}
|
||||
<div class="mt-2">
|
||||
<div class="mt-2 notes">
|
||||
<textarea data-item-code="{{d.item_code}}" class="form-control" rows="2" placeholder="{{ _('Add notes') }}">{{d.additional_notes or ''}}</textarea>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -17,8 +17,12 @@
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<!-- TODO: Make empty state for wishlist -->
|
||||
{% include "erpnext/www/all-products/not_found.html" %}
|
||||
<div class="cart-empty frappe-card">
|
||||
<div class="cart-empty-state">
|
||||
<img src="/assets/erpnext/images/ui-states/cart-empty-state.png" alt="Empty Cart">
|
||||
</div>
|
||||
<div class="cart-empty-message mt-4">{{ _('Wishlist is empty!') }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user