-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
192 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,67 @@ | ||
<template> | ||
<BackgroundContainer> | ||
<v-col class="scrollable-container"> | ||
<ProjectInfoCard :project="project"></ProjectInfoCard> | ||
<div class="download-section"> | ||
<div class="half-width"> | ||
<h2>Downloadable files</h2> | ||
</div> | ||
<div class="half-width"> | ||
<SubmitInfo v-if="group" :project="project" :group="group" /> | ||
</div> | ||
</div> | ||
</v-col> | ||
</BackgroundContainer> | ||
<v-container> | ||
<v-card color="white" class="infostyling"> | ||
<v-card-title>{{ project.name }}</v-card-title> | ||
<v-card-item> | ||
<v-chip label color="primary" class="ma-2" prepend-icon="mdi-calendar"> | ||
{{ $d(project.deadline, "long") }} | ||
</v-chip> | ||
<v-chip label color="primary" class="ma-2" prepend-icon="mdi-school"> | ||
{{ subject.name }} | ||
</v-chip> | ||
<v-chip label color="primary" class="ma-2" prepend-icon="mdi-account-group"> | ||
{{ $t("project.capacity_group") + project.capacity }} | ||
</v-chip> | ||
<v-chip | ||
v-for="instructor in instructors" | ||
:key="instructor?.uid" | ||
label | ||
color="primary" | ||
class="ma-2" | ||
prepend-icon="mdi-account" | ||
> | ||
{{ instructor?.given_name }} | ||
</v-chip> | ||
</v-card-item> | ||
<v-card-item> | ||
<v-card-title> | ||
{{ $t("project.assignment") }} | ||
</v-card-title> | ||
<div v-html="renderQuillContent(project.description)"></div> | ||
</v-card-item> | ||
</v-card> | ||
<SubmitInfo class="submitInfo" v-if="group" :project="project" :group="group" /> | ||
</v-container> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import type Project from "@/models/Project"; | ||
import type Group from "@/models/Group"; | ||
import BackgroundContainer from "@/components/BackgroundContainer.vue"; | ||
import ProjectInfoCard from "@/components/project/ProjectInfoCard.vue"; | ||
import SubmitInfo from "@/components/project/submit/SubmitInfo.vue"; | ||
import { toRefs } from "vue"; | ||
import { Quill } from "@vueup/vue-quill"; | ||
import type User from "@/models/User"; | ||
import type Subject from "@/models/Subject"; | ||
const props = defineProps<{ | ||
project: Project; | ||
group: Group | null; | ||
instructors: User[]; | ||
subject: Subject; | ||
}>(); | ||
const { project, group } = toRefs(props); | ||
const { project, group, instructors, subject } = toRefs(props); | ||
const renderQuillContent = (content: string) => { | ||
const quill = new Quill(document.createElement("div")); | ||
quill.root.innerHTML = content; | ||
return quill.root.innerHTML; | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
.scrollable-container { | ||
max-height: 100%; | ||
overflow-y: auto; | ||
} | ||
.download-section { | ||
margin-top: 20px; /* Adjust the margin-top value as needed */ | ||
display: flex; | ||
width: 100%; | ||
} | ||
.half-width { | ||
width: 50%; | ||
box-sizing: border-box; | ||
.submitInfo { | ||
padding: 10px; | ||
margin-top: 20px; | ||
} | ||
</style> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<template> | ||
<router-link :to="`/subjects/${project!.subject_id}`"> | ||
<v-btn class="group-button" prepend-icon="mdi-arrow-left"> | ||
{{ $t("default.to") + subject!.name }} | ||
</v-btn> | ||
</router-link> | ||
<router-link v-if="group && !isSoloProject && !isTeacher" :to="`/groups/${group!.id}`"> | ||
<v-btn class="group-button" prepend-icon="mdi-account-group"> | ||
{{ $t("project.group", { number: group!.id }) }} | ||
</v-btn> | ||
</router-link> | ||
<router-link v-else-if="!isSoloProject && !isTeacher" :to="`/projects/${project!.id}/groups`"> | ||
<v-btn class="group-button" prepend-icon="mdi-account-group"> | ||
{{ $t("project.group_button") }} | ||
</v-btn> | ||
</router-link> | ||
<NeedHelpButton v-if="!isTeacher" class="group-button" :email="subject!.email"></NeedHelpButton> | ||
<router-link v-if="isTeacher" :to="`/projects/${project!.id}/edit`"> | ||
<v-btn class="group-button" prepend-icon="mdi-pencil"> | ||
{{ $t("project.edit") }} | ||
</v-btn> | ||
</router-link> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import type Project from "@/models/Project"; | ||
import type Group from "@/models/Group"; | ||
import type Subject from "@/models/Subject"; | ||
import NeedHelpButton from "@/components/buttons/NeedHelpButton.vue"; | ||
import { computed, toRefs } from "vue"; | ||
import type User from "@/models/User"; | ||
import { useUserQuery } from "@/queries/User"; | ||
const props = defineProps<{ | ||
project: Project; | ||
group: Group | null; | ||
subject: Subject; | ||
instructors: User[]; | ||
}>(); | ||
const { project, group, subject, instructors } = toRefs(props); | ||
const { data: user } = useUserQuery(null); | ||
const isTeacher = computed(() => { | ||
if (!user.value || !instructors.value) { | ||
return false; | ||
} | ||
return instructors.value.some((instructor) => instructor.uid === user.value.uid); | ||
}); | ||
const isSoloProject = computed(() => project.value.capacity === 1); | ||
</script> | ||
|
||
<style scoped> | ||
.group-button { | ||
margin-bottom: 5px; | ||
min-width: auto; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.