Skip to content

Commit

Permalink
Merge pull request #1033 from pateljannat/issues-35
Browse files Browse the repository at this point in the history
fix: misc UI fixes
  • Loading branch information
pateljannat authored Sep 27, 2024
2 parents bb9b179 + 7c055af commit d295898
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 26 deletions.
3 changes: 3 additions & 0 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ import DesktopLayout from './components/DesktopLayout.vue'
import MobileLayout from './components/MobileLayout.vue'
import { stopSession } from '@/telemetry'
import { init as initTelemetry } from '@/telemetry'
import { usersStore } from '@/stores/user'
const screenSize = useScreenSize()
let { userResource } = usersStore()
const Layout = computed(() => {
if (screenSize.width < 640) {
Expand All @@ -26,6 +28,7 @@ const Layout = computed(() => {
})
onMounted(async () => {
if (!userResource.data) return
await initTelemetry()
})
Expand Down
38 changes: 17 additions & 21 deletions frontend/src/components/LiveClass.vue
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
<template>
<Button
v-if="user.data.is_moderator"
variant="solid"
class="float-right mb-5"
@click="openLiveClassModal"
>
<template #prefix>
<Plus class="h-4 w-4" />
</template>
<span>
{{ __('Add Live Class') }}
</span>
</Button>
<div class="text-lg font-semibold mb-5">
{{ __('Live Class') }}
<div class="flex items-center justify-between mb-5">
<div class="text-lg font-semibold">
{{ __('Live Class') }}
</div>
<Button v-if="user.data.is_moderator" @click="openLiveClassModal">
<template #prefix>
<Plus class="h-4 w-4" />
</template>
<span>
{{ __('Add') }}
</span>
</Button>
</div>
<div v-if="liveClasses.data?.length" class="grid grid-cols-2 gap-5">
<div
v-for="cls in liveClasses.data"
class="flex flex-col border rounded-md h-full p-3"
class="flex flex-col border rounded-md h-full text-sm text-gray-700 p-3"
>
<div class="font-semibold text-lg mb-4">
<div class="font-semibold text-gray-900 text-lg mb-4">
{{ cls.title }}
</div>
<div class="mb-4">
<div class="leading-5 text-gray-700 text-sm mb-4">
{{ cls.description }}
</div>
<div class="flex items-center mb-2">
<Calendar class="w-4 h-4 stroke-1.5" />
<Calendar class="w-4 h-4 stroke-1.5 text-gray-700" />
<span class="ml-2">
{{ dayjs(cls.date).format('DD MMMM YYYY') }}
</span>
Expand All @@ -38,7 +35,7 @@
{{ formatTime(cls.time) }}
</span>
</div>
<div class="flex items-center space-x-2 mt-auto">
<div class="flex items-center space-x-2 text-gray-900 mt-auto">
<a
:href="cls.start_url"
target="_blank"
Expand Down Expand Up @@ -90,7 +87,6 @@ const liveClasses = createListResource({
doctype: 'LMS Live Class',
filters: {
batch_name: props.batch,
date: ['>=', new Date()],
},
fields: [
'title',
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/components/Modals/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@ const tabsStructure = computed(() => {
{
label: 'Branding',
icon: 'Blocks',
description:
'Customize the brand information of your learning system',
fields: [
{
label: 'Brand Name',
Expand Down Expand Up @@ -260,7 +258,6 @@ const tabsStructure = computed(() => {
{
label: 'Email Templates',
icon: 'MailPlus',
description: 'Create email templates with the content you want',
fields: [
{
label: 'Batch Confirmation Template',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/stores/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const sessionStore = defineStore('lms-session', () => {
}

let user = ref(sessionUser())
if (user) {
if (user.value) {
allUsers.reload()
}
const isLoggedIn = computed(() => !!user.value)
Expand Down
2 changes: 1 addition & 1 deletion lms/lms/doctype/course_lesson/course_lesson.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def save_progress(lesson, course):

def capture_progress_for_analytics(progress, course):
if progress in [25, 50, 75, 100]:
capture("course_progress", "lms", {"course": course, "progress": progress})
capture("course_progress", "lms", properties={"course": course, "progress": progress})


def get_quiz_progress(lesson):
Expand Down

0 comments on commit d295898

Please sign in to comment.