fix: certificate style and meta

This commit is contained in:
Jannat Patel
2022-05-16 13:22:30 +05:30
parent 4fb2241621
commit b9993796a0
2 changed files with 13 additions and 8 deletions

View File

@@ -860,16 +860,15 @@ pre {
}
.certificate-ribbon {
background-color: var(--primary-color);
padding: 0.5rem;
border-radius: var(--border-radius-md);
background-color: var(--primary-color);
padding: 0.5rem;
border-radius: var(--border-radius-md);
}
.certificate-heading {
font-size: 1.5rem;
font-weight: 500;
color: var(--text-color);
margin-top: 0.5rem;
font-size: 2rem;
font-weight: 500;
color: var(--text-color);
}
.certificate-para {

View File

@@ -17,7 +17,7 @@ def get_context(context):
if context.certificate.course != course_name:
redirect_to_course_list()
context.course = frappe.db.get_value("LMS Course", course_name, ["title", "name"], as_dict=True)
context.course = frappe.db.get_value("LMS Course", course_name, ["title", "name", "image"], as_dict=True)
context.instructors = (", ").join([x.full_name for x in get_instructors(course_name)])
context.member = frappe.db.get_value("User", context.certificate.member,
["full_name"], as_dict=True)
@@ -27,6 +27,12 @@ def get_context(context):
context.custom_certificate_template = frappe.db.get_value("Web Template", template_name, "template")
context.custom_template = render_template(context.custom_certificate_template, context)
context.metatags = {
"title": f"{member.full_name} - {course.title}",
"image": course.image,
"keywords": course.title, member.full_name
}
def redirect_to_course_list():
frappe.local.flags.redirect_location = "/courses"
raise frappe.Redirect