mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 07:54:46 +00:00
feat: update item group website slider
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
"route",
|
||||
"weightage",
|
||||
"slideshow",
|
||||
"website_title",
|
||||
"description",
|
||||
"website_specifications",
|
||||
"website_filters_section",
|
||||
@@ -200,6 +201,11 @@
|
||||
"fieldtype": "Table",
|
||||
"label": "Attributes",
|
||||
"options": "Website Attribute"
|
||||
},
|
||||
{
|
||||
"fieldname": "website_title",
|
||||
"fieldtype": "Data",
|
||||
"label": "Title"
|
||||
}
|
||||
],
|
||||
"icon": "fa fa-sitemap",
|
||||
@@ -208,7 +214,7 @@
|
||||
"is_tree": 1,
|
||||
"links": [],
|
||||
"max_attachments": 3,
|
||||
"modified": "2020-12-29 14:04:26.075008",
|
||||
"modified": "2020-12-30 12:57:38.876956",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Setup",
|
||||
"name": "Item Group",
|
||||
|
||||
@@ -21,7 +21,8 @@ class ItemGroup(NestedSet, WebsiteGenerator):
|
||||
website = frappe._dict(
|
||||
condition_field = "show_in_website",
|
||||
template = "templates/generators/item_group.html",
|
||||
no_cache = 1
|
||||
no_cache = 1,
|
||||
no_breadcrumbs = 1
|
||||
)
|
||||
|
||||
def autoname(self):
|
||||
@@ -100,6 +101,29 @@ class ItemGroup(NestedSet, WebsiteGenerator):
|
||||
"title": self.name
|
||||
})
|
||||
|
||||
if self.slideshow:
|
||||
values = {
|
||||
'show_indicators': 1,
|
||||
'show_controls': 0,
|
||||
'rounded': 1,
|
||||
'slider_name': self.slideshow
|
||||
}
|
||||
slideshow = frappe.get_doc("Website Slideshow", self.slideshow)
|
||||
slides = slideshow.get({"doctype":"Website Slideshow Item"})
|
||||
for index, slide in enumerate(slides):
|
||||
values[f"slide_{index + 1}_image"] = slide.image
|
||||
values[f"slide_{index + 1}_title"] = slide.heading
|
||||
values[f"slide_{index + 1}_subtitle"] = slide.description
|
||||
values[f"slide_{index + 1}_theme"] = slide.theme or "Light"
|
||||
values[f"slide_{index + 1}_content_align"] = slide.content_align or "Centre"
|
||||
values[f"slide_{index + 1}_primary_action_label"] = slide.label
|
||||
values[f"slide_{index + 1}_primary_action"] = slide.url
|
||||
|
||||
context.slideshow = values
|
||||
|
||||
context.breadcrumbs = 0
|
||||
context.title = self.website_title or self.name
|
||||
|
||||
return context
|
||||
|
||||
def delete_child_item_groups_key(self):
|
||||
|
||||
Reference in New Issue
Block a user