feat: request for certification
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"actions": [],
|
"actions": [],
|
||||||
"allow_rename": 1,
|
"allow_rename": 1,
|
||||||
|
"autoname": "field:evaluator",
|
||||||
"creation": "2022-03-29 10:51:47.667284",
|
"creation": "2022-03-29 10:51:47.667284",
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"editable_grid": 1,
|
"editable_grid": 1,
|
||||||
@@ -14,7 +15,8 @@
|
|||||||
"fieldname": "evaluator",
|
"fieldname": "evaluator",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Evaluator",
|
"label": "Evaluator",
|
||||||
"options": "User"
|
"options": "User",
|
||||||
|
"unique": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "schedule",
|
"fieldname": "schedule",
|
||||||
@@ -25,10 +27,11 @@
|
|||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2022-03-29 12:47:10.975155",
|
"modified": "2022-04-01 15:14:03.300260",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "Course Evaluator",
|
"name": "Course Evaluator",
|
||||||
|
"naming_rule": "By fieldname",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
{
|
{
|
||||||
@@ -46,6 +49,5 @@
|
|||||||
],
|
],
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
"states": [],
|
"states": []
|
||||||
"title_field": "evaluator"
|
|
||||||
}
|
}
|
||||||
@@ -8,8 +8,9 @@
|
|||||||
"field_order": [
|
"field_order": [
|
||||||
"course",
|
"course",
|
||||||
"member",
|
"member",
|
||||||
"start",
|
"date",
|
||||||
"end",
|
"start_time",
|
||||||
|
"end_time",
|
||||||
"column_break_5",
|
"column_break_5",
|
||||||
"rating",
|
"rating",
|
||||||
"summary"
|
"summary"
|
||||||
@@ -30,19 +31,9 @@
|
|||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 1,
|
"in_standard_filter": 1,
|
||||||
"label": "Member",
|
"label": "Member",
|
||||||
"options": "LMS Batch Membership",
|
"options": "User",
|
||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"fieldname": "start",
|
|
||||||
"fieldtype": "Datetime",
|
|
||||||
"label": "Start"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "end",
|
|
||||||
"fieldtype": "Datetime",
|
|
||||||
"label": "End"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"fieldname": "column_break_5",
|
"fieldname": "column_break_5",
|
||||||
"fieldtype": "Column Break"
|
"fieldtype": "Column Break"
|
||||||
@@ -51,17 +42,37 @@
|
|||||||
"fieldname": "rating",
|
"fieldname": "rating",
|
||||||
"fieldtype": "Rating",
|
"fieldtype": "Rating",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Rating"
|
"label": "Rating",
|
||||||
|
"reqd": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "summary",
|
"fieldname": "summary",
|
||||||
"fieldtype": "Text",
|
"fieldtype": "Text",
|
||||||
"label": "Summary"
|
"label": "Summary"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "date",
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 1,
|
||||||
|
"label": "Date",
|
||||||
|
"reqd": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "start_time",
|
||||||
|
"fieldtype": "Time",
|
||||||
|
"label": "Start Time",
|
||||||
|
"reqd": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "end_time",
|
||||||
|
"fieldtype": "Time",
|
||||||
|
"label": "End Time"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2022-03-29 09:48:45.682678",
|
"modified": "2022-04-01 16:26:39.168390",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "LMS Certificate Evaluation",
|
"name": "LMS Certificate Evaluation",
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
frappe.ui.form.on('LMS Certificate Request', {
|
frappe.ui.form.on('LMS Certificate Request', {
|
||||||
// refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
|
frm.add_custom_button(__("Create LMS Certificate Evaluation"), () => {
|
||||||
// }
|
frappe.model.open_mapped_doc({
|
||||||
|
method: "lms.lms.doctype.lms_certificate_request.lms_certificate_request.create_lms_certificate_evaluation",
|
||||||
|
frm: frm
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
"fieldname": "course",
|
"fieldname": "course",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 1,
|
||||||
"label": "Course",
|
"label": "Course",
|
||||||
"options": "LMS Course",
|
"options": "LMS Course",
|
||||||
"reqd": 1
|
"reqd": 1
|
||||||
@@ -29,19 +30,24 @@
|
|||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Member",
|
"label": "Member",
|
||||||
"options": "LMS Batch Membership",
|
"options": "User",
|
||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"fetch_from": "course.evaluator",
|
||||||
"fieldname": "evaluator",
|
"fieldname": "evaluator",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Link",
|
||||||
"label": "Evaluator",
|
"label": "Evaluator",
|
||||||
|
"options": "Course Evaluator",
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "date",
|
"fieldname": "date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"label": "Date"
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 1,
|
||||||
|
"label": "Date",
|
||||||
|
"reqd": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "day",
|
"fieldname": "day",
|
||||||
@@ -52,12 +58,16 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "start_time",
|
"fieldname": "start_time",
|
||||||
"fieldtype": "Time",
|
"fieldtype": "Time",
|
||||||
"label": "Start Time"
|
"in_list_view": 1,
|
||||||
|
"label": "Start Time",
|
||||||
|
"reqd": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "end_time",
|
"fieldname": "end_time",
|
||||||
"fieldtype": "Time",
|
"fieldtype": "Time",
|
||||||
"label": "End Time"
|
"in_list_view": 1,
|
||||||
|
"label": "End Time",
|
||||||
|
"reqd": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "column_break_4",
|
"fieldname": "column_break_4",
|
||||||
@@ -66,7 +76,7 @@
|
|||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2022-03-30 10:04:17.530698",
|
"modified": "2022-04-01 15:29:31.553492",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "LMS Certificate Request",
|
"name": "LMS Certificate Request",
|
||||||
|
|||||||
@@ -3,17 +3,38 @@
|
|||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
from frappe.model.mapper import get_mapped_doc
|
||||||
|
|
||||||
class LMSCertificateRequest(Document):
|
class LMSCertificateRequest(Document):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def create_certificate_request(course, day, start_time, end_time):
|
def create_certificate_request(course, date, day, start_time, end_time):
|
||||||
evaluator = frappe.db.get_value("LMS Course", course, "evaluator")
|
is_member = frappe.db.exists({
|
||||||
|
"doctype": "LMS Batch Membership",
|
||||||
|
"course": course,
|
||||||
|
"member": frappe.session.user
|
||||||
|
})
|
||||||
|
|
||||||
|
if not is_member:
|
||||||
|
return
|
||||||
|
|
||||||
frappe.get_doc({
|
frappe.get_doc({
|
||||||
"doctype": "LMS Certificate Request",
|
"doctype": "LMS Certificate Request",
|
||||||
"course": course,
|
"course": course,
|
||||||
|
"member": frappe.session.user,
|
||||||
|
"date": date,
|
||||||
"day": day,
|
"day": day,
|
||||||
"start_time": start_time,
|
"start_time": start_time,
|
||||||
"end_time": end_time
|
"end_time": end_time
|
||||||
}).save(ignore_permissions=True)
|
}).save(ignore_permissions=True)
|
||||||
|
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def create_lms_certificate_evaluation(source_name, target_doc=None):
|
||||||
|
doc = get_mapped_doc("LMS Certificate Request", source_name, {
|
||||||
|
"LMS Certificate Request": {
|
||||||
|
"doctype": "LMS Certificate Evaluation"
|
||||||
|
}
|
||||||
|
}, target_doc)
|
||||||
|
return doc
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"actions": [],
|
"actions": [],
|
||||||
|
"autoname": "format:CERT-{#####}",
|
||||||
"creation": "2021-08-16 15:47:19.494055",
|
"creation": "2021-08-16 15:47:19.494055",
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"editable_grid": 1,
|
"editable_grid": 1,
|
||||||
@@ -45,10 +46,11 @@
|
|||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-08-16 15:47:19.494055",
|
"modified": "2022-04-01 16:41:10.213765",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "LMS Certification",
|
"name": "LMS Certification",
|
||||||
|
"naming_rule": "Expression",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
{
|
{
|
||||||
@@ -66,5 +68,6 @@
|
|||||||
],
|
],
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
|
"states": [],
|
||||||
"track_changes": 1
|
"track_changes": 1
|
||||||
}
|
}
|
||||||
@@ -214,7 +214,7 @@
|
|||||||
"link_fieldname": "course"
|
"link_fieldname": "course"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"modified": "2022-03-29 14:56:03.989375",
|
"modified": "2022-04-01 15:19:13.075063",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "LMS Course",
|
"name": "LMS Course",
|
||||||
@@ -248,6 +248,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"search_fields": "title",
|
"search_fields": "title",
|
||||||
|
"show_title_field_in_link": 1,
|
||||||
"sort_field": "creation",
|
"sort_field": "creation",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
"states": [],
|
"states": [],
|
||||||
|
|||||||
@@ -105,6 +105,12 @@
|
|||||||
{{ _("You have opted to be notified for this course. You will receive an email when the course becomes available.") }}
|
{{ _("You have opted to be notified for this course. You will receive an email when the course becomes available.") }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% if certificate_request %}
|
||||||
|
<p> <b>{{ _("Evaluation On") }}</b>
|
||||||
|
{{ _(": {0} at {1}").format(frappe.utils.format_date(certificate_request.date, "medium"),
|
||||||
|
frappe.utils.format_time(certificate_request.start_time, "short")) }} </p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if course.status == "Under Review" %}
|
{% if course.status == "Under Review" %}
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
{{ _("Your course is currently under review. Once the review is complete, the System Admins will publish it on the website.") }}
|
{{ _("Your course is currently under review. Once the review is complete, the System Admins will publish it on the website.") }}
|
||||||
@@ -194,7 +200,7 @@
|
|||||||
<a class="button wide-button is-secondary mt-2" href="/courses/{{ course.name }}/{{ certificate }}">
|
<a class="button wide-button is-secondary mt-2" href="/courses/{{ course.name }}/{{ certificate }}">
|
||||||
{{ _("Get Certificate") }}
|
{{ _("Get Certificate") }}
|
||||||
</a>
|
</a>
|
||||||
{% elif course.grant_certificate_after == "Evaluation" %}
|
{% elif course.grant_certificate_after == "Evaluation" and not certificate_request %}
|
||||||
<a class="button wide-button is-secondary mt-2" id="apply-certificate" data-course="{{ course.name }}">
|
<a class="button wide-button is-secondary mt-2" id="apply-certificate" data-course="{{ course.name }}">
|
||||||
{{ _("Apply for Certificate") }}
|
{{ _("Apply for Certificate") }}
|
||||||
</a>
|
</a>
|
||||||
@@ -211,26 +217,28 @@
|
|||||||
<div class="modal-dialog" role="document">
|
<div class="modal-dialog" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<div class="font-weight-bold">{{ _("Pick a slot") }}</div>
|
<div class="font-weight-bold">{{ _("Pick a Slot") }}</div>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<form id="slot-form">
|
<form id="slot-form">
|
||||||
|
<p class="">{{ _("This course requires you to complete an evaluation to get certified. Please pick a slot based on your convenience for the evaluations. ") }}</p>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="clearfix">
|
<div class="clearfix">
|
||||||
<label class="control-label reqd" style="padding-right: 0px;">{{ _("Date") }}</label>
|
<label class="control-label reqd" style="padding-right: 0px;">{{ _("Date") }}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-input-wrapper">
|
<div class="control-input-wrapper">
|
||||||
<div class="control-input">
|
<div class="control-input">
|
||||||
<input id="slot-date" type="date" class="input-with-feedback form-control bold" data-fieldtype="Date">
|
<input type="date" class="input-with-feedback form-control bold" data-fieldtype="Date"
|
||||||
|
id="slot-date" min="{{ frappe.utils.format_date(frappe.utils.getdate(), 'yyyy-mm-dd') }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="clearfix">
|
<div class="clearfix">
|
||||||
<label class="control-label reqd" style="padding-right: 0px;">{{ _("Slots") }}</label>
|
<label class="control-label reqd slot-label hide" style="padding-right: 0px;">{{ _("Slots") }}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-input-wrapper">
|
<div class="control-input-wrapper">
|
||||||
<div class="control-input">
|
<div class="control-input">
|
||||||
@@ -238,12 +246,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<p id="no-slots-message" class="small text-danger hide"> {{ _("There are no slots available on this day.") }} </p>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
|
||||||
<div class="btn btn-sm btn-primary" data-course="{{ course.name | urlencode}}" id="submit-slot">
|
|
||||||
{{ _("Submit") }}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -42,12 +42,12 @@ frappe.ready(() => {
|
|||||||
apply_cetificate(e);
|
apply_cetificate(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".slot").click((e) => {
|
$("#slot-date").on("change", (e) => {
|
||||||
submit_slot(e);
|
display_slots(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#slot-date").on("change", (e) => {
|
$(document).on("click", ".slot", (e) => {
|
||||||
|
submit_slot(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).scroll(function() {
|
$(document).scroll(function() {
|
||||||
@@ -56,7 +56,7 @@ frappe.ready(() => {
|
|||||||
timer = setTimeout(() => { handle_overlay_display.apply(this, arguments); }, 500);
|
timer = setTimeout(() => { handle_overlay_display.apply(this, arguments); }, 500);
|
||||||
});
|
});
|
||||||
|
|
||||||
})
|
});
|
||||||
|
|
||||||
var hide_wrapped_mentor_cards = () => {
|
var hide_wrapped_mentor_cards = () => {
|
||||||
var offset_top_prev;
|
var offset_top_prev;
|
||||||
@@ -259,7 +259,7 @@ const apply_cetificate = (e) => {
|
|||||||
callback: (data) => {
|
callback: (data) => {
|
||||||
let options = "";
|
let options = "";
|
||||||
data.message.forEach((obj) => {
|
data.message.forEach((obj) => {
|
||||||
options += `<button class="btn btn-sm btn-secondary mr-3 slot"
|
options += `<button type="button" class="btn btn-sm btn-secondary mr-3 slot hide"
|
||||||
data-course="${$(e.currentTarget).data("course")}"
|
data-course="${$(e.currentTarget).data("course")}"
|
||||||
data-day="${obj.day}" data-start="${obj.start_time}" data-end="${obj.end_time}">
|
data-day="${obj.day}" data-start="${obj.start_time}" data-end="${obj.end_time}">
|
||||||
${obj.day} ${obj.start_time} - ${obj.end_time}</button>`;
|
${obj.day} ${obj.start_time} - ${obj.end_time}</button>`;
|
||||||
@@ -272,17 +272,40 @@ const apply_cetificate = (e) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const submit_slot = (e) => {
|
const submit_slot = (e) => {
|
||||||
const target = $(e.currentTarget);
|
e.preventDefault();
|
||||||
|
const slot = $(e.currentTarget);
|
||||||
frappe.call({
|
frappe.call({
|
||||||
method: "lms.lms.doctype.lms_certificate_request.lms_certificate_request.create_certificate_request",
|
method: "lms.lms.doctype.lms_certificate_request.lms_certificate_request.create_certificate_request",
|
||||||
args: {
|
args: {
|
||||||
"course": target.data("course"),
|
"course": slot.data("course"),
|
||||||
"day": target.data("day"),
|
"date": $("#slot-date").val(),
|
||||||
"start_time": target.data("start"),
|
"day": slot.data("day"),
|
||||||
"end_time": target.data("end")
|
"start_time": slot.data("start"),
|
||||||
|
"end_time": slot.data("end")
|
||||||
},
|
},
|
||||||
callback: (data) => {
|
callback: (data) => {
|
||||||
|
$("#slot-modal").modal("hide");
|
||||||
|
frappe.msgprint(__("Your slot has been booked. Prepare well for the evaluations."));
|
||||||
|
setTimeout(() => {
|
||||||
|
window.location.reload();
|
||||||
|
}, 2000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const display_slots = (e) => {
|
||||||
|
const weekday = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
|
||||||
|
const day = weekday[new Date($(e.currentTarget).val()).getDay()]
|
||||||
|
|
||||||
|
$(".slot").addClass("hide");
|
||||||
|
$(".slot-label").addClass("hide");
|
||||||
|
|
||||||
|
if ($(`[data-day='${day}']`).length) {
|
||||||
|
$(".slot-label").removeClass("hide");
|
||||||
|
$(`[data-day='${day}']`).removeClass("hide");
|
||||||
|
$("#no-slots-message").addClass("hide");
|
||||||
|
} else {
|
||||||
|
$("#no-slots-message").removeClass("hide");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
;
|
||||||
|
|||||||
@@ -30,10 +30,19 @@ def get_context(context):
|
|||||||
membership = get_membership(course.name, frappe.session.user)
|
membership = get_membership(course.name, frappe.session.user)
|
||||||
context.course.query_parameter = "?batch=" + membership.batch if membership and membership.batch else ""
|
context.course.query_parameter = "?batch=" + membership.batch if membership and membership.batch else ""
|
||||||
context.membership = membership
|
context.membership = membership
|
||||||
if context.course.upcoming:
|
|
||||||
context.is_user_interested = get_user_interest(context.course.name)
|
|
||||||
context.restriction = check_profile_restriction()
|
context.restriction = check_profile_restriction()
|
||||||
context.show_start_learing_cta = show_start_learing_cta(course, membership, context.restriction)
|
context.show_start_learing_cta = show_start_learing_cta(course, membership, context.restriction)
|
||||||
|
context.certificate_request = frappe.db.get_value("LMS Certificate Request",
|
||||||
|
{
|
||||||
|
"course": course.name,
|
||||||
|
"member": frappe.session.user
|
||||||
|
},
|
||||||
|
["date", "start_time", "end_time"],
|
||||||
|
as_dict=True)
|
||||||
|
|
||||||
|
if context.course.upcoming:
|
||||||
|
context.is_user_interested = get_user_interest(context.course.name)
|
||||||
|
|
||||||
context.metatags = {
|
context.metatags = {
|
||||||
"title": course.title,
|
"title": course.title,
|
||||||
"image": course.image,
|
"image": course.image,
|
||||||
|
|||||||
Reference in New Issue
Block a user