Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

algemene styling van website #226

Merged
merged 30 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added frontend/src/assets/ugent_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions frontend/src/components/TitleContainer.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<template>
<v-card class="title-card" variant="flat" color="primary">
<v-card-title class="title"> {{ props.title }}</v-card-title>
<slot></slot>
</v-card>
</template>

<script setup lang="ts">
const props = defineProps<{
title: string;
}>();
</script>

<style scoped>
.title-card {
padding: 30px;
color: white;
}
.title-card:after {
content: "";
background: url("@/assets/ugent_background.png") no-repeat center center;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
opacity: 0.4;
}

.title {
font-size: 32px;
margin-bottom: 12px;
}
</style>
2 changes: 1 addition & 1 deletion frontend/src/components/buttons/GroupButtons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const { mutateAsync: removeGroup } = useDeleteGroupMutation();

const joinGroupAndRedirect = async () => {
await joinGroup({ groupId: group.value.id, projectId: project.value.id });
router.push(`/groups/${group.value.id}`);
router.push(`/submissions/${group.value.id}`);
};

const leaveGroupAndRedirect = async () => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/groups/GroupCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const amountOfMembers = computed(() => {
});

const toGroupPage = async () => {
router.push(`/groups/${group.value.id}`);
router.push(`/submissions/${group.value.id}`);
};
</script>

Expand Down
5 changes: 1 addition & 4 deletions frontend/src/components/project/ProjectInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ const props = defineProps<{
const { project, group, instructors, subject, user } = toRefs(props);

const isTeacher = computed(
() =>
user.value.is_teacher ||
user.value.is_admin ||
instructors.value?.some((element) => element.uid == user.value.uid)
() => user.value.is_admin || instructors.value?.some((element) => element.uid == user.value.uid)
);

const renderQuillContent = (content: string) => {
Expand Down
20 changes: 10 additions & 10 deletions frontend/src/components/project/ProjectMiniCard.vue
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
<template>
<v-card variant="flat">
<v-card @click="toProject" variant="flat">
<v-skeleton-loader :loading="isSubjectLoading" type="article">
<v-card-item>
<v-col cols="9">
<v-card-title>
{{ project?.name }}
</v-card-title>
<v-card-subtitle>
{{ subject?.name }}
</v-card-subtitle>
</v-card-item>
<v-card-text>
</v-col>
<v-col cols="3" class="deadline">
<b>{{ $t("project.deadline") }}:</b>
<p>{{ $d(project!.deadline, "long") }}</p>
</v-card-text>
</v-col>
</v-skeleton-loader>
<v-card-actions>
<v-btn :to="`/project/${project.id}`">
{{ $t("project.details_button") }}
</v-btn>
</v-card-actions>
</v-card>
</template>

<script setup lang="ts">
import { useSubjectQuery } from "@/queries/Subject";
import { computed, toRefs } from "vue";
import type Project from "@/models/Project";
import router from "@/router";

const props = defineProps<{
project: Project;
Expand All @@ -36,6 +32,10 @@ const { project } = toRefs(props);
const { data: subject, isLoading: isSubjectLoading } = useSubjectQuery(
computed(() => project.value.subject_id)
);

const toProject = async () => {
await router.push({ name: "project", params: { projectId: project.value.id } });
};
</script>

<style scoped>
Expand Down
11 changes: 7 additions & 4 deletions frontend/src/components/project/ProjectSideBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{ $t("project.to_subject") }}
</v-btn>
</router-link>
<router-link v-if="group && !isSoloProject && !isTeacher" :to="`/groups/${group!.id}`">
<router-link v-if="group && !isSoloProject && !isTeacher" :to="`/submissions/${group!.id}`">
<v-btn class="group-button" prepend-icon="mdi-account-group">
{{ $t("project.group", { number: group!.num }) }}
</v-btn>
Expand All @@ -14,7 +14,7 @@
{{ $t("project.group_button") }}
</v-btn>
</router-link>
<router-link v-else-if="isTeacher" :to="`/project/${project!.id}/groups`">
<router-link v-else-if="isTeacher && !isSoloProject" :to="`/project/${project!.id}/groups`">
<v-btn class="group-button" prepend-icon="mdi-account-group">
{{ $t("project.to_groups") }}
</v-btn>
Expand Down Expand Up @@ -55,7 +55,10 @@ const isTeacher = computed(() => {
if (!user.value || !instructors.value) {
return false;
}
return instructors.value.some((instructor) => instructor.uid === user.value.uid);
return (
user.value.is_admin ||
instructors.value.some((instructor) => instructor.uid === user.value.uid)
);
});

const isSoloProject = computed(() => project.value.capacity === 1);
Expand All @@ -64,7 +67,7 @@ const isSoloProject = computed(() => project.value.capacity === 1);
<style scoped>
.group-button {
margin-bottom: 5px;
min-width: 150px;
width: 200px;
background-color: rgb(var(--v-theme-primary));
color: rgb(var(--v-theme-navtext));
}
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/components/project/RequirementsInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,21 @@
</v-col>
</v-row>
<v-row v-for="(req, index) in internalRequirements" :key="index" class="align-center my-1">
<v-col cols="10">
<v-col cols="5">
<v-chip class="me-2" color="blue" text-color="white">
{{ req.value }}
</v-chip>
</v-col>
<v-col cols="2" class="d-flex justify-space-between align-center">
<v-col cols="4" class="d-flex justify-space-between align-center">
<v-switch
v-model="req.mandatory"
:label="req.mandatory ? $t('project.mandatory') : $t('project.forbidden')"
:color="req.mandatory ? 'green' : 'red'"
hide-details
inset
></v-switch>
</v-col>
<v-col cols="2">
<v-btn icon="mdi-delete" @click="deleteRequirement(index)" />
</v-col>
</v-row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ defineEmits<{

<style scoped>
.title-card {
background-color: var(--color-secondary);
background-color: rgb(var(--v-theme-secondary));
padding: 20px;
}

Expand All @@ -47,7 +47,6 @@ defineEmits<{
display: block;
line-height: 1.2;
font-weight: 500;
color: black;
word-wrap: break-word;
white-space: normal;
overflow: hidden;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ defineEmits<{

<style scoped>
.title-card {
background-color: var(--color-secondary);
background-color: rgb(var(--v-theme-secondary));
padding: 20px;
}

Expand All @@ -40,6 +40,5 @@ defineEmits<{
display: block;
line-height: 1.2;
font-weight: 500;
color: black;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<v-card-title class="title">
{{ $t("create_subject.new_subject") }}
</v-card-title>

<v-card-text>
<v-text-field
v-model="subjectName"
Expand Down Expand Up @@ -36,7 +35,7 @@
<v-checkbox
:label="$t('create_subject.assign_self')"
v-model="checkbox"
color="primary"
color="text"
class="checkbox"
></v-checkbox>
</v-col>
Expand Down Expand Up @@ -119,7 +118,7 @@ watch(subjectMail, (newValue) => {

<style scoped>
.title-card {
background-color: var(--color-secondary);
background-color: rgb(var(--v-theme-secondary));
padding: 20px;
}

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/subject/extra/SubjectIcon.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-icon color="white" :size="size">
<v-icon :size="size">
{{ `mdi-${userRole}` }}
</v-icon>
</template>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<router-link :to="{ name: 'subject', params: { subjectId: subject.id } }" class="router-link">
<v-card class="subject-card" height="16vh" color="primary">
<v-card class="subject-card">
<SubjectIcon :role="role" size="xx-large" class="subject-icon"></SubjectIcon>
<v-card-title class="subject-title">
masinnae marked this conversation as resolved.
Show resolved Hide resolved
{{ subject?.name }}
Expand Down Expand Up @@ -33,18 +33,19 @@ defineProps<{
justify-content: space-between;
position: relative;
width: 100%;
height: 100px;
background-color: rgb(var(--v-theme-secondary));
border-radius: 3px;
}

.subject-title {
color: white;
font-size: 3vh;
position: absolute;
bottom: 0;
color: rgb(var(--v-theme-text));
}

.subject-icon {
position: absolute;
top: 10px;
bottom: 10px;
right: 15px;
color: rgb(var(--v-theme-text));
}
</style>
Loading
Loading