fix: mobile layout and certification link
This commit is contained in:
@@ -136,13 +136,17 @@ override_whitelisted_methods = {
|
||||
# Add all simple route rules here
|
||||
website_route_rules = [
|
||||
{"from_route": "/lms/<path:app_path>", "to_route": "lms"},
|
||||
{
|
||||
"from_route": "/courses/<course_name>/<certificate_id>",
|
||||
"to_route": "certificate",
|
||||
},
|
||||
]
|
||||
|
||||
website_redirects = [
|
||||
{"source": "/update-profile", "target": "/edit-profile"},
|
||||
{"source": "/courses", "target": "/lms/courses"},
|
||||
{
|
||||
"source": r"/courses/(.*)",
|
||||
"source": r"/courses/([^/]*)",
|
||||
"target": "/lms/courses",
|
||||
"match_with_query_string": True,
|
||||
},
|
||||
|
||||
0
lms/www/certificate.html
Normal file
0
lms/www/certificate.html
Normal file
14
lms/www/certificate.py
Normal file
14
lms/www/certificate.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import frappe
|
||||
from urllib.parse import quote
|
||||
|
||||
|
||||
def get_context(context):
|
||||
context.no_cache = 1
|
||||
template = frappe.db.get_value(
|
||||
"LMS Certificate", frappe.form_dict.certificate_id, "template"
|
||||
)
|
||||
certificate_id = frappe.form_dict.certificate_id
|
||||
template = quote(template)
|
||||
|
||||
frappe.local.flags.redirect_location = f"/api/method/frappe.utils.print_format.download_pdf?doctype=LMS+Certificate&name={certificate_id}&format={template}"
|
||||
raise frappe.Redirect
|
||||
Reference in New Issue
Block a user