fix: hide start learning button if self enrollment is disabled

This commit is contained in:
Jannat Patel
2025-04-29 15:51:03 +05:30
parent b1a9af5de8
commit f17504e1a0
3 changed files with 25 additions and 6 deletions

View File

@@ -31,9 +31,21 @@
)
}}
</div>
<Button v-if="user.data" @click="enrollStudent()" variant="solid">
<Button
v-if="user.data && !lesson.data.disable_self_learning"
@click="enrollStudent()"
variant="solid"
>
{{ __('Start Learning') }}
</Button>
<Badge
theme="blue"
size="lg"
v-else-if="lesson.data.disable_self_learning"
class="mt-2"
>
{{ __('Contact the Administrator to enroll for this course.') }}
</Badge>
<Button v-else @click="redirectToLogin()">
<template #prefix>
<LogIn class="w-4 h-4 stroke-1" />
@@ -254,6 +266,7 @@
<script setup>
import {
createResource,
Badge,
Breadcrumbs,
Button,
Tooltip,