diff --git a/frontend/src/pages/Badge.vue b/frontend/src/pages/Badge.vue
new file mode 100644
index 00000000..c2980da0
--- /dev/null
+++ b/frontend/src/pages/Badge.vue
@@ -0,0 +1,90 @@
+
+
+
+
+ {{ badge.doc.title }}
+
+
![]()
+
+ {{
+ __('This badge has been awarded to {0} on {1}.').format(
+ userName,
+ dayjs(issuedOn.data?.issued_on).format('DD MMM YYYY')
+ )
+ }}
+
+
+ {{ badge.doc.description }}
+
+
+
+
+
diff --git a/frontend/src/pages/ProfileAbout.vue b/frontend/src/pages/ProfileAbout.vue
index 117b8baa..f955cd24 100644
--- a/frontend/src/pages/ProfileAbout.vue
+++ b/frontend/src/pages/ProfileAbout.vue
@@ -18,7 +18,7 @@
-
+
![]()
{{ __('Share on') }}:
-
+
+
+
+
@@ -82,7 +93,7 @@
diff --git a/frontend/src/router.js b/frontend/src/router.js
index ec6db90d..4c207c6e 100644
--- a/frontend/src/router.js
+++ b/frontend/src/router.js
@@ -135,6 +135,12 @@ const routes = [
name: 'Notifications',
component: () => import('@/pages/Notifications.vue'),
},
+ {
+ path: '/badges/:badgeName/:email',
+ name: 'Badge',
+ component: () => import('@/pages/Badge.vue'),
+ props: true,
+ },
]
let router = createRouter({
@@ -154,7 +160,8 @@ router.beforeEach(async (to, from, next) => {
isLoggedIn &&
(to.name == 'Lesson' ||
to.name == 'Batch' ||
- to.name == 'Notifications')
+ to.name == 'Notifications' ||
+ to.name == 'Badge')
) {
await allUsers.reload()
}
diff --git a/lms/lms/doctype/lms_badge/lms_badge.json b/lms/lms/doctype/lms_badge/lms_badge.json
index d2e974d3..1fe8a1b6 100644
--- a/lms/lms/doctype/lms_badge/lms_badge.json
+++ b/lms/lms/doctype/lms_badge/lms_badge.json
@@ -98,7 +98,7 @@
"link_fieldname": "badge"
}
],
- "modified": "2024-05-14 14:46:13.644382",
+ "modified": "2024-05-27 17:25:55.399830",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Badge",
@@ -116,6 +116,15 @@
"role": "System Manager",
"share": 1,
"write": 1
+ },
+ {
+ "email": 1,
+ "export": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "All",
+ "share": 1
}
],
"sort_field": "creation",
diff --git a/lms/public/frontend/index.html b/lms/public/frontend/index.html
index 06ccfbb7..558e94fc 100644
--- a/lms/public/frontend/index.html
+++ b/lms/public/frontend/index.html
@@ -15,10 +15,10 @@
-
-
+
+
-
+
diff --git a/lms/www/lms.py b/lms/www/lms.py
index 38d93fc0..47b81ddb 100644
--- a/lms/www/lms.py
+++ b/lms/www/lms.py
@@ -130,3 +130,20 @@ def get_meta(app_path):
"keywords": f"{user.full_name}, {user.bio}",
"link": f"/user/{username}",
}
+
+ if re.match(r"^badges/.*/.*$", app_path):
+ badgeName = app_path.split("/")[1]
+ email = app_path.split("/")[2]
+ badge = frappe.db.get_value(
+ "LMS Badge",
+ badgeName,
+ ["title", "image", "description"],
+ as_dict=True,
+ )
+ return {
+ "title": badge.title,
+ "image": badge.image,
+ "description": badge.description,
+ "keywords": f"{badge.title}, {badge.description}",
+ "link": f"/badges/{badgeName}/{email}",
+ }