Merge pull request #11628 from frappe/fix_web_template_type
fix: allow empty type for Web Templates that are not sections
This commit is contained in:
commit
b2e5472ea3
3 changed files with 14 additions and 5 deletions
|
|
@ -193,7 +193,7 @@ def inspect(var, render=True):
|
|||
return get_jenv().from_string(html).render(context)
|
||||
|
||||
|
||||
def web_block(template, values, **kwargs):
|
||||
def web_block(template, values=None, **kwargs):
|
||||
options = {"template": template, "values": values}
|
||||
options.update(kwargs)
|
||||
return web_blocks([options])
|
||||
|
|
|
|||
|
|
@ -19,6 +19,15 @@ frappe.ui.form.on('Web Page', {
|
|||
insert_code: function(frm) {
|
||||
frm.events.layout(frm);
|
||||
},
|
||||
onload: function(frm) {
|
||||
frm.set_query('web_template', 'page_blocks', function() {
|
||||
return {
|
||||
filters: {
|
||||
"type": 'Section'
|
||||
}
|
||||
};
|
||||
});
|
||||
},
|
||||
refresh: function(frm) {
|
||||
if (frm.doc.template_path) {
|
||||
frm.set_read_only();
|
||||
|
|
@ -40,7 +49,6 @@ frappe.ui.form.on('Web Page', {
|
|||
frm.set_value('end_date', end_date);
|
||||
}
|
||||
},
|
||||
|
||||
set_meta_tags(frm) {
|
||||
frappe.utils.set_meta_tag(frm.doc.route);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,12 +36,13 @@
|
|||
"label": "Standard"
|
||||
},
|
||||
{
|
||||
"default": "Section",
|
||||
"fieldname": "type",
|
||||
"fieldtype": "Select",
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Type",
|
||||
"options": "Section\nNavbar\nFooter"
|
||||
"options": "Component\nSection\nNavbar\nFooter"
|
||||
},
|
||||
{
|
||||
"depends_on": "standard",
|
||||
|
|
@ -59,7 +60,7 @@
|
|||
"link_fieldname": "web_template"
|
||||
}
|
||||
],
|
||||
"modified": "2020-10-20 15:08:57.027962",
|
||||
"modified": "2020-10-22 17:36:45.042517",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Website",
|
||||
"name": "Web Template",
|
||||
|
|
@ -82,4 +83,4 @@
|
|||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue