Skip to content
This repository was archived by the owner on Mar 26, 2023. It is now read-only.

Commit 07385c6

Browse files
Style fixes (#22)
1 parent 614a3fb commit 07385c6

2 files changed

Lines changed: 100 additions & 48 deletions

File tree

.github/workflows/build_and_publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,4 @@ jobs:
131131
--restart always \
132132
--network=web \
133133
--name ${{ env.CONTAITER_NAME }} \
134-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
134+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest

src/views/Timetable.vue

Lines changed: 99 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<template>
22
<div class="timetable">
3-
<div class = 'container'>
4-
<div class='info'>{{this.timetable.number}} группа</div>
5-
<ul>
6-
<EventRow
7-
v-for= "lesson of this.timetable.events" :key='lesson.id' :lesson="lesson"
8-
/>
3+
<div v-if="!this.loaded" class="lds-dual-ring"></div>
4+
<div v-else class='container'>
5+
<div class='info'>{{ this.timetable.number }} группа</div>
6+
<div class="no-events" v-if="!this.timetable.events.length">мероприятия отсутствуют</div>
7+
<ul v-else>
8+
<EventRow v-for="lesson of this.timetable.events" :key='lesson.id' :lesson="lesson" />
99
</ul>
10+
1011
</div>
1112
</div>
1213
</template>
@@ -15,87 +16,138 @@
1516
import EventRow from '@/components/EventRow.vue'
1617
export default {
1718
name: "Timetable",
18-
19+
1920
mounted() {
2021
this.groupId = localStorage.getItem('timetable-group-id');
2122
this.$store.commit("changePage", this.pageId);
22-
this.loadTimetableOnDate(this.$store.state.date)
23+
this.loadTimetableOnDate(this.$store.state.date)
2324
},
2425
data() {
2526
return {
27+
loaded: true,
2628
pageId: 1,
2729
groupId: null,
28-
timetable: [],
30+
timetable: { events: [] },
2931
};
3032
},
3133
computed: {
3234
choosenDate() {
33-
return this.$store.state.date
35+
return this.$store.state.date
3436
}
3537
},
3638
watch: {
3739
choosenDate(newValue) {
3840
this.loadTimetableOnDate(newValue)
3941
}
4042
},
41-
components:{
43+
components: {
4244
EventRow: EventRow,
4345
},
44-
methods:{
46+
methods: {
4547
loadTimetableOnDate(date) {
48+
this.loaded = false;
4649
var time_start = new Date(date);
47-
var time_end = new Date();
50+
time_start.setHours(time_start.getHours() - date.getTimezoneOffset()/60)
51+
console.log(time_start.toISOString())
52+
var time_end = new Date(time_start);
4853
time_end.setDate(time_start.getDate() + 1)
4954
var url = new URL(`${process.env.VUE_APP_API_TIMETABLE}/timetable/group/${this.groupId}`),
50-
params = {start: time_start.toISOString().slice(0,10), end: time_end.toISOString().slice(0,10)}
55+
params = { start: time_start.toISOString().slice(0, 10), end: time_end.toISOString().slice(0, 10) }
5156
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]))
5257
fetch(url)
5358
.then(response => response.json())
5459
.then(json => {
55-
this.timetable = json
60+
this.timetable = json;
61+
this.loaded = true;
5662
})
5763
}
5864
}
5965
};
6066
</script>
6167

6268
<style scoped>
63-
ul{
64-
display: flex;
65-
flex-direction: column;
66-
align-items: flex-start;
67-
padding: 10px;
68-
gap: 10px;
69-
width:auto;
70-
}
71-
.timetable{
72-
display: flex;
73-
flex-direction: column;
74-
align-items: flex-start;
75-
padding: 10px;
76-
gap: 10px;
77-
width:auto;
78-
padding-top: 66px;
79-
}
80-
.info{
81-
height: 20px;
82-
font-family: 'Roboto';
83-
font-style: normal;
84-
font-weight: 700;
85-
font-size: 16px;
86-
line-height: 16px;
87-
/* identical to box height, or 100% */
69+
ul {
70+
display: flex;
71+
flex-direction: column;
72+
align-items: flex-start;
73+
padding: 10px;
74+
gap: 10px;
75+
width: auto;
76+
}
77+
78+
.no-events {
79+
margin-top: auto;
80+
margin-bottom: auto;
81+
align-self: center;
82+
justify-self: center;
83+
text-align: center;
84+
font-size: 24px;
85+
font-weight: 700;
86+
color: lightgray;
87+
text-transform: uppercase;
8888
89-
letter-spacing: 0.4px;
89+
}
9090
91-
color: #000000;
91+
.container {
92+
display: flex;
93+
flex-direction: column;
94+
justify-content: start;
95+
height: 100%;
96+
gap: 10px;
97+
}
9298
99+
.timetable {
100+
padding: 10px;
101+
padding-top: 66px;
102+
display: flex;
103+
flex-direction: column;
104+
justify-content: center;
105+
align-items: center;
106+
height: calc(100vh - 56px);
107+
width: auto;
108+
overflow: scroll;
109+
}
93110
94-
/* Inside auto layout */
111+
.info {
112+
height: 20px;
113+
font-family: 'Roboto';
114+
font-style: normal;
115+
font-weight: 700;
116+
font-size: 16px;
117+
line-height: 16px;
118+
letter-spacing: 0.4px;
119+
color: #000000;
120+
flex: none;
121+
order: 0;
122+
align-self: stretch;
123+
flex-grow: 0;
124+
}
125+
126+
.lds-dual-ring {
127+
display: inline-block;
128+
width: 80px;
129+
height: 80px;
130+
}
131+
132+
.lds-dual-ring:after {
133+
content: " ";
134+
display: block;
135+
width: 64px;
136+
height: 64px;
137+
margin: 8px;
138+
border-radius: 50%;
139+
border: 6px solid lightgray;
140+
border-color: lightgray transparent lightgray transparent;
141+
animation: lds-dual-ring 1.2s linear infinite;
142+
}
143+
144+
@keyframes lds-dual-ring {
145+
0% {
146+
transform: rotate(0deg);
147+
}
95148
96-
flex: none;
97-
order: 0;
98-
align-self: stretch;
99-
flex-grow: 0;
149+
100% {
150+
transform: rotate(360deg);
100151
}
152+
}
101153
</style>

0 commit comments

Comments
 (0)