Skip to content

Commit

Permalink
Merge pull request #1264 from frappe/develop
Browse files Browse the repository at this point in the history
chore: merge 'develop' into 'main'
  • Loading branch information
pateljannat authored Jan 22, 2025
2 parents 1775ac4 + a28227a commit 0bedf3e
Show file tree
Hide file tree
Showing 45 changed files with 3,123 additions and 1,868 deletions.
2 changes: 1 addition & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.png" />
<link rel="icon" href="{{ favicon or '/assets/lms/frontend/favicon.png' }}" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Frappe Learning</title>
<meta name="title" content="{{ meta.title }}" />
Expand Down
35 changes: 25 additions & 10 deletions frontend/src/components/DiscussionReplies.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
</div>

<TextEditor
v-if="renderEditor"
class="mt-5"
:content="newReply"
:mentions="mentionUsers"
Expand All @@ -94,14 +95,16 @@ import { createResource, TextEditor, Button, Dropdown } from 'frappe-ui'
import { timeAgo } from '../utils'
import UserAvatar from '@/components/UserAvatar.vue'
import { ChevronLeft, MoreHorizontal } from 'lucide-vue-next'
import { ref, inject, onMounted, computed } from 'vue'
import { ref, inject, onMounted } from 'vue'
import { createToast } from '../utils'
const showTopics = defineModel('showTopics')
const newReply = ref('')
const socket = inject('$socket')
const user = inject('$user')
const allUsers = inject('$allUsers')
const mentionUsers = ref([])
const renderEditor = ref(false)
const props = defineProps({
topic: {
Expand All @@ -124,6 +127,7 @@ onMounted(() => {
socket.on('delete_message', (data) => {
replies.reload()
})
fetchMentionUsers()
})
const replies = createResource({
Expand All @@ -150,15 +154,26 @@ const newReplyResource = createResource({
},
})
const mentionUsers = computed(() => {
let users = Object.values(allUsers.data).map((user) => {
return {
value: user.name,
label: user.full_name,
}
})
return users
})
const fetchMentionUsers = () => {
if (user.data?.is_student) {
renderEditor.value = true
} else {
allUsers.reload(
{},
{
onSuccess(data) {
mentionUsers.value = Object.values(data).map((user) => {
return {
value: user.name,
label: user.full_name,
}
})
renderEditor.value = true
},
}
)
}
}
const postReply = () => {
newReplyResource.submit(
Expand Down
84 changes: 27 additions & 57 deletions frontend/src/components/JobCard.vue
Original file line number Diff line number Diff line change
@@ -1,71 +1,41 @@
<template>
<div class="flex rounded p-1 lg:px-2 lg:py-4 hover:bg-gray-100">
<div class="flex w-3/5 md:w-2/5">
<img
:src="job.company_logo"
class="w-12 h-12 rounded-lg object-contain mr-4"
:alt="job.company_name"
/>
<div>
<div class="font-medium mb-1">
<div class="flex space-x-4 border rounded-md p-2">
<Avatar :image="job.company_logo" :label="job.job_title" size="2xl" />
<div class="flex flex-col space-y-2 flex-1">
<div class="flex items-center justify-between">
<span class="font-semibold">
{{ job.job_title }}
</div>
<div class="text-gray-700">
{{ job.company_name }}
</div>
</span>
</div>
</div>
<div class="flex justify-end w-1/5 text-gray-700">
{{ job.location.replace(',', '').split(' ')[0] }}
</div>
<div
class="flex justify-end w-1/5 text-gray-700 text-right hidden md:block"
>
{{ job.type }}
</div>
<div class="flex justify-end w-1/5 text-sm text-gray-700 text-right">
{{ dayjs(job.creation).format('DD MMM YYYY') }}
</div>
</div>
<!-- <div class="flex flex-col shadow rounded-md p-4 h-full">
<div class="flex justify-between">
<div>
<div class="text-xl font-semibold mb-2">
{{ job.job_title }}
</div>
<div>
{{ __("posted by") }}
<span class="font-medium">
{{ job.company_name }}
</span>
</div>
<div class="flex items-center space-x-2">
<Building2 class="w-4 h-4 stroke-1.5 text-gray-600" />
<span>
{{ job.company_name }}
</span>
</div>
<img
:src="job.company_logo"
class="w-12 h-12 rounded-lg object-contain"
/>
</div>
<div class="flex justify-between mt-8">
<div class="flex items-center">
<Badge :label="job.type" theme="green" size="lg" class="mr-4"/>
<Badge :label="job.location" theme="gray" size="lg">
<template #prefix>
<MapPin class="h-4 w-4 stroke-1.5" />
</template>
</Badge>
<div class="flex items-center space-x-2">
<MapPin class="w-4 h-4 stroke-1.5 text-gray-600" />
<span>
{{ job.location }}
</span>
</div>
<div>
<span class="font-medium">
{{ dayjs(job.creation).format('DD MMM YYYY') }}
<div class="flex items-center space-x-2">
<Shapes class="w-4 h-4 stroke-1.5 text-gray-600" />
<span>
{{ job.type }}
</span>
</div>
<div class="flex items-center space-x-2">
<Calendar class="w-4 h-4 stroke-1.5 text-gray-600" />
<span> {{ __('posted') }} {{ dayjs(job.creation).fromNow() }} </span>
</div>
</div>
</div> -->
</div>
</template>
<script setup>
import { MapPin } from 'lucide-vue-next'
import { Badge } from 'frappe-ui'
import { Building2, Calendar, MapPin, Shapes } from 'lucide-vue-next'
import { inject } from 'vue'
import { Avatar } from 'frappe-ui'
const dayjs = inject('$dayjs')
const props = defineProps({
Expand Down
14 changes: 7 additions & 7 deletions frontend/src/components/Modals/BulkCertificates.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@
>
<template #body-content>
<div class="space-y-4">
<FormControl
type="select"
v-model="details.course"
:label="__('Course')"
:options="getCourses()"
/>
<Link
v-model="details.evaluator"
:label="__('Evaluator')"
Expand All @@ -38,6 +32,12 @@
v-model="details.expiry_date"
:label="__('Expiry Date')"
/>
<FormControl
type="select"
v-model="details.course"
:label="__('Course')"
:options="getCourses()"
/>
<Link
v-model="details.template"
:label="__('Template')"
Expand Down Expand Up @@ -94,7 +94,7 @@ const createCertificate = createResource({
template: details.template,
published: details.published,
course: values.course,
batch: values.batch,
batch_name: values.batch,
member: values.member,
evaluator: details.evaluator,
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/ProgressBar.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<Tooltip :text="`${props.progress}%`">
<div class="w-full bg-gray-200 rounded-full h-1 my-2">
<div class="w-full bg-gray-200 rounded-full h-1">
<div
class="bg-gray-900 rounded-full"
:class="progressBarHeight"
Expand Down
13 changes: 8 additions & 5 deletions frontend/src/components/Quiz.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@
</div>
</div>

<div v-if="quiz.data.duration" class="flex items-center space-x-2 my-4">
<span class="text-gray-600 text-xs"> {{ __('Time') }}: </span>
<div v-if="quiz.data.duration" class="flex flex-col space-x-1 my-4">
<div class="mb-2">
<span class=""> {{ __('Time') }}: </span>
<span class="font-semibold">
{{ formatTimer(timer) }}
</span>
</div>
<ProgressBar :progress="timerProgress" />
<span class="font-semibold">
{{ formatTimer(timer) }}
</span>
</div>

<div v-if="activeQuestion == 0">
Expand Down Expand Up @@ -590,6 +592,7 @@ const getInstructions = (question) => {
}
const markLessonProgress = () => {
console.log(router)
if (router.currentRoute.value.name == 'Lesson') {
call('lms.lms.api.mark_lesson_progress', {
course: router.currentRoute.value.params.courseName,
Expand Down
12 changes: 1 addition & 11 deletions frontend/src/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import './index.css'

import { createApp } from 'vue'
import router from './router'
import App from './App.vue'
Expand All @@ -8,15 +7,8 @@ import dayjs from '@/utils/dayjs'
import { createDialog } from '@/utils/dialogs'
import translationPlugin from './translation'
import { usersStore } from './stores/user'
import { sessionStore } from './stores/session'
import { initSocket } from './socket'
import {
FrappeUI,
setConfig,
frappeRequest,
resourcesPlugin,
pageMetaPlugin,
} from 'frappe-ui'
import { FrappeUI, setConfig, frappeRequest, pageMetaPlugin } from 'frappe-ui'

let pinia = createPinia()
let app = createApp(App)
Expand All @@ -32,8 +24,6 @@ app.provide('$socket', initSocket())
app.mount('#app')

const { userResource, allUsers } = usersStore()
let { isLoggedIn } = sessionStore()

app.provide('$user', userResource)
app.provide('$allUsers', allUsers)
app.config.globalProperties.$user = userResource
Expand Down
Loading

0 comments on commit 0bedf3e

Please sign in to comment.