Refactor: mobile layout

This commit is contained in:
2022-11-13 21:05:10 +01:00
parent be6eaa657c
commit 987c652ca0
4 changed files with 30 additions and 28 deletions

View File

@@ -3,7 +3,7 @@
<v-col v-for="(course, id) in courses" :key="id" cols="12" lg="6">
<v-card width="100%" @click="openCourse(id)">
<v-row no-gutters class="flex-nowrap">
<v-col cols="auto">
<v-col class="flex-grow-0 flex-shrink-1">
<v-img
src="https://www.onlinecollegeplan.com/wp-content/uploads/2018/05/computer-programming.jpg"
:width="imgSize"
@@ -11,11 +11,11 @@
class="rounded-l-lg"
></v-img>
</v-col>
<v-col cols="auto" class="flex-grow-1 flex-shrink-0">
<v-col class="flex-grow-1 flex-shrink-0">
<v-card-title class="text--secondary text-subtitle-1">{{ id.toUpperCase() }}</v-card-title>
<v-card-subtitle class="text--primary text-h6 text-wrap">{{ course.name }}</v-card-subtitle>
<v-card-subtitle class="text--primary text-h6">{{ course.name }}</v-card-subtitle>
</v-col>
<v-col cols="auto">
<v-col class="flex-grow-0 flex-shrink-1">
<v-btn icon @click.stop="isFavoriteCourse(id) ? addToFavorites(id, false) : addToFavorites(id, true)">
<v-icon>{{ isFavoriteCourse(id) ? 'mdi-heart' : 'mdi-heart-outline' }}</v-icon>
</v-btn>
@@ -51,16 +51,15 @@ export default {
return this.$store.state.user.courses && this.$store.state.user.courses.includes(courseID)
},
addToFavorites (courseID, add) {
const gameRef = doc(this.$db, `benutzer/${this.$auth.currentUser.uid}`)
const userRef = doc(this.$db, `benutzer/${this.$auth.currentUser.uid}`)
// Atomically add a new answer to the "player[ID]answers" array field.
updateDoc(gameRef, {
updateDoc(userRef, {
kurse: add ? arrayUnion(courseID) : arrayRemove(courseID)
}).then((empty) => {
// Query execution was successful
add ? this.$store.commit('addFavoriteCourse', courseID) : this.$store.commit('removeFavoriteCourse', courseID)
}).catch((error) => {
// Failed to update the game; display error message
// Failed; display error message
this.$toast({ content: error, color: 'error' })
})
}

View File

@@ -3,7 +3,7 @@
<template>
<v-dialog v-model="show" width="500">
<template #activator="{ on, attrs }">
<v-btn fixed top dark color="red lighten-2" :style="{left: '50%', transform:'translateX(-50%)'}" v-bind="attrs" v-on="on">
<v-btn dark color="red lighten-2" :style="{left: '50%', transform:'translateX(-50%)'}" v-bind="attrs" v-on="on">
<v-icon left>mdi-alert-circle-outline</v-icon>
Mit Demo-Account Anmelden
</v-btn>
@@ -12,23 +12,17 @@
<v-card-title>Information zu Demo-Accounts</v-card-title>
<v-card-text>
<p>
Folgende Features funktionieren:
<ul>
<li>Registrierung</li>
<li>Anmeldung</li>
<li>Verifizierung per E-Mail</li>
<li>Passwortrücksetzung per E-Mail</li>
</ul>
Da die E-Mails zur <strong>Kontoverifizierung</strong> und Passwortrücksetzung meist vom Spam-Filter
der IU-Mailserver geblockt werden, kann im Rahmen dieser Demo alternativ mit einem Demo-Account angemeldet werden.
</p>
<p>Alternativ zur Registrierung kann mit einem Demo-Account angemeldet werden:</p>
<v-row dense>
<v-col cols="4">
<v-row>
<v-col cols="12" sm="4">
<v-btn depressed block color="primary" @click="signIn('student')">Student</v-btn>
</v-col>
<v-col cols="4">
<v-col cols="12" sm="4">
<v-btn depressed block color="primary" @click="signIn('tutor')">Tutor</v-btn>
</v-col>
<v-col cols="4">
<v-col cols="12" sm="4">
<v-btn depressed block color="primary" @click="signIn('admin')">Admin</v-btn>
</v-col>
</v-row>