2022-11-29 13:45:48 +00:00
|
|
|
<script setup>
|
|
|
|
import { onMounted, computed } from 'vue';
|
|
|
|
import { useI18n } from 'vue-i18n';
|
|
|
|
import { useNavigationStore } from 'src/stores/useNavigationStore';
|
|
|
|
|
|
|
|
const navigation = useNavigationStore();
|
|
|
|
const { t } = useI18n();
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
navigation.fetchPinned();
|
|
|
|
});
|
|
|
|
|
|
|
|
const pinnedModules = computed(() => navigation.getPinnedModules());
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2023-04-11 11:31:03 +00:00
|
|
|
<QMenu
|
|
|
|
anchor="bottom left"
|
|
|
|
class="row q-pa-md q-col-gutter-lg"
|
|
|
|
max-width="350px"
|
|
|
|
max-height="400px"
|
|
|
|
>
|
2023-01-03 08:20:18 +00:00
|
|
|
<template v-if="pinnedModules.length">
|
2023-04-11 11:31:03 +00:00
|
|
|
<div
|
|
|
|
v-for="item of pinnedModules"
|
|
|
|
:key="item.title"
|
|
|
|
class="row no-wrap q-pa-xs flex-item"
|
|
|
|
>
|
|
|
|
<QBtn
|
2023-01-03 08:20:18 +00:00
|
|
|
align="evenly"
|
|
|
|
padding="16px"
|
|
|
|
flat
|
|
|
|
stack
|
|
|
|
size="lg"
|
|
|
|
:icon="item.icon"
|
|
|
|
color="primary"
|
|
|
|
class="col-4 button"
|
|
|
|
:to="{ name: item.name }"
|
|
|
|
>
|
|
|
|
<div class="text-center text-primary button-text">
|
|
|
|
{{ t(item.title) }}
|
|
|
|
</div>
|
2023-04-11 11:31:03 +00:00
|
|
|
</QBtn>
|
2023-01-03 08:20:18 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<template v-else>
|
2023-04-11 11:31:03 +00:00
|
|
|
<div
|
|
|
|
class="row no-wrap q-pa-xs flex-item text-center text-grey-5"
|
|
|
|
style="min-width: 200px"
|
|
|
|
>
|
2023-01-03 08:20:18 +00:00
|
|
|
{{ t('globals.noPinnedModules') }}
|
|
|
|
</div>
|
|
|
|
</template>
|
2023-04-11 11:31:03 +00:00
|
|
|
</QMenu>
|
2022-11-29 13:45:48 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.flex-item {
|
|
|
|
width: 100px;
|
|
|
|
}
|
|
|
|
.button {
|
|
|
|
width: 100%;
|
|
|
|
line-height: normal;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
.button-text {
|
|
|
|
font-size: 10px;
|
|
|
|
margin-top: 5px;
|
|
|
|
}
|
|
|
|
</style>
|