Skip to content

Commit

Permalink
enkele fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
masinnae committed May 23, 2024
1 parent 171cd65 commit 64ab7a9
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<h2 v-if="project.capacity > 1 && !isLoading && group !== null" class="group">
{{ $t("project.group", { number: group?.num }) }}
</h2>
<h2 v-else-if="!isError && project.capacity > 1" class="group">
<h2 v-else-if="!isError && project.capacity > 1 && !isTeacher" class="group">
{{ $t("project.no_group") }}
</h2>
<h2>{{ $t("subject.project.assignment") }}</h2>
Expand Down Expand Up @@ -72,9 +72,11 @@

<script setup lang="ts">
import type Project from "@/models/Project";
import { ref, toRefs } from "vue";
import { computed, ref, toRefs } from "vue";
import { Quill } from "@vueup/vue-quill";
import { useProjectGroupQuery } from "@/queries/Group";
import { useCurrentUserQuery } from "@/queries/User";
import { useSubjectInstructorsQuery } from "@/queries/Subject";
const props = defineProps<{
selectedTab: number;
Expand All @@ -91,8 +93,19 @@ const renderQuillContent = (content: string) => {
quill.root.innerHTML = content;
return quill.root.innerHTML;
};
const { data: user } = useCurrentUserQuery();
const { data: instructors } = useSubjectInstructorsQuery(computed(() => project.value?.subject_id));
const { data: group, isLoading, isError } = useProjectGroupQuery(project.value.id);
const isTeacher = computed(() => {
if (!user.value || !instructors.value) {
return false;
}
return (
user.value.is_admin ||
instructors.value.some((instructor) => instructor.uid === user.value.uid)
);
});
</script>

<style scoped>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/submission/SubmitInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{{ $t("submit.new_submission") }}
</v-btn>
<v-btn :to="`/submissions/${group?.id}`">
{{ $t("project.submissions_list") }}
{{ $t("project.submissions_all") }}
</v-btn>
</v-card-actions>
</v-card>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export default {
capacity_group: "Capacity: ",
edit: "Edit project",
submissions_list: "All submissions from this person/group",
submissions_all: "View submissions",
submissions_list_teacher: "All submissions for this project",
submissions_zip: "Download all submissions",
not_found: "No projects found.",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/locales/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export default {
capacity_group: "Capaciteit: ",
edit: "Bewerk project",
submissions_list: "Alle indieningen van deze persoon/groep",
submissions_all: "Indieningen bekijken",
submissions_list_teacher: "Alle indieningen voor dit project",
submissions_zip: "Download alle indieningen",
not_found: "Geen projecten teruggevonden.",
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/views/ProjectsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,8 @@ const noProjectsFound = computed(() => filteredProjects.value.length === 0);
.projects {
margin: 15px;
}
.project-card {
margin-bottom: 10px;
}
</style>
15 changes: 8 additions & 7 deletions frontend/src/views/subject/modify/PatchSubjectView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@

<v-row v-else>
<v-col cols="1">
<v-btn variant="elevated" class="back-button" size="large" @click="dialog = true">
<v-btn
variant="elevated"
class="back-button"
size="large"
@click="dialog = true"
color="primary"
>
<v-icon>mdi-arrow-left</v-icon>
</v-btn>
</v-col>
Expand Down Expand Up @@ -63,7 +69,6 @@
>
</ModifySubjectBody>
</div>

<div class="confirm-btn-container">
<v-btn class="ma-2" color="grey" @click="dialog = true">
{{ $t("default.cancel") }}
Expand Down Expand Up @@ -293,11 +298,7 @@ async function handleSubmit() {

<style scoped>
.confirm-btn-container {
display: flex;
position: absolute;
right: 4vw;
bottom: 4vw;
margin-top: 2vh;
margin-top: 10px;
}
.back-button {
Expand Down

0 comments on commit 64ab7a9

Please sign in to comment.