2024-08-21 13:11:09 +00:00
|
|
|
<template>
|
2024-08-22 15:35:05 +00:00
|
|
|
<AppContent>
|
|
|
|
<NcEmptyContent
|
|
|
|
v-if="!favs.length"
|
|
|
|
class="empty"
|
|
|
|
:description="
|
|
|
|
t('repod', 'Pin some subscriptions to see their latest updates')
|
|
|
|
"
|
|
|
|
:name="t('repod', 'No favorites')">
|
|
|
|
<template #icon>
|
|
|
|
<StarOffIcon :size="20" />
|
|
|
|
</template>
|
|
|
|
</NcEmptyContent>
|
|
|
|
<ul v-if="favs.length">
|
|
|
|
<li
|
|
|
|
v-for="url in favs.sort((fav) => fav.lastPub).map((fav) => fav.url)"
|
|
|
|
:key="url">
|
2024-08-26 14:10:30 +00:00
|
|
|
<Favorites :url="url" />
|
2024-08-22 15:35:05 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
2024-08-21 13:11:09 +00:00
|
|
|
</AppContent>
|
|
|
|
</template>
|
2024-08-17 15:56:12 +00:00
|
|
|
|
|
|
|
<script>
|
2024-08-21 13:11:09 +00:00
|
|
|
import AppContent from '../components/Atoms/AppContent.vue'
|
2024-08-26 14:10:30 +00:00
|
|
|
import Favorites from '../components/Home/Favorites.vue'
|
2024-08-22 15:35:05 +00:00
|
|
|
import { NcEmptyContent } from '@nextcloud/vue'
|
|
|
|
import StarOffIcon from 'vue-material-design-icons/StarOff.vue'
|
|
|
|
import { mapState } from 'pinia'
|
|
|
|
import { useSubscriptions } from '../store/subscriptions.js'
|
2024-08-21 13:11:09 +00:00
|
|
|
|
2024-08-17 15:56:12 +00:00
|
|
|
export default {
|
|
|
|
name: 'Home',
|
2024-08-21 13:11:09 +00:00
|
|
|
components: {
|
|
|
|
AppContent,
|
2024-08-26 14:10:30 +00:00
|
|
|
Favorites,
|
2024-08-22 15:35:05 +00:00
|
|
|
NcEmptyContent,
|
|
|
|
StarOffIcon,
|
2024-08-21 13:11:09 +00:00
|
|
|
},
|
2024-08-22 15:35:05 +00:00
|
|
|
computed: {
|
|
|
|
...mapState(useSubscriptions, ['favs']),
|
2024-08-21 13:11:09 +00:00
|
|
|
},
|
2024-08-17 15:56:12 +00:00
|
|
|
}
|
|
|
|
</script>
|
2024-08-22 15:35:05 +00:00
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.empty {
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
</style>
|