fix: misc issues
This commit is contained in:
@@ -46,6 +46,12 @@
|
|||||||
</span>
|
</span>
|
||||||
</Button>
|
</Button>
|
||||||
</router-link>
|
</router-link>
|
||||||
|
<div
|
||||||
|
v-else-if="course.data.disable_self_learning"
|
||||||
|
class="bg-blue-100 text-blue-900 text-sm rounded-md py-1 px-3"
|
||||||
|
>
|
||||||
|
{{ __('Contact the Administrator to enroll for this course.') }}
|
||||||
|
</div>
|
||||||
<Button
|
<Button
|
||||||
v-else
|
v-else
|
||||||
@click="enrollStudent()"
|
@click="enrollStudent()"
|
||||||
|
|||||||
@@ -38,7 +38,8 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { Dialog, Input, TextEditor, createResource } from 'frappe-ui'
|
import { Dialog, Input, TextEditor, createResource } from 'frappe-ui'
|
||||||
import { reactive, defineModel } from 'vue'
|
import { reactive, defineModel, computed } from 'vue'
|
||||||
|
import { showToast } from '@/utils'
|
||||||
|
|
||||||
const topics = defineModel('reloadTopics')
|
const topics = defineModel('reloadTopics')
|
||||||
|
|
||||||
@@ -93,6 +94,14 @@ const submitTopic = (close) => {
|
|||||||
topicResource.submit(
|
topicResource.submit(
|
||||||
{},
|
{},
|
||||||
{
|
{
|
||||||
|
validate() {
|
||||||
|
if (!topic.title) {
|
||||||
|
return 'Title cannot be empty.'
|
||||||
|
}
|
||||||
|
if (!topic.reply) {
|
||||||
|
return 'Reply cannot be empty.'
|
||||||
|
}
|
||||||
|
},
|
||||||
onSuccess(data) {
|
onSuccess(data) {
|
||||||
replyResource.submit(
|
replyResource.submit(
|
||||||
{
|
{
|
||||||
@@ -108,6 +117,9 @@ const submitTopic = (close) => {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
onError(err) {
|
||||||
|
showToast('Error', err.message, 'x')
|
||||||
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ const newBatch = createResource({
|
|||||||
return {
|
return {
|
||||||
doc: {
|
doc: {
|
||||||
doctype: 'LMS Batch',
|
doctype: 'LMS Batch',
|
||||||
meta_image: batch.image.file_url,
|
meta_image: batch.image?.file_url,
|
||||||
...batch,
|
...batch,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -279,7 +279,7 @@ const editBatch = createResource({
|
|||||||
doctype: 'LMS Batch',
|
doctype: 'LMS Batch',
|
||||||
name: props.batchName,
|
name: props.batchName,
|
||||||
fieldname: {
|
fieldname: {
|
||||||
meta_image: batch.image.file_url,
|
meta_image: batch.image?.file_url,
|
||||||
...batch,
|
...batch,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1208,6 +1208,7 @@ def get_course_details(course):
|
|||||||
"short_introduction",
|
"short_introduction",
|
||||||
"published",
|
"published",
|
||||||
"upcoming",
|
"upcoming",
|
||||||
|
"disable_self_learning",
|
||||||
"published_on",
|
"published_on",
|
||||||
"status",
|
"status",
|
||||||
"paid_course",
|
"paid_course",
|
||||||
|
|||||||
Reference in New Issue
Block a user