Skip to content

Commit 3b39e35

Browse files
improve UI
1 parent 72d5005 commit 3b39e35

File tree

7 files changed

+82
-61
lines changed

7 files changed

+82
-61
lines changed

src/App.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,8 @@ export default class App extends Vue {
7575
.cursor-pointer {
7676
cursor: pointer;
7777
}
78+
79+
.container-sm {
80+
width: 1140px;
81+
}
7882
</style>

src/layouts/LayoutClassroomStudent.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
<h1 v-text="classroom.name"></h1>
1414
<v-divider></v-divider>
1515
<p
16-
class="mt-5"
16+
class="mt-5 description"
1717
v-text="classroom.description"
18-
></p> <!-- TODO: multiline -->
18+
></p>
1919

2020
<v-tabs>
2121
<v-tab
@@ -108,5 +108,7 @@ export default class LayoutClassroomStudent extends Vue {
108108
</script>
109109

110110
<style scoped lang="scss">
111-
111+
.description {
112+
white-space: pre-wrap;
113+
}
112114
</style>

src/layouts/LayoutClassroomTeacher.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
<h1 v-text="classroom.name"></h1>
1414
<v-divider></v-divider>
1515
<p
16-
class="mt-5"
16+
class="mt-5 description"
1717
v-text="classroom.description"
18-
></p> <!-- TODO: multiline -->
18+
></p>
1919

2020
<v-tabs>
2121
<v-tab
@@ -110,5 +110,7 @@ export default class LayoutClassroomTeacher extends Vue {
110110
</script>
111111

112112
<style scoped lang="scss">
113-
113+
.description {
114+
white-space: pre-wrap;
115+
}
114116
</style>

src/views/Home.vue

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11
<template>
22
<v-container>
33
<v-breadcrumbs :items="breadcrumbs"></v-breadcrumbs>
4+
5+
<v-row>
6+
<v-col
7+
cols="3"
8+
v-for="link of links"
9+
:key="link.text"
10+
>
11+
<v-card
12+
link
13+
:to="link.to"
14+
hover
15+
>
16+
<v-card-title>
17+
{{ link.text }}
18+
</v-card-title>
19+
<v-card-subtitle>
20+
{{ link.description }}
21+
</v-card-subtitle>
22+
</v-card>
23+
</v-col>
24+
</v-row>
25+
26+
<!--
427
<v-list>
528
<v-list-item
629
v-for="link of links"
@@ -11,6 +34,7 @@
1134
</router-link>
1235
</v-list-item>
1336
</v-list>
37+
-->
1438
</v-container>
1539
</template>
1640

@@ -42,12 +66,23 @@ export default class Home extends Vue {
4266
4367
// eslint-disable-next-line
4468
get links () {
69+
const classroomTeacherDescription = 'Create classrooms, add students, track their progress.'
70+
const classroomStudentDescription = 'Join classrooms, practice exercises and get instant feedback.'
71+
4572
const links = [
46-
{ text: 'Classrooms', to: { name: 'ClassroomList' } }
73+
{
74+
text: 'Classrooms',
75+
to: { name: 'ClassroomList' },
76+
description: this.isTeacher ? classroomTeacherDescription : classroomStudentDescription
77+
}
4778
]
4879
if (this.isTeacher) {
4980
links.push(
50-
{ text: 'Reading exercises', to: { name: 'ReadingExerciseList' } }
81+
{
82+
text: 'Reading exercises',
83+
to: { name: 'ReadingExerciseList' },
84+
description: 'Create reading exercises for using in your classrooms.'
85+
}
5186
)
5287
}
5388
return links

src/views/auth/Login.vue

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -105,29 +105,6 @@ export default class Login extends Vue {
105105
} finally {
106106
this.loading = false
107107
}
108-
109-
// this.$store.dispatch('account/login', payload)
110-
// .then(() => {
111-
// this.$store.dispatch('account/getInfo')
112-
// .then(() => {
113-
// // TODO: implement ?next
114-
// if (this.isTeacher) {
115-
// this.$router.push({ name: 'Home' })
116-
// } else {
117-
// this.$router.push({ name: 'ClassroomList' })
118-
// }
119-
// })
120-
// })
121-
// .catch(error => {
122-
// if (assertErrCode(error, status.HTTP_401_UNAUTHORIZED)) {
123-
// this.errorMsg = error.response.data.detail
124-
// } else {
125-
// unexpectedExc(error)
126-
// }
127-
// })
128-
// .finally(() => {
129-
// this.loading = false
130-
// })
131108
}
132109
133110
@Emit('change-page')

src/views/classroom/ClassroomCreate.vue

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,39 @@
11
<template>
2-
<v-container>
2+
<v-container class="container-sm">
33
<v-breadcrumbs :items="breadcrumbs"></v-breadcrumbs>
44

5-
<h1>New classroom</h1>
5+
<v-card>
6+
<v-card-title>
7+
New classroom
8+
</v-card-title>
69

7-
<v-form>
8-
<v-text-field
9-
v-model="name"
10-
label="Name *"
11-
autofocus
12-
:error-messages="nameErrs"
13-
:error-count="nameErrs.length"
14-
></v-text-field>
15-
<v-textarea
16-
v-model="description"
17-
label="Description"
18-
></v-textarea>
19-
</v-form>
10+
<v-card-text>
11+
<v-form>
12+
<v-text-field
13+
v-model="name"
14+
label="Name *"
15+
autofocus
16+
:error-messages="nameErrs"
17+
:error-count="nameErrs.length"
18+
></v-text-field>
19+
<v-textarea
20+
v-model="description"
21+
label="Description"
22+
></v-textarea>
23+
</v-form>
24+
</v-card-text>
2025

21-
<v-btn
22-
color="primary"
23-
@click="submit"
24-
:loading="loading"
25-
>
26-
Create
27-
</v-btn>
26+
<v-card-actions>
27+
<v-btn
28+
color="primary"
29+
@click="submit"
30+
:loading="loading"
31+
min-width="110"
32+
>
33+
Create
34+
</v-btn>
35+
</v-card-actions>
36+
</v-card>
2837
</v-container>
2938
</template>
3039

src/views/reading-exercise/ReadingExerciseEditAnswers.vue

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,6 @@ declare interface LocalQuestion extends ReadingQuestion {
207207
208208
@Component
209209
export default class ReadingExerciseEditAnswers extends Mixins(ReadingExerciseMixin) {
210-
// TODO: make convenient
211-
212210
// eslint-disable-next-line no-undef
213211
[key: string]: unknown
214212
@@ -230,12 +228,6 @@ export default class ReadingExerciseEditAnswers extends Mixins(ReadingExerciseMi
230228
]
231229
232230
allChoices = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
233-
commonChoices = { // TODO: remember user's input
234-
'A, B, C, D': ['A', 'B', 'C', 'D'],
235-
'A, B, C, D, E': ['A', 'B', 'C', 'D', 'E'],
236-
'A, B, C, D, E, F': ['A', 'B', 'C', 'D', 'E', 'F'],
237-
'A, B, C, D, E, F, G, H': ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']
238-
}
239231
240232
localQuestions: LocalQuestion[] = []
241233

0 commit comments

Comments
 (0)