Skip to content

Commit

Permalink
Add featured bblocks to sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
avillar committed Oct 1, 2024
1 parent fd7677d commit 0598181
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/layouts/default/View.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,24 @@
<v-navigation-drawer
v-model="navigationDrawerComputed"
>
{{ contextNavigation }}
<v-list>
<v-list-item
v-for="(item, idx) of navigationItems"
:key="idx"
:to="item.to"
:title="item.title"
></v-list-item>
<template v-if="featuredBBlocks?.length">
<v-list-subheader title="Featured Building Blocks"></v-list-subheader>
<v-list-item
v-for="bblock of featuredBBlocks"
:key="bblock.identifier"
:to="{ name: 'BuildingBlock', params: { id: bblock.itemIdentifier } }"
density="compact"
>
<v-list-item-title style="font-size: 90%">{{ bblock.name }}</v-list-item-title>
</v-list-item>
</template>
<template v-if="contextNavItems?.length">
<v-list-subheader title="On this page"></v-list-subheader>
<v-list-item
Expand Down Expand Up @@ -94,6 +104,7 @@ export default {
{ title: 'About this register', to: '/' },
{ title: 'Building Blocks list', to: '/bblock' },
],
featuredBBlocks: null,
};
},
mounted() {
Expand All @@ -114,6 +125,9 @@ export default {
}
this.loading = false;
});
bblockService.getBBlocks()
.then(bblocks => this.featuredBBlocks = Object.values(bblocks).filter(b => b.highlighted)
.sort((a, b) => a.name.localeCompare(b.name)))
},
methods: {
handleContextNavigationClick(item) {
Expand Down

0 comments on commit 0598181

Please sign in to comment.