+
@@ -17,7 +21,7 @@
diff --git a/frontend/src/components/Modals/Event.vue b/frontend/src/components/Modals/Event.vue
index 670189f2..0344cb2b 100644
--- a/frontend/src/components/Modals/Event.vue
+++ b/frontend/src/components/Modals/Event.vue
@@ -1,309 +1,378 @@
-
+ }"
+ >
+
+
+
+
+ {{ event.title }}
+
+
+
+
+
+
+
+ {{ event.member }}
+
+
+
+
+
+
+
+ {{ event.course_title }}
+
+
+
+
+
+
+
+ {{ event.batch_title }}
+
+
+
+
+
+
+
+ {{ dayjs(event.date).format('DD MMM YYYY') }}
+
+
+
+
+
+
+
+ {{ formatTime(event.start_time) }} -
+ {{ formatTime(event.end_time) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
+
+const tabs = computed(() => {
+ const tabsArray = [
+ {
+ label: __('Evaluation'),
+ icon: ClipboardList,
+ },
+ ]
+
+ if (showCertification.value) {
+ tabsArray.push({
+ label: __('Certificate'),
+ icon: GraduationCap,
+ })
+ }
+
+ return tabsArray
+})
+
diff --git a/frontend/src/pages/Profile.vue b/frontend/src/pages/Profile.vue
index e342123c..935cff6f 100644
--- a/frontend/src/pages/Profile.vue
+++ b/frontend/src/pages/Profile.vue
@@ -158,11 +158,11 @@ const setActiveTab = () => {
watchEffect(() => {
if (activeTab.value) {
let route = {
- "About": { name: 'ProfileAbout' },
- "Certificates": { name: 'ProfileCertificates' },
- "Roles": { name: 'ProfileRoles' },
- "Slots": { name: 'ProfileEvaluator' },
- "Schedule": { name: 'ProfileEvaluationSchedule' },
+ About: { name: 'ProfileAbout' },
+ Certificates: { name: 'ProfileCertificates' },
+ Roles: { name: 'ProfileRoles' },
+ Slots: { name: 'ProfileEvaluator' },
+ Schedule: { name: 'ProfileEvaluationSchedule' },
}[activeTab.value]
router.push(route)
}
@@ -186,7 +186,10 @@ const isSessionUser = () => {
const getTabButtons = () => {
let buttons = [{ label: 'About' }, { label: 'Certificates' }]
if ($user.data?.is_moderator) buttons.push({ label: 'Roles' })
- if (isSessionUser() && ($user.data?.is_evaluator || $user.data?.is_moderator)) {
+ if (
+ isSessionUser() &&
+ ($user.data?.is_evaluator || $user.data?.is_moderator)
+ ) {
buttons.push({ label: 'Slots' })
buttons.push({ label: 'Schedule' })
}
diff --git a/frontend/src/pages/ProfileEvaluationSchedule.vue b/frontend/src/pages/ProfileEvaluationSchedule.vue
index f40ebc78..efd5df7a 100644
--- a/frontend/src/pages/ProfileEvaluationSchedule.vue
+++ b/frontend/src/pages/ProfileEvaluationSchedule.vue
@@ -1,52 +1,49 @@
-
-
-
openEvent(event)"
- >
-
-
-
- {{ currentMonthYear }}
-
-
-
-
-
-
-
-
-
-
-
+
+
+
openEvent(event)"
+ >
+
+
+
+ {{ currentMonthYear }}
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
+
diff --git a/frontend/src/router.js b/frontend/src/router.js
index 649b26ad..7ba9950a 100644
--- a/frontend/src/router.js
+++ b/frontend/src/router.js
@@ -85,8 +85,9 @@ const routes = [
{
name: 'ProfileEvaluationSchedule',
path: 'schedule',
- component: () => import('@/pages/ProfileEvaluationSchedule.vue'),
- }
+ component: () =>
+ import('@/pages/ProfileEvaluationSchedule.vue'),
+ },
],
},
{
diff --git a/lms/lms/api.py b/lms/lms/api.py
index 0eb23c13..3287047a 100644
--- a/lms/lms/api.py
+++ b/lms/lms/api.py
@@ -9,6 +9,7 @@ from frappe.query_builder.functions import Count
from frappe.utils import time_diff, now_datetime, get_datetime
from typing import Optional
+
@frappe.whitelist()
def autosave_section(section, code):
"""Saves the code edited in one of the sections."""
@@ -614,22 +615,23 @@ def check_app_permission():
@frappe.whitelist()
def save_evaluation_details(
- member: str,
- course: str,
- batch_name: str,
- date: str,
- start_time: str,
- end_time: str,
- status: str,
- rating: int,
- summary: str) -> None:
+ member,
+ course,
+ batch_name,
+ evaluator,
+ date,
+ start_time,
+ end_time,
+ status,
+ rating,
+ summary,
+):
"""
Save evaluation details for a member against a course.
"""
- evaluation = frappe.db.exists("LMS Certificate Evaluation", {
- "member": member,
- "course": course
- })
+ evaluation = frappe.db.exists(
+ "LMS Certificate Evaluation", {"member": member, "course": course}
+ )
details = {
"date": date,
@@ -638,7 +640,7 @@ def save_evaluation_details(
"status": status,
"rating": rating / 5,
"summary": summary,
- "batch_name": batch_name
+ "batch_name": batch_name,
}
if evaluation:
@@ -646,10 +648,13 @@ def save_evaluation_details(
return evaluation
else:
doc = frappe.new_doc("LMS Certificate Evaluation")
- details.update({
- "member": member,
- "course": course,
- })
+ details.update(
+ {
+ "member": member,
+ "course": course,
+ "evaluator": evaluator,
+ }
+ )
doc.update(details)
doc.insert()
return doc.name
@@ -657,39 +662,40 @@ def save_evaluation_details(
@frappe.whitelist()
def save_certificate_details(
- member: str,
- course: str,
- batch_name: str,
+ member,
+ course,
+ batch_name,
+ evaluator,
issue_date,
expiry_date,
template,
published=True,
- ) -> None:
+):
"""
Save certificate details for a member against a course.
"""
- certificate = frappe.db.exists("LMS Certificate", {
- "member": member,
- "course": course
- })
+ certificate = frappe.db.exists("LMS Certificate", {"member": member, "course": course})
details = {
"published": published,
"issue_date": issue_date,
"expiry_date": expiry_date,
"template": template,
- "batch_name": batch_name
+ "batch_name": batch_name,
}
-
+
if certificate:
frappe.db.set_value("LMS Certificate", certificate, details)
return certificate
else:
doc = frappe.new_doc("LMS Certificate")
- details.update({
- "member": member,
- "course": course,
- })
+ details.update(
+ {
+ "member": member,
+ "course": course,
+ "evaluator": evaluator,
+ }
+ )
doc.update(details)
doc.insert()
- return doc.name
\ No newline at end of file
+ return doc.name
diff --git a/lms/lms/doctype/lms_certificate/lms_certificate.json b/lms/lms/doctype/lms_certificate/lms_certificate.json
index 5cd182ab..4bfbfbd0 100644
--- a/lms/lms/doctype/lms_certificate/lms_certificate.json
+++ b/lms/lms/doctype/lms_certificate/lms_certificate.json
@@ -15,8 +15,10 @@
"template",
"published",
"section_break_scyf",
- "expiry_date",
+ "evaluator",
+ "evaluator_name",
"column_break_slaw",
+ "expiry_date",
"batch_name"
],
"fields": [
@@ -95,11 +97,24 @@
{
"fieldname": "column_break_slaw",
"fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "evaluator",
+ "fieldtype": "Link",
+ "label": "Evaluator",
+ "options": "User"
+ },
+ {
+ "fetch_from": "evaluator.full_name",
+ "fieldname": "evaluator_name",
+ "fieldtype": "Data",
+ "label": "Evaluator Name",
+ "read_only": 1
}
],
"index_web_pages_for_search": 1,
"links": [],
- "modified": "2024-07-16 15:29:19.708888",
+ "modified": "2024-09-11 11:37:20.419955",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Certificate",
diff --git a/lms/lms/doctype/lms_certificate_evaluation/lms_certificate_evaluation.json b/lms/lms/doctype/lms_certificate_evaluation/lms_certificate_evaluation.json
index affb3411..b834a5a7 100644
--- a/lms/lms/doctype/lms_certificate_evaluation/lms_certificate_evaluation.json
+++ b/lms/lms/doctype/lms_certificate_evaluation/lms_certificate_evaluation.json
@@ -119,9 +119,9 @@
{
"fieldname": "evaluator",
"fieldtype": "Link",
+ "in_standard_filter": 1,
"label": "Evaluator",
- "options": "User",
- "reqd": 1
+ "options": "User"
},
{
"fetch_from": "evaluator.full_name",
@@ -133,7 +133,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
- "modified": "2024-09-10 20:17:49.908093",
+ "modified": "2024-09-11 11:20:06.233491",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Certificate Evaluation",
diff --git a/lms/lms/doctype/lms_certificate_request/lms_certificate_request.json b/lms/lms/doctype/lms_certificate_request/lms_certificate_request.json
index ebc2dae0..f17cc999 100644
--- a/lms/lms/doctype/lms_certificate_request/lms_certificate_request.json
+++ b/lms/lms/doctype/lms_certificate_request/lms_certificate_request.json
@@ -48,8 +48,7 @@
"fieldtype": "Link",
"in_standard_filter": 1,
"label": "Evaluator",
- "options": "User",
- "read_only": 1
+ "options": "User"
},
{
"fieldname": "date",
@@ -149,7 +148,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
- "modified": "2024-09-10 13:13:48.282623",
+ "modified": "2024-09-11 11:19:44.669132",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Certificate Request",
diff --git a/package.json b/package.json
index 923d2f3e..f5231fac 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "frappe_lms",
"version": "1.0.0",
"description": "Easy to use, open-source, Learning Management System",
- "workspaces": [
+ "workspaces1": [
"frappe-ui",
"frontend"
],