Skip to content

Commit

Permalink
Remove enrolment date on course view
Browse files Browse the repository at this point in the history
  • Loading branch information
ngoerlitz committed May 23, 2024
1 parent 2e688ed commit fca2cff
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 20 deletions.
55 changes: 55 additions & 0 deletions backend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
###########################
# APPLICATION INFORMATION #
###########################
APP_DEBUG=true
APP_LOG_SQL=true
APP_PORT=8001
APP_HOST=localhost
APP_CORS_ALLOW=true
APP_KEY=

FRONTEND_URI=http://localhost:8000

#################
# MISC SETTINGS #
#################
SESSION_COOKIE_NAME=vatger_tc_session
FILE_STORAGE_LOCATION=./storage/uploads/
FILE_TMP_LOCATION=./storage/tmp/

##########################
# API ENDPOINT BASE URIs #
##########################
VATSIM_API_BASE=https://api.vatsim.net/api/v2
VATEUD_API_BASE=https://core.vateud.net/api
VATEUD_API_KEY=
VATGER_API_BASE=https://vatsim-germany.org/api
MOODLE_API_BASE=https://api.moodle.vatsim-germany.org

#########################
# VATSIM CONNECT CONFIG #
#########################
CONNECT_BASE=https://auth-dev.vatsim.net
CONNECT_REDIRECT_URI=http://localhost:8000/login/callback
CONNECT_SCOPE=full_name,vatsim_details,email,country
CONNECT_CLIENT_ID=
CONNECT_SECRET=

########################
# DATABASE INFORMATION #
########################
DB_DIALECT=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE_NAME=trainingcenter
DB_USERNAME=
DB_PASSWORD=

####################
# MAIL INFORMATION #
####################
SMTP_HOST=
SMTP_PORT=
SMTP_USERNAME=
SMTP_PASSWORD=
DEBUG_EMAIL=
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ export function CGeneralInformationPartial({
course,
showDescription = false,
showDuration = false,
showEnrolDate = true
}: {
loading: boolean;
course?: CourseModel;
showDescription?: boolean;
showDuration?: boolean;
showEnrolDate?: boolean;
}) {
return (
<RenderIf
Expand All @@ -40,12 +42,17 @@ export function CGeneralInformationPartial({
<>
<div className={"grid grid-cols-1 md:grid-cols-2 gap-5"}>
<Input preIcon={<TbId size={20} />} labelSmall label={"Kurs Name"} disabled value={course?.name} />
<Input
preIcon={<TbCalendar size={20} />}
label={"Eingeschrieben am"}
labelSmall
disabled
value={dayjs.utc(course?.UsersBelongsToCourses?.createdAt).format(Config.DATETIME_FORMAT)}
<RenderIf
truthValue={showEnrolDate}
elementTrue={
<Input
preIcon={<TbCalendar size={20} />}
label={"Eingeschrieben am"}
labelSmall
disabled
value={dayjs.utc(course?.UsersBelongsToCourses?.createdAt).format(Config.DATETIME_FORMAT)}
/>
}
/>
<Input
preIcon={<TbCertificate size={20} />}
Expand Down
25 changes: 11 additions & 14 deletions frontend/src/pages/authenticated/course/course-view/Course.view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Card } from "@/components/ui/Card/Card";
import React from "react";
import useApi from "@/utils/hooks/useApi";
import { CourseModel } from "@/models/CourseModel";
import { TLanguage, useSettingsSelector } from "@/app/features/settingsSlice";
import { useSettingsSelector } from "@/app/features/settingsSlice";
import { ButtonRow } from "@/components/ui/Button/ButtonRow";
import { CGeneralInformationPartial } from "@/pages/authenticated/course/_partials/CGeneralInformation.partial";

Expand Down Expand Up @@ -52,12 +52,12 @@ export function CourseView() {
elementFalse={
<>
<Card header={"Allgemeine Informationen"} headerBorder headerExtra={<Badge color={COLOR_OPTS.DANGER}>Nicht eingeschrieben</Badge>}>
<CGeneralInformationPartial course={course} loading={loading} showDescription showDuration />
<CGeneralInformationPartial course={course} loading={loading} showDescription showDuration showEnrolDate={false}/>

<ButtonRow>
<RenderIf
truthValue={course?.self_enrollment_enabled == true}
elementTrue={
<RenderIf
truthValue={course?.self_enrollment_enabled == true}
elementTrue={
<ButtonRow>
<Button
icon={<TbCheckbox size={20} />}
className={"mt-7"}
Expand All @@ -66,15 +66,12 @@ export function CourseView() {
onClick={() => navigate("enrol")}>
Jetzt Einschreiben
</Button>
}
/>
</ButtonRow>

<RenderIf
truthValue={!course?.self_enrollment_enabled}
elementTrue={
</ButtonRow>
}
elementFalse={
<p className={"mt-2 text-danger"}>
Die Selbsteinschreibung ist derzeit nicht aktiv. Kontaktiere einen Mentor um dich in den Kurs einschreiben zu lassen.
Die Selbsteinschreibung ist derzeit nicht aktiv.
Kontaktiere einen Mentor um dich in den Kurs einschreiben zu lassen.
</p>
}
/>
Expand Down

0 comments on commit fca2cff

Please sign in to comment.