✨ Add prompt for selecting a class
This commit is contained in:
91
src/components/initial-setup.vue
Normal file
91
src/components/initial-setup.vue
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
<script setup>
|
||||||
|
import CalendarIcon from "./icons/calendar-icon.vue";
|
||||||
|
|
||||||
|
defineProps({
|
||||||
|
title: {
|
||||||
|
required: true,
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
description: {
|
||||||
|
required: true,
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
selectPrompt: {
|
||||||
|
required: true,
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
required: true,
|
||||||
|
type: Array,
|
||||||
|
},
|
||||||
|
modelValue: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="setup-wrapper">
|
||||||
|
<div class="content">
|
||||||
|
<CalendarIcon class="icon" />
|
||||||
|
<span class="title">{{ title }}</span>
|
||||||
|
<span class="description">{{ description }}</span>
|
||||||
|
<select
|
||||||
|
@input="(event) => $emit('update:modelValue', event.target.value)"
|
||||||
|
>
|
||||||
|
<option value="none">{{ selectPrompt }}</option>
|
||||||
|
<option v-for="option in options" :value="option" :key="option">
|
||||||
|
{{ option }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.setup-wrapper {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
margin: auto;
|
||||||
|
width: max-content;
|
||||||
|
height: max-content;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
gap: 3px;
|
||||||
|
max-width: 400px;
|
||||||
|
padding: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
stroke-width: 1px;
|
||||||
|
padding-bottom: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
span {
|
||||||
|
word-wrap: normal;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
span.title {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
span.description {
|
||||||
|
font-weight: 300;
|
||||||
|
}
|
||||||
|
|
||||||
|
select {
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,12 +1,15 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import {
|
||||||
parsedTimetable,
|
parsedTimetable,
|
||||||
|
classFilter,
|
||||||
|
classList,
|
||||||
substitutions,
|
substitutions,
|
||||||
selectedDate,
|
selectedDate,
|
||||||
selectedDay,
|
selectedDay,
|
||||||
} from "../store";
|
} from "../store";
|
||||||
import { getSubstitutionColor } from "../util";
|
import { getSubstitutionColor } from "../util";
|
||||||
import { computed } from "vue";
|
import { computed } from "vue";
|
||||||
|
import TimetableSetup from "../components/initial-setup.vue";
|
||||||
|
|
||||||
const timetable = computed(() => {
|
const timetable = computed(() => {
|
||||||
const currentDay = parsedTimetable.value[selectedDay.value];
|
const currentDay = parsedTimetable.value[selectedDay.value];
|
||||||
@ -47,6 +50,14 @@ function isCancelled(substitution) {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
<TimetableSetup
|
||||||
|
v-show="!classFilter || classFilter == 'none'"
|
||||||
|
title="No Class Selected"
|
||||||
|
description="Please select your class so you can view your timetable and only see substitutions that affect you. You can change this later in the settings."
|
||||||
|
selectPrompt="Select a class"
|
||||||
|
:options="classList"
|
||||||
|
v-model="classFilter"
|
||||||
|
/>
|
||||||
<div class="timetable">
|
<div class="timetable">
|
||||||
<template v-for="(lesson, index) in timetable" :key="index">
|
<template v-for="(lesson, index) in timetable" :key="index">
|
||||||
<div class="lesson" :style="getSubstitutionColor(lesson.substitution)">
|
<div class="lesson" :style="getSubstitutionColor(lesson.substitution)">
|
||||||
|
Reference in New Issue
Block a user