Skip to content
Snippets Groups Projects
Commit a2b43005 authored by robinwilliam.hundt's avatar robinwilliam.hundt
Browse files

Added SubmissionTypesOverview component

parent 9500f383
No related branches found
No related tags found
1 merge request!115Activate deactivate tutors
Pipeline #78132 passed
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
<v-card-text> <v-card-text>
<GDPRNotice/> <GDPRNotice/>
</v-card-text> </v-card-text>
<v-card-action> <v-card-actions>
<v-btn @click="acceptedGDPR = true">Einwilligen</v-btn> <v-btn @click="acceptedGDPR = true">Einwilligen</v-btn>
</v-card-action> </v-card-actions>
</v-card> </v-card>
<v-card v-else> <v-card v-else>
<v-card-title class="title"> <v-card-title class="title">
......
<template>
<v-card>
<v-card-title class="title">Assignment types</v-card-title>
<v-layout row wrap>
<v-flex xs3>
<v-list>
<v-list-tile
v-for="submissionType in sortedSubmissionTypes" :key="submissionType.pk"
@click="selectedSubmissionType = submissionType"
>
<v-list-tile-content>
{{submissionType.name}}
</v-list-tile-content>
</v-list-tile>
</v-list>
</v-flex>
<v-flex xs9>
<v-layout v-if="!selectedSubmissionType" justify-center>
<strong>Select an assignment type on the left to see the description and solution.</strong>
</v-layout>
<submission-type class="mr-2 mb-2" v-else v-bind="selectedSubmissionType"/>
</v-flex>
</v-layout>
</v-card>
</template>
<script>
import {mapState} from 'vuex'
import SubmissionType from '@/components/SubmissionType'
export default {
name: 'SubmissionTypesOverview',
components: {SubmissionType},
data () {
return {
selectedSubmissionType: null
}
},
computed: {
...mapState([
'submissionTypes'
]),
sortedSubmissionTypes () {
return Object.values(this.submissionTypes).sort((t1, t2) => {
let lowerName1 = t1.name.toLowerCase()
let lowerName2 = t2.name.toLowerCase()
if (lowerName1 < lowerName2) {
return -1
} else if (lowerName1 > lowerName2) {
return 1
}
return 0
})
}
}
}
</script>
<style scoped>
</style>
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<subscription-list class="ma-4"></subscription-list> <subscription-list class="ma-4"></subscription-list>
</v-flex> </v-flex>
</v-layout> </v-layout>
<SubmissionTypesOverview class="ma-4"/>
</div> </div>
</template> </template>
...@@ -18,9 +19,11 @@ ...@@ -18,9 +19,11 @@
import CorrectionStatistics from '@/components/CorrectionStatistics' import CorrectionStatistics from '@/components/CorrectionStatistics'
import WelcomeJumbotron from '@/components/WelcomeJumbotron' import WelcomeJumbotron from '@/components/WelcomeJumbotron'
import SubscriptionList from '@/components/subscriptions/SubscriptionList' import SubscriptionList from '@/components/subscriptions/SubscriptionList'
import SubmissionTypesOverview from '@/components/SubmissionTypesOverview'
export default { export default {
components: { components: {
SubmissionTypesOverview,
SubscriptionList, SubscriptionList,
WelcomeJumbotron, WelcomeJumbotron,
CorrectionStatistics}, CorrectionStatistics},
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<subscription-list class="ma-4"></subscription-list> <subscription-list class="ma-4"></subscription-list>
</v-flex> </v-flex>
</v-layout> </v-layout>
<SubmissionTypesOverview class="ma-4"/>
</div> </div>
</template> </template>
...@@ -18,9 +19,11 @@ ...@@ -18,9 +19,11 @@
import SubscriptionList from '@/components/subscriptions/SubscriptionList' import SubscriptionList from '@/components/subscriptions/SubscriptionList'
import CorrectionStatistics from '@/components/CorrectionStatistics' import CorrectionStatistics from '@/components/CorrectionStatistics'
import WelcomeJumbotron from '@/components/WelcomeJumbotron' import WelcomeJumbotron from '@/components/WelcomeJumbotron'
import SubmissionTypesOverview from '@/components/SubmissionTypesOverview'
export default { export default {
components: { components: {
SubmissionTypesOverview,
WelcomeJumbotron, WelcomeJumbotron,
CorrectionStatistics, CorrectionStatistics,
SubscriptionList}, SubscriptionList},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment