Added ListPage and other UI improvements

This commit is contained in:
scmmishra
2018-11-14 14:23:06 +05:30
committed by Aditya Hase
parent efb01c3f75
commit 85c2feec0d
12 changed files with 102 additions and 38 deletions

View File

@@ -28,6 +28,15 @@ def get_featured_programs():
else:
return None
@frappe.whitelist(allow_guest=True)
def get_all_programs():
program_names = frappe.get_all("Program", filters={"is_published": True})
if program_names:
featured_list = [get_program(program['name']) for program in program_names]
return featured_list
else:
return None
def get_program(program_name):
program = frappe.get_doc('Program', program_name)
is_enrolled = check_program_enrollment(program_name)