diff --git a/frontend/src/components/Controls/IconPicker.vue b/frontend/src/components/Controls/IconPicker.vue index 6d1297c7..9efdc006 100644 --- a/frontend/src/components/Controls/IconPicker.vue +++ b/frontend/src/components/Controls/IconPicker.vue @@ -60,7 +60,7 @@ const iconQuery = ref('') const selectedIcon = ref('') const search = ref(null) const emit = defineEmits(['update:modelValue', 'change']) -console.log(icons) + const iconArray = ref( Object.keys(icons) .sort(() => 0.5 - Math.random()) @@ -84,7 +84,6 @@ const props = defineProps({ onMounted(() => { selectedIcon.value = props.modelValue - console.log(search.value) }) const setIcon = (icon, close) => { @@ -111,9 +110,5 @@ const filteredIcons = computed(() => { const openPopover = (togglePopover) => { togglePopover() - nextTick(() => { - /* search.value.focus() */ - console.log(search.value.children) - }) } diff --git a/frontend/src/pages/CreateCourse.vue b/frontend/src/pages/CreateCourse.vue index ae5caddb..d7cadc14 100644 --- a/frontend/src/pages/CreateCourse.vue +++ b/frontend/src/pages/CreateCourse.vue @@ -377,7 +377,7 @@ const submitCourse = () => { }) }, onError(err) { - showToast(err) + showToast('Error', err.messages?.[0] || err, 'x') }, }) } 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,