diff --git a/lms/lms/doctype/lms_certificate/lms_certificate.json b/lms/lms/doctype/lms_certificate/lms_certificate.json index 91ec1085..d1d2a8a2 100644 --- a/lms/lms/doctype/lms_certificate/lms_certificate.json +++ b/lms/lms/doctype/lms_certificate/lms_certificate.json @@ -56,7 +56,7 @@ ], "index_web_pages_for_search": 1, "links": [], - "modified": "2022-04-06 11:49:36.077370", + "modified": "2023-04-14 12:33:37.839625", "modified_by": "Administrator", "module": "LMS", "name": "LMS Certificate", diff --git a/lms/lms/doctype/lms_certificate/lms_certificate.py b/lms/lms/doctype/lms_certificate/lms_certificate.py index 3c5f4de8..5e4f8688 100644 --- a/lms/lms/doctype/lms_certificate/lms_certificate.py +++ b/lms/lms/doctype/lms_certificate/lms_certificate.py @@ -5,8 +5,6 @@ import frappe from frappe import _ from frappe.model.document import Document from frappe.utils import add_years, nowdate -from frappe.utils.pdf import get_pdf - from lms.lms.utils import is_certified @@ -47,10 +45,3 @@ def create_certificate(course): ) certificate.save(ignore_permissions=True) return certificate - - -@frappe.whitelist() -def get_certificate_pdf(html): - frappe.local.response.filename = "certificate.pdf" - frappe.local.response.filecontent = get_pdf(html, {"orientation": "LandScape"}) - frappe.local.response.type = "pdf" diff --git a/lms/lms/doctype/lms_settings/lms_settings.json b/lms/lms/doctype/lms_settings/lms_settings.json index 7dbeed68..f3ed9073 100644 --- a/lms/lms/doctype/lms_settings/lms_settings.json +++ b/lms/lms/doctype/lms_settings/lms_settings.json @@ -15,7 +15,6 @@ "search_placeholder", "portal_course_creation", "column_break_2", - "custom_certificate_template", "livecode_url", "signup_settings_tab", "signup_settings_section", @@ -139,12 +138,6 @@ "fieldtype": "Check", "label": "Ask User Category during Signup" }, - { - "fieldname": "custom_certificate_template", - "fieldtype": "Link", - "label": "Custom Certificate Template", - "options": "Web Template" - }, { "default": "0", "fieldname": "is_onboarding_complete", @@ -192,7 +185,7 @@ "index_web_pages_for_search": 1, "issingle": 1, "links": [], - "modified": "2023-02-23 10:39:38.912549", + "modified": "2023-04-17 12:54:44.706101", "modified_by": "Administrator", "module": "LMS", "name": "LMS Settings", diff --git a/lms/lms/print_format/__init__.py b/lms/lms/print_format/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/lms/lms/print_format/certificate/__init__.py b/lms/lms/print_format/certificate/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/lms/lms/print_format/certificate/certificate.json b/lms/lms/print_format/certificate/certificate.json new file mode 100644 index 00000000..cea5f505 --- /dev/null +++ b/lms/lms/print_format/certificate/certificate.json @@ -0,0 +1,32 @@ +{ + "absolute_value": 0, + "align_labels_right": 0, + "creation": "2023-02-22 21:36:54.560420", + "css": ".outer-border {\n font-family: \"Inter\" sans-serif;\n font-size: 16px;\n border-radius: 0.5rem;\n border: 1px solid #E2E6E9;\n padding: 1rem;\n}\n\n.inner-border {\n border: 10px solid #0089FF;\n border-radius: 8px;\n text-align: center;\n padding: 6rem 4rem;\n background-color: #FFFFFF;\n}\n\n.certificate-logo {\n height: 1.5rem;\n margin-bottom: 4rem;\n}\n\n.certificate-name {\n font-size: 2rem;\n font-weight: 500;\n color: #192734;\n margin-bottom: 0.5rem;\n}\n\n.certificate-footer {\n margin: 4rem auto 0;\n width: 70%;\n text-align: center;\n}\n\n.certificate-footer-item {\n color: #192734;\n}\n\n.cursive-font {\n font-family: cursive;\n font-weight: 600;\n}\n\n.certificate-divider {\n margin: 0.5rem 0;\n}\n\n.certificate-expiry {\n margin-left: 2rem;\n}", + "custom_format": 1, + "disabled": 0, + "doc_type": "LMS Certificate", + "docstatus": 0, + "doctype": "Print Format", + "font_size": 14, + "format_data": "{\"header\":\"
{{ doc.name }}
\\n| \n \n {% for i in instructors %}\n \t\t\t\t\t{{ frappe.db.get_value(\"User\", i, \"full_name\") }}\n \t\t\t\t\t{% if not loop.last %}\n \t\t\t\t\t,\n \t\t\t\t\t{% endif %}\n \t\t\t\t\t{% endfor %}\n \n \n {{ _(\"Course Instructor\") }} \n | \n {% endif %}\n \n {% if certificate.expiry_date %}\n \n \n | \n \n {{ frappe.utils.format_date(certificate.expiry_date, \"medium\") }}\n \n \n {{ _(\"Expiry Date\") }} \n | \n {% endif %}\n