Merge branch 'rebrand-ui' of https://github.com/frappe/erpnext into rebrand-ui
This commit is contained in:
commit
2d1d900c88
@ -17,7 +17,7 @@ class ProductsSettings(Document):
|
|||||||
|
|
||||||
self.validate_field_filters()
|
self.validate_field_filters()
|
||||||
self.validate_attribute_filters()
|
self.validate_attribute_filters()
|
||||||
frappe.clear_document_cache("Product Settings")
|
frappe.clear_document_cache("Product Settings", "Product Settings")
|
||||||
|
|
||||||
def validate_field_filters(self):
|
def validate_field_filters(self):
|
||||||
if not (self.enable_field_filters and self.filter_fields): return
|
if not (self.enable_field_filters and self.filter_fields): return
|
||||||
|
@ -83,6 +83,10 @@ body.product-page {
|
|||||||
// text-align: left;
|
// text-align: left;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
.card-img-container {
|
||||||
|
height: 210px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.card-img {
|
.card-img {
|
||||||
max-height: 210px;
|
max-height: 210px;
|
||||||
@ -308,10 +312,6 @@ body.product-page {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
svg {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,6 +98,8 @@ class ItemGroup(NestedSet, WebsiteGenerator):
|
|||||||
context.field_filters = filter_engine.get_field_filters()
|
context.field_filters = filter_engine.get_field_filters()
|
||||||
context.attribute_filters = filter_engine.get_attribute_fitlers()
|
context.attribute_filters = filter_engine.get_attribute_fitlers()
|
||||||
|
|
||||||
|
print(context.field_filters, context.attribute_filters)
|
||||||
|
|
||||||
context.update({
|
context.update({
|
||||||
"parents": get_parent_item_groups(self.parent_item_group),
|
"parents": get_parent_item_groups(self.parent_item_group),
|
||||||
"title": self.name
|
"title": self.name
|
||||||
|
@ -16,6 +16,7 @@ class ProductFiltersBuilder:
|
|||||||
|
|
||||||
def get_field_filters(self):
|
def get_field_filters(self):
|
||||||
filter_fields = [row.fieldname for row in self.doc.filter_fields]
|
filter_fields = [row.fieldname for row in self.doc.filter_fields]
|
||||||
|
print('FILTERS', self.doc.filter_fields)
|
||||||
|
|
||||||
meta = frappe.get_meta('Item')
|
meta = frappe.get_meta('Item')
|
||||||
fields = [df for df in meta.fields if df.fieldname in filter_fields]
|
fields = [df for df in meta.fields if df.fieldname in filter_fields]
|
||||||
@ -52,6 +53,7 @@ class ProductFiltersBuilder:
|
|||||||
|
|
||||||
def get_attribute_fitlers(self):
|
def get_attribute_fitlers(self):
|
||||||
attributes = [row.attribute for row in self.doc.filter_attributes]
|
attributes = [row.attribute for row in self.doc.filter_attributes]
|
||||||
|
print('ATTRIBUTES', attributes)
|
||||||
attribute_docs = [
|
attribute_docs = [
|
||||||
frappe.get_doc('Item Attribute', attribute) for attribute in attributes
|
frappe.get_doc('Item Attribute', attribute) for attribute in attributes
|
||||||
]
|
]
|
||||||
|
@ -89,7 +89,9 @@
|
|||||||
<div class="col-sm-{{ col_size }} item-card">
|
<div class="col-sm-{{ col_size }} item-card">
|
||||||
<div class="card {{ align_items_class }}">
|
<div class="card {{ align_items_class }}">
|
||||||
{% if image %}
|
{% if image %}
|
||||||
<img class="card-img" src="{{ image }}" alt="{{ title }}">
|
<div class="card-img-container">
|
||||||
|
<img class="card-img" src="{{ image }}" alt="{{ title }}">
|
||||||
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="card-img-top no-image">
|
<div class="card-img-top no-image">
|
||||||
{{ frappe.utils.get_abbr(title) }}
|
{{ frappe.utils.get_abbr(title) }}
|
||||||
|
@ -12,6 +12,7 @@ def get_context(context):
|
|||||||
search = frappe.form_dict.search
|
search = frappe.form_dict.search
|
||||||
field_filters = frappe.parse_json(frappe.form_dict.field_filters)
|
field_filters = frappe.parse_json(frappe.form_dict.field_filters)
|
||||||
attribute_filters = frappe.parse_json(frappe.form_dict.attribute_filters)
|
attribute_filters = frappe.parse_json(frappe.form_dict.attribute_filters)
|
||||||
|
print(field_filters, attribute_filters)
|
||||||
start = frappe.parse_json(frappe.form_dict.start)
|
start = frappe.parse_json(frappe.form_dict.start)
|
||||||
else:
|
else:
|
||||||
search = field_filters = attribute_filters = None
|
search = field_filters = attribute_filters = None
|
||||||
@ -29,6 +30,8 @@ def get_context(context):
|
|||||||
context.field_filters = filter_engine.get_field_filters()
|
context.field_filters = filter_engine.get_field_filters()
|
||||||
context.attribute_filters = filter_engine.get_attribute_fitlers()
|
context.attribute_filters = filter_engine.get_attribute_fitlers()
|
||||||
|
|
||||||
|
print(context.field_filters, context.attribute_filters)
|
||||||
|
|
||||||
context.product_settings = product_settings
|
context.product_settings = product_settings
|
||||||
context.body_class = "product-page"
|
context.body_class = "product-page"
|
||||||
context.page_length = product_settings.products_per_page or 20
|
context.page_length = product_settings.products_per_page or 20
|
||||||
|
Loading…
x
Reference in New Issue
Block a user