fix: certificate style and meta
This commit is contained in:
@@ -860,16 +860,15 @@ pre {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.certificate-ribbon {
|
.certificate-ribbon {
|
||||||
background-color: var(--primary-color);
|
background-color: var(--primary-color);
|
||||||
padding: 0.5rem;
|
padding: 0.5rem;
|
||||||
border-radius: var(--border-radius-md);
|
border-radius: var(--border-radius-md);
|
||||||
}
|
}
|
||||||
|
|
||||||
.certificate-heading {
|
.certificate-heading {
|
||||||
font-size: 1.5rem;
|
font-size: 2rem;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
margin-top: 0.5rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.certificate-para {
|
.certificate-para {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ def get_context(context):
|
|||||||
if context.certificate.course != course_name:
|
if context.certificate.course != course_name:
|
||||||
redirect_to_course_list()
|
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.instructors = (", ").join([x.full_name for x in get_instructors(course_name)])
|
||||||
context.member = frappe.db.get_value("User", context.certificate.member,
|
context.member = frappe.db.get_value("User", context.certificate.member,
|
||||||
["full_name"], as_dict=True)
|
["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_certificate_template = frappe.db.get_value("Web Template", template_name, "template")
|
||||||
context.custom_template = render_template(context.custom_certificate_template, context)
|
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():
|
def redirect_to_course_list():
|
||||||
frappe.local.flags.redirect_location = "/courses"
|
frappe.local.flags.redirect_location = "/courses"
|
||||||
raise frappe.Redirect
|
raise frappe.Redirect
|
||||||
|
|||||||
Reference in New Issue
Block a user