Merge dev into feat/progress-bar
This commit is contained in:
commit
43317c5dee
120 changed files with 4409 additions and 1520 deletions
|
@ -5,6 +5,7 @@
|
|||
import { AGE_TO_THEMES, THEMESITEMS } from "@/utils/constants.ts";
|
||||
import { useThemeQuery } from "@/queries/themes.ts";
|
||||
import type { Theme } from "@/data-objects/theme.ts";
|
||||
import authService from "@/services/auth/auth-service";
|
||||
|
||||
const props = defineProps({
|
||||
selectedTheme: { type: String, required: true },
|
||||
|
@ -33,6 +34,8 @@
|
|||
cards.value = themes;
|
||||
}
|
||||
});
|
||||
|
||||
const isTeacher = computed(() => authService.authState.activeRole === "teacher");
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -73,6 +76,23 @@
|
|||
class="fill-height grey-bg-card"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col
|
||||
v-if="isTeacher"
|
||||
cols="12"
|
||||
sm="6"
|
||||
md="4"
|
||||
lg="4"
|
||||
class="d-flex"
|
||||
>
|
||||
<ThemeCard
|
||||
path="/my-content"
|
||||
:is-absolute-path="true"
|
||||
:title="t('ownLearningContentTitle')"
|
||||
:description="t('ownLearningContentDescription')"
|
||||
icon="mdi-pencil"
|
||||
class="fill-height grey-bg-card"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col
|
||||
v-for="card in cards"
|
||||
:key="card.key"
|
||||
|
|
63
frontend/src/components/ButtonWithConfirmation.vue
Normal file
63
frontend/src/components/ButtonWithConfirmation.vue
Normal file
|
@ -0,0 +1,63 @@
|
|||
<script setup lang="ts">
|
||||
import { useI18n } from "vue-i18n";
|
||||
|
||||
const props = defineProps<{
|
||||
text: string;
|
||||
prependIcon?: string;
|
||||
appendIcon?: string;
|
||||
confirmQueryText: string;
|
||||
variant?: "flat" | "text" | "elevated" | "tonal" | "outlined" | "plain" | undefined;
|
||||
color?: string;
|
||||
disabled?: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{ (e: "confirm"): void }>();
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
function confirm(): void {
|
||||
emit("confirm");
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<v-dialog max-width="500">
|
||||
<template v-slot:activator="{ props: activatorProps }">
|
||||
<v-btn
|
||||
v-bind="activatorProps"
|
||||
:text="props.text"
|
||||
:prependIcon="props.prependIcon"
|
||||
:appendIcon="props.appendIcon"
|
||||
:variant="props.variant"
|
||||
:color="color"
|
||||
:disabled="props.disabled"
|
||||
></v-btn>
|
||||
</template>
|
||||
|
||||
<template v-slot:default="{ isActive }">
|
||||
<v-card :title="t('confirmDialogTitle')">
|
||||
<v-card-text>
|
||||
{{ props.confirmQueryText }}
|
||||
</v-card-text>
|
||||
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
<v-btn
|
||||
:text="t('yes')"
|
||||
@click="
|
||||
confirm();
|
||||
isActive.value = false;
|
||||
"
|
||||
></v-btn>
|
||||
<v-btn
|
||||
:text="t('cancel')"
|
||||
@click="isActive.value = false"
|
||||
></v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</template>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
|
@ -31,4 +31,9 @@
|
|||
></v-text-field>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
<style scoped>
|
||||
.search-field {
|
||||
width: 25%;
|
||||
min-width: 300px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -53,9 +53,9 @@
|
|||
white-space: normal;
|
||||
}
|
||||
.results-grid {
|
||||
margin: 20px;
|
||||
margin: 20px auto;
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
justify-content: center;
|
||||
gap: 20px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
|
|
@ -7,13 +7,16 @@
|
|||
|
||||
// Import assets
|
||||
import dwengoLogo from "../../../assets/img/dwengo-groen-zwart.svg";
|
||||
import { useLocale } from "vuetify";
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
const { current: vuetifyLocale } = useLocale();
|
||||
|
||||
const role = auth.authState.activeRole;
|
||||
const _router = useRouter(); // Zonder '_' gaf dit een linter error voor unused variable
|
||||
|
||||
const name: string = auth.authState.user!.profile.name!;
|
||||
const username = auth.authState.user!.profile.preferred_username!;
|
||||
const email = auth.authState.user!.profile.email;
|
||||
const initials: string = name
|
||||
.split(" ")
|
||||
|
@ -31,6 +34,7 @@
|
|||
// Logic to change the language of the website to the selected language
|
||||
function changeLanguage(langCode: string): void {
|
||||
locale.value = langCode;
|
||||
vuetifyLocale.value = langCode;
|
||||
localStorage.setItem("user-lang", langCode);
|
||||
}
|
||||
|
||||
|
@ -180,10 +184,15 @@
|
|||
<v-card>
|
||||
<v-card-text>
|
||||
<div class="mx-auto text-center">
|
||||
<v-avatar color="#0e6942">
|
||||
<span class="text-h5">{{ initials }}</span>
|
||||
<v-avatar
|
||||
color="#0e6942"
|
||||
size="large"
|
||||
class="user-button mb-3"
|
||||
>
|
||||
<span>{{ initials }}</span>
|
||||
</v-avatar>
|
||||
<h3>{{ name }}</h3>
|
||||
<p class="text-caption mt-1">{{ username }}</p>
|
||||
<p class="text-caption mt-1">{{ email }}</p>
|
||||
<v-divider class="my-3"></v-divider>
|
||||
<v-btn
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
import type { AnswersResponse } from "@/controllers/answers";
|
||||
import type { AnswerData, AnswerDTO } from "@dwengo-1/common/interfaces/answer";
|
||||
import authService from "@/services/auth/auth-service";
|
||||
import { AccountType } from "@dwengo-1/common/util/account-types";
|
||||
|
||||
const props = defineProps<{
|
||||
question: QuestionDTO;
|
||||
|
@ -80,7 +81,7 @@
|
|||
{{ question.content }}
|
||||
</div>
|
||||
<div
|
||||
v-if="authService.authState.activeRole === 'teacher'"
|
||||
v-if="authService.authState.activeRole === AccountType.Teacher"
|
||||
class="answer-input-container"
|
||||
>
|
||||
<input
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<div v-if="isError">
|
||||
<v-empty-state
|
||||
icon="mdi-alert-circle-outline"
|
||||
:text="errorMessage"
|
||||
:text="t(errorMessage)"
|
||||
:title="t('error_title')"
|
||||
></v-empty-state>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue