-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMySchedule.vue
91 lines (84 loc) · 1.83 KB
/
MySchedule.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<template>
<div>
<div style="padding-left: 2vw">
<EditButton @click="edit()"> Edit Schedule </EditButton>
<div class="lists">
<div style="padding-top: 1rem">
<ScheduleList
v-if="rooms != null"
data-testid="regular-schedule"
:all-rooms="rooms"
@go="go"
/>
</div>
</div>
</div>
</div>
</template>
<script lang="ts">
import Vue from "vue";
import EditButton from "@/components/buttons/EditButton.vue";
import ScheduleList from "@/components/ScheduleList.vue";
export default Vue.extend({
components: { EditButton, ScheduleList },
data() {
const stored = localStorage.getItem("myschedule");
return {
rooms: stored == null ? null : JSON.parse(stored).rooms,
};
},
created() {
if (localStorage.getItem("myschedule") == null) {
this.$router.replace("/myschedule/edit?new=true");
}
},
methods: {
go({ fromRoom, toRoom }: { fromRoom: string; toRoom: string }) {
this.$router.push({
path: "/directions",
query: {
fromRoom,
toRoom,
isFromSchedule: "true",
},
});
},
edit() {
this.$router.push({
path: "/myschedule/edit",
});
},
},
metaInfo: {
title: "My Schedule",
meta: [
{
vmid: "description",
name: "description",
content:
"Input your schedule into Walnut.Direct so we can give you customized directions between your classes in Walnut Hills High School.",
},
],
},
});
</script>
<style scoped>
h2 {
color: var(--subheading-text-color);
}
.lists {
display: flex;
flex-direction: column;
}
@media screen and (min-width: 1200px) {
.lists {
flex-direction: row;
}
.lists > * {
padding: 1rem 3rem;
}
}
h2 {
font-size: 35px;
}
</style>