Merge pull request #2115 from pateljannat/issues-188

fix: misc issues
This commit is contained in:
Jannat Patel
2026-02-23 15:13:02 +05:30
committed by GitHub
7 changed files with 55 additions and 35 deletions
+18 -23
View File
@@ -1,9 +1,4 @@
<template>
<!-- <header
class="sticky flex items-center justify-between top-0 z-10 border-b bg-surface-white px-3 py-2.5 sm:px-5"
>
<Breadcrumbs :items="[{ label: __('Home'), route: { name: 'Home' } }]" />
</header> -->
<div class="w-full px-5 pt-5 pb-10">
<div class="space-y-2">
<div class="flex items-center justify-between">
@@ -11,9 +6,8 @@
{{ __('Hey') }}, {{ user.data?.full_name }} 👋
</div>
<div>
<TabButtons v-if="isAdmin" v-model="currentTab" :buttons="tabs" />
<div
v-else
v-if="!isAdmin"
@click="showStreakModal = true"
class="bg-surface-amber-2 px-2 py-1 rounded-md cursor-pointer"
>
@@ -35,19 +29,16 @@
:liveClasses="adminLiveClasses"
:evals="adminEvals"
/>
<StudentHome v-else :myLiveClasses="myLiveClasses" />
<StudentHome
v-else-if="currentTab === 'student'"
:myLiveClasses="myLiveClasses"
/>
</div>
<Streak v-model="showStreakModal" :streakInfo="streakInfo" />
</template>
<script setup lang="ts">
import { computed, inject, onMounted, ref } from 'vue'
import {
Breadcrumbs,
call,
createResource,
TabButtons,
usePageMeta,
} from 'frappe-ui'
import { call, createResource, usePageMeta } from 'frappe-ui'
import { sessionStore } from '@/stores/session'
import StudentHome from '@/pages/Home/StudentHome.vue'
import AdminHome from '@/pages/Home/AdminHome.vue'
@@ -56,10 +47,10 @@ import Streak from '@/pages/Home/Streak.vue'
const user = inject<any>('$user')
const { brand } = sessionStore()
const evalCount = ref(0)
const currentTab = ref<'student' | 'instructor'>('instructor')
const currentTab = ref<'student' | 'instructor'>('student')
const showStreakModal = ref(false)
onMounted(() => {
const fetchEvalCount = () => {
call('frappe.client.get_count', {
doctype: 'LMS Certificate Request',
filters: {
@@ -70,7 +61,7 @@ onMounted(() => {
}).then((data: any) => {
evalCount.value = data
})
})
}
const isAdmin = computed(() => {
return (
@@ -80,6 +71,15 @@ const isAdmin = computed(() => {
)
})
onMounted(() => {
if (isAdmin.value) {
currentTab.value = 'instructor'
} else {
currentTab.value = 'student'
fetchEvalCount()
}
})
const myLiveClasses = createResource({
url: 'lms.lms.api.get_my_live_classes',
auto: !isAdmin.value ? true : false,
@@ -151,11 +151,6 @@ const subtitle = computed(() => {
}
})
const tabs = [
{ label: __('Student'), value: 'student' },
{ label: __('Instructor'), value: 'instructor' },
]
usePageMeta(() => {
return {
title: __('Home'),
+2 -2
View File
@@ -783,11 +783,11 @@ const isAdmin = computed(() => {
const allowEdit = () => {
if (window.read_only_mode) return false
if (isAdmin.value) return true
return false
return isAdmin.value
}
const allowInstructorContent = () => {
if (window.read_only_mode) return false
return isAdmin.value
}
@@ -6,14 +6,15 @@
"hidden": 0,
"icon_type": "App",
"idx": 0,
"label": "Frappe LMS",
"label": "Frappe Learning",
"link": "/lms",
"link_type": "External",
"logo_url": "/assets/lms/frontend/learning.svg",
"modified": "2025-12-15 14:31:50.704854",
"modified_by": "Administrator",
"name": "Frappe LMS",
"name": "Frappe Learning",
"owner": "Administrator",
"restrict_removal": 0,
"roles": [],
"standard": 1
}
+1 -1
View File
@@ -5,7 +5,7 @@ from . import __version__ as app_version
app_name = "frappe_lms"
app_title = "Learning"
app_publisher = "Frappe"
app_description = "Frappe LMS App"
app_description = "Open Source Learning Management System built with Frappe Framework"
app_icon_url = "/assets/lms/images/lms-logo.png"
app_icon_title = "Learning"
app_color = "grey"
@@ -83,7 +83,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2025-11-10 11:41:51.802016",
"modified": "2026-02-23 14:50:11.733278",
"modified_by": "sayali@frappe.io",
"module": "LMS",
"name": "Course Evaluator",
@@ -125,6 +125,18 @@
"role": "Batch Evaluator",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Course Creator",
"share": 1,
"write": 1
}
],
"row_format": "Dynamic",
@@ -157,7 +157,7 @@
"grid_page_length": 50,
"index_web_pages_for_search": 1,
"links": [],
"modified": "2026-02-19 16:01:43.810407",
"modified": "2026-02-23 14:45:44.994705",
"modified_by": "sayali@frappe.io",
"module": "LMS",
"name": "LMS Certificate Request",
@@ -210,6 +210,18 @@
"role": "Batch Evaluator",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Course Creator",
"share": 1,
"write": 1
}
],
"row_format": "Dynamic",
@@ -23,7 +23,7 @@
"icon": "education",
"idx": 0,
"is_hidden": 0,
"label": "LMS",
"label": "Learning",
"links": [
{
"hidden": 0,
@@ -150,10 +150,10 @@
"type": "Link"
}
],
"modified": "2025-12-08 13:23:09.718683",
"modified_by": "sayali@frappe.io",
"modified": "2026-02-23 12:27:25.010341",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS",
"name": "Learning",
"number_cards": [],
"owner": "Administrator",
"parent_page": "",
@@ -217,6 +217,6 @@
"type": "DocType"
}
],
"title": "LMS",
"title": "Learning",
"type": "Workspace"
}