2018-09-06 19:46:38 +02:00
|
|
|
<template>
|
2018-09-09 16:22:02 +02:00
|
|
|
<div class="content has-text-centered">
|
2021-01-17 20:53:09 +01:00
|
|
|
<h2>
|
|
|
|
Hi {{ userInfo.name !== '' ? userInfo.name : userInfo.username }}!
|
|
|
|
</h2>
|
2020-06-15 18:47:17 +02:00
|
|
|
<template v-if="!hasTasks">
|
2021-01-17 20:53:09 +01:00
|
|
|
<p>You can create a new list for your new tasks:</p>
|
2021-01-17 18:57:57 +01:00
|
|
|
<x-button
|
2021-01-17 20:53:09 +01:00
|
|
|
:to="{name: 'list.create', params: { id: defaultNamespaceId }}"
|
2021-01-17 18:57:57 +01:00
|
|
|
:shadow="false"
|
2021-01-17 20:53:09 +01:00
|
|
|
class="ml-2"
|
|
|
|
v-if="defaultNamespaceId > 0"
|
2020-06-15 18:47:17 +02:00
|
|
|
>
|
2021-01-17 20:53:09 +01:00
|
|
|
Create a new list
|
|
|
|
</x-button>
|
|
|
|
<p class="mt-4" v-if="migratorsEnabled">
|
|
|
|
Or import your lists and tasks from other services into Vikunja:
|
|
|
|
</p>
|
2021-04-15 17:21:20 +02:00
|
|
|
<x-button
|
|
|
|
v-if="migratorsEnabled"
|
|
|
|
:to="{ name: 'migrate.start' }"
|
|
|
|
:shadow="false">
|
2020-06-15 18:47:17 +02:00
|
|
|
Import your data into Vikunja
|
2021-01-17 18:57:57 +01:00
|
|
|
</x-button>
|
2020-06-15 18:47:17 +02:00
|
|
|
</template>
|
2021-01-17 20:53:09 +01:00
|
|
|
<ShowTasks :show-all="true" v-if="hasLists"/>
|
2018-09-06 19:46:38 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-01-17 20:53:09 +01:00
|
|
|
import { mapState } from 'vuex'
|
2020-09-05 22:35:52 +02:00
|
|
|
import ShowTasks from './tasks/ShowTasks'
|
2018-09-06 19:46:38 +02:00
|
|
|
|
2020-09-05 22:35:52 +02:00
|
|
|
export default {
|
|
|
|
name: 'Home',
|
|
|
|
components: {
|
|
|
|
ShowTasks,
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
loading: false,
|
|
|
|
currentDate: new Date(),
|
|
|
|
tasks: [],
|
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: mapState({
|
|
|
|
migratorsEnabled: state => state.config.availableMigrators !== null && state.config.availableMigrators.length > 0,
|
|
|
|
authenticated: state => state.auth.authenticated,
|
|
|
|
userInfo: state => state.auth.info,
|
|
|
|
hasTasks: state => state.hasTasks,
|
2021-01-17 20:53:09 +01:00
|
|
|
defaultNamespaceId: state => {
|
|
|
|
if (state.namespaces.namespaces.length === 0) {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
return state.namespaces.namespaces[0].id
|
|
|
|
},
|
|
|
|
hasLists: state => {
|
|
|
|
if (state.namespaces.namespaces.length === 0) {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
return state.namespaces.namespaces[0].lists.length > 0
|
|
|
|
},
|
2020-09-05 22:35:52 +02:00
|
|
|
}),
|
|
|
|
}
|
2018-09-06 19:46:38 +02:00
|
|
|
</script>
|