From a99c41a07b831a38e46b9d1e3261a6f73b9c7d46 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Thu, 13 Jun 2024 15:34:57 +0530 Subject: [PATCH] fix: misc changes --- frontend/src/pages/CreateLesson.vue | 10 +----- frontend/src/pages/Lesson.vue | 47 ++++++++++++++++++++++------- frontend/src/pages/Profile.vue | 21 +++++++++---- frontend/src/pages/ProfileAbout.vue | 20 +++++++----- lms/public/frontend/index.html | 2 +- lms/www/lms.py | 21 +++++++++++++ 6 files changed, 87 insertions(+), 34 deletions(-) diff --git a/frontend/src/pages/CreateLesson.vue b/frontend/src/pages/CreateLesson.vue index da5059ae..42c9fe85 100644 --- a/frontend/src/pages/CreateLesson.vue +++ b/frontend/src/pages/CreateLesson.vue @@ -69,26 +69,18 @@ + diff --git a/lms/www/lms.py b/lms/www/lms.py index 47b81ddb..4f92c88f 100644 --- a/lms/www/lms.py +++ b/lms/www/lms.py @@ -1,6 +1,7 @@ import frappe from frappe.utils.telemetry import capture from frappe import _ +from bs4 import BeautifulSoup import re no_cache = 1 @@ -79,6 +80,22 @@ def get_meta(app_path): "link": f"/batches/details/{batch_name}", } + if re.match(r"^batches/.*$", app_path): + batch_name = app_path.split("/")[1] + batch = frappe.db.get_value( + "LMS Batch", + batch_name, + ["title", "meta_image", "description", "category", "medium"], + as_dict=True, + ) + return { + "title": batch.title, + "image": batch.meta_image, + "description": batch.description, + "keywords": f"{batch.category} {batch.medium}", + "link": f"/batches/{batch_name}", + } + if app_path == "job-openings": return { "title": _("Job Openings"), @@ -123,6 +140,10 @@ def get_meta(app_path): ["full_name", "user_image", "bio"], as_dict=True, ) + + soup = BeautifulSoup(user.bio, "html.parser") + user.bio = soup.get_text() + return { "title": user.full_name, "image": user.user_image,