-
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.
Merge pull request #300 from SELab-2/responsive
Responsive design improvements
- Loading branch information
Showing
20 changed files
with
382 additions
and
255 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
100 changes: 46 additions & 54 deletions
100
frontend/src/components/projects/ProjectCreateButton.vue
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,72 +1,64 @@ | ||
<script setup lang="ts"> | ||
import Dialog from 'primevue/dialog'; | ||
import Button from 'primevue/button'; | ||
import { useI18n } from 'vue-i18n'; | ||
import { type Course } from '@/types/Course.ts'; | ||
import { PrimeIcons } from 'primevue/api'; | ||
import Dialog from 'primevue/dialog'; | ||
import Button from 'primevue/button'; | ||
import { useRouter } from 'vue-router'; | ||
import { ref } from 'vue'; | ||
import CourseList from '@/components/courses/CourseList.vue'; | ||
/* Composable injections */ | ||
const { t } = useI18n(); | ||
const { push } = useRouter(); | ||
/* Props */ | ||
const props = defineProps<{ courses: Course[] }>(); | ||
const props = defineProps<{ courses: Course[]; label?: string; severity?: string }>(); | ||
/* Dialog state to select the course you want to create a project for */ | ||
const displayCourseSelection = ref(false); | ||
/* Method to route to the project creation view */ | ||
const createProjectForCourse = (courseId: string): void => { | ||
push({ name: 'project-create', params: { courseId } }); | ||
displayCourseSelection.value = false; | ||
}; | ||
</script> | ||
|
||
<template> | ||
<!-- Button to create a new project --> | ||
<Button | ||
v-if="props.courses && props.courses.length > 0" | ||
:icon="PrimeIcons.PLUS" | ||
icon-pos="right" | ||
class="custom-button" | ||
@click="displayCourseSelection = true" | ||
/> | ||
<!-- Dialog to select the course you want to create a project for --> | ||
<Dialog | ||
v-model:visible="displayCourseSelection" | ||
modal | ||
:draggable="false" | ||
:contentStyle="{ width: '50vw' }" | ||
:header="t('views.dashboard.select_course')" | ||
> | ||
<!-- List of courses to select from--> | ||
<div v-if="props.courses && props.courses.length > 0"> | ||
<div | ||
v-for="course in props.courses" | ||
:key="course.id" | ||
class="course-item" | ||
@click="createProjectForCourse(course.id)" | ||
> | ||
<span class="course-name">{{ course.name }}</span> | ||
</div> | ||
</div> | ||
</Dialog> | ||
<div> | ||
<!-- Button to create a new project --> | ||
<Button | ||
v-if="props.courses && props.courses.length > 0" | ||
:icon="PrimeIcons.PLUS" | ||
icon-pos="right" | ||
:label="label ?? ''" | ||
:severity="severity ?? 'primary'" | ||
class="custom-button" | ||
@click="displayCourseSelection = true" | ||
/> | ||
<!-- Dialog to select the course you want to create a project for --> | ||
<Dialog | ||
v-model:visible="displayCourseSelection" | ||
class="m-3" | ||
:draggable="false" | ||
:contentStyle="{ 'min-width': '50vw' }" | ||
modal | ||
> | ||
<template #header> | ||
<h2 class="my-3 text-primary"> | ||
{{ t('views.dashboard.select_course') }} | ||
</h2> | ||
</template> | ||
<template #default> | ||
<!-- List of courses to select from--> | ||
<CourseList :cols="3" :courses="props.courses"> | ||
<template #footer="{ course }"> | ||
<RouterLink :to="{ name: 'project-create', params: { courseId: course.id } }"> | ||
<Button | ||
:icon="PrimeIcons.PLUS" | ||
:label="t('components.card.newProject')" | ||
icon-pos="right" | ||
outlined | ||
/> | ||
</RouterLink> | ||
</template> | ||
</CourseList> | ||
</template> | ||
</Dialog> | ||
</div> | ||
</template> | ||
|
||
<style scoped lang="scss"> | ||
.course-item { | ||
cursor: pointer; | ||
padding: 8px; | ||
border-radius: 4px; | ||
margin-bottom: 8px; | ||
transition: background-color 0.3s; | ||
} | ||
.course-item:hover { | ||
background-color: #f0f0f0; | ||
} | ||
.course-name { | ||
font-weight: bold; | ||
} | ||
</style> | ||
<style scoped lang="scss"></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
Oops, something went wrong.