fix: certificate website link

This commit is contained in:
Jannat Patel
2024-04-01 17:27:12 +05:30
parent de0a983033
commit 05fdf163a9
4 changed files with 7 additions and 4 deletions

Submodule frappe-ui updated: 2898a0bdd1...3b700c7a8a

View File

@@ -22,7 +22,9 @@ frappe.ui.form.on("LMS Certificate", {
refresh: (frm) => {
if (frm.doc.name)
frm.add_web_link(
`/lms/courses/${frm.doc.course}/${frm.doc.name}`,
`/api/method/frappe.utils.print_format.download_pdf?doctype=LMS+Certificate&name=${
frm.doc.name
}&format=${encodeURIComponent(frm.doc.template)}`,
"See on Website"
);
},

View File

@@ -27,6 +27,7 @@ class LMSCertificate(Document):
"course_name": self.course,
"course_title": frappe.db.get_value("LMS Course", self.course, "title"),
"certificate_name": self.name,
"template": self.template,
}
if custom_template:

View File

@@ -7,10 +7,10 @@
</p>
<br>
<p>
{{ _("With this certification, you can now showcase your updated skills and share your achievement with your colleagues and on LinkedIn. To access your certificate, please click on the link provided below.") }}
{{ _("With this certification, you can now showcase your updated skills and share your achievement with your colleagues and on LinkedIn. To access your certificate, please click on the link provided below. Make sure you are logged in to the portal.") }}
</p>
<br>
<a href="/courses/{{ course_name }}/{{certificate_name}}">{{ _("Certificate Link") }}</a>
<a href="/api/method/frappe.utils.print_format.download_pdf?doctype=LMS+Certificate&name={{certificate_name}}&format={{encodeURIComponent(template)}}">{{ _("Certificate Link") }}</a>
<br>
<p>
{{ _("Once again, congratulations on this significant accomplishment.")}}