This commit is contained in:
parent
2055484a87
commit
c7cc8d17b1
@ -63,7 +63,7 @@ class StudentController extends Controller
|
||||
$system = app('system_settings');
|
||||
$fields = $system?->fields ?? [];
|
||||
$showCourseCertificate = $fields['show_course_certificate'] ?? true;
|
||||
$showCourseMarksheet = $fields['show_course_marksheet'] ?? true;
|
||||
$showCourseMarksheet = $fields['show_course_marksheet'] ?? $showCourseCertificate;
|
||||
|
||||
if ($tab === 'certificate' && !$showCourseCertificate && !$showCourseMarksheet) {
|
||||
return redirect()->route('student.course.show', ['id' => $id, 'tab' => 'modules']);
|
||||
|
||||
@ -188,7 +188,7 @@ class StudentService extends MediaService
|
||||
$system = app('system_settings');
|
||||
$fields = $system?->fields ?? [];
|
||||
$showCourseCertificate = $fields['show_course_certificate'] ?? true;
|
||||
$showCourseMarksheet = $fields['show_course_marksheet'] ?? true;
|
||||
$showCourseMarksheet = $fields['show_course_marksheet'] ?? $showCourseCertificate;
|
||||
|
||||
return [
|
||||
'modules' => $tab === 'modules' ? $this->getCourseModules($course_id) : null,
|
||||
|
||||
@ -30,6 +30,9 @@ const ContentList = ({ completedContents, courseCompletion }: ContentListProps)
|
||||
const { course, zoomConfig, section, watchHistory, translate, direction, system } = props;
|
||||
const { button, common, frontend } = translate;
|
||||
const showCourseCertificate = system?.fields?.show_course_certificate ?? true;
|
||||
const showCourseMarksheet = system?.fields?.show_course_marksheet ?? showCourseCertificate;
|
||||
const showCertificateTab = showCourseCertificate || showCourseMarksheet;
|
||||
const certificateLabel = showCourseCertificate ? frontend.course_certificate : button.marksheet || 'Notenblatt';
|
||||
|
||||
// Get live classes from course data
|
||||
const liveClasses = course.live_classes || [];
|
||||
@ -116,11 +119,11 @@ const ContentList = ({ completedContents, courseCompletion }: ContentListProps)
|
||||
<Link
|
||||
href={route('student.course.show', {
|
||||
id: course.id,
|
||||
tab: showCourseCertificate ? 'certificate' : 'modules',
|
||||
tab: showCertificateTab ? 'certificate' : 'modules',
|
||||
})}
|
||||
>
|
||||
<Button className="w-full" variant="secondary" size="lg" disabled={courseCompletion.percentage !== '100.00'}>
|
||||
{showCourseCertificate ? frontend.course_certificate : 'Module'}
|
||||
{showCertificateTab ? certificateLabel : 'Module'}
|
||||
</Button>
|
||||
</Link>
|
||||
</div>
|
||||
@ -131,7 +134,7 @@ const ContentList = ({ completedContents, courseCompletion }: ContentListProps)
|
||||
Kurs abschließen
|
||||
</Button>
|
||||
) : (
|
||||
<Button className="w-full" variant="secondary" size="lg" disabled>
|
||||
<Button className="w-full" variant="secondary" size="lg" disabled>
|
||||
Kurs abschließen
|
||||
</Button>
|
||||
)}
|
||||
|
||||
@ -59,7 +59,7 @@ const Instructor = ({ course }: { course: Course }) => {
|
||||
</div>
|
||||
|
||||
<Button className="mt-6">
|
||||
<Link href={route('instructors.show', instructor.id)}>{frontend.view_details}</Link>
|
||||
<Link href={route('instructors.show', instructor.id)}>{frontend.view_details}</Link>
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
|
||||
@ -18,8 +18,9 @@ const Course = (props: StudentCourseProps) => {
|
||||
const { tab, course, watchHistory, completion, system } = props;
|
||||
|
||||
const showCourseCertificate = system?.fields?.show_course_certificate ?? true;
|
||||
const showCourseMarksheet = system?.fields?.show_course_marksheet ?? true;
|
||||
const showCourseMarksheet = system?.fields?.show_course_marksheet ?? showCourseCertificate;
|
||||
const showCertificateTab = showCourseCertificate || showCourseMarksheet;
|
||||
const certificateTabLabel = showCourseCertificate ? 'Zertifikat' : 'Notenblatt';
|
||||
|
||||
const tabs = [
|
||||
{
|
||||
@ -46,7 +47,7 @@ const Course = (props: StudentCourseProps) => {
|
||||
? [
|
||||
{
|
||||
value: 'certificate',
|
||||
label: 'Zertifikat',
|
||||
label: certificateTabLabel,
|
||||
},
|
||||
]
|
||||
: []),
|
||||
|
||||
@ -13,7 +13,7 @@ const CourseCertificate = () => {
|
||||
const { course, watchHistory, completion, certificateTemplate, marksheetTemplate, studentMarks, auth, system } = props;
|
||||
|
||||
const showCourseCertificate = system?.fields?.show_course_certificate ?? true;
|
||||
const showCourseMarksheet = system?.fields?.show_course_marksheet ?? true;
|
||||
const showCourseMarksheet = system?.fields?.show_course_marksheet ?? showCourseCertificate;
|
||||
|
||||
if (!showCourseCertificate && !showCourseMarksheet) {
|
||||
return (
|
||||
|
||||
Loading…
Reference in New Issue
Block a user