| 
									
										
										
										
											2021-07-31 14:00:28 -08:00
										 |  |  | <template> | 
					
						
							|  |  |  |   <v-app dark> | 
					
						
							| 
									
										
										
										
											2021-08-01 19:24:47 -08:00
										 |  |  |     <!-- <TheSnackbar /> --> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-31 14:39:02 -08:00
										 |  |  |     <AppSidebar | 
					
						
							|  |  |  |       v-model="sidebar" | 
					
						
							|  |  |  |       absolute | 
					
						
							|  |  |  |       :top-link="topLinks" | 
					
						
							|  |  |  |       secondary-header="Cookbooks" | 
					
						
							|  |  |  |       :secondary-links="cookbookLinks || []" | 
					
						
							| 
									
										
										
										
											2021-09-02 11:24:17 -08:00
										 |  |  |       :bottom-links="bottomLink" | 
					
						
							| 
									
										
										
										
											2021-08-31 14:39:02 -08:00
										 |  |  |       @input="sidebar = !sidebar" | 
					
						
							|  |  |  |     /> | 
					
						
							| 
									
										
										
										
											2021-08-01 19:24:47 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     <AppHeader> | 
					
						
							|  |  |  |       <v-btn icon @click.stop="sidebar = !sidebar"> | 
					
						
							|  |  |  |         <v-icon> {{ $globals.icons.menu }}</v-icon> | 
					
						
							| 
									
										
										
										
											2021-07-31 14:00:28 -08:00
										 |  |  |       </v-btn> | 
					
						
							| 
									
										
										
										
											2021-08-01 19:24:47 -08:00
										 |  |  |     </AppHeader> | 
					
						
							| 
									
										
										
										
											2021-07-31 14:00:28 -08:00
										 |  |  |     <v-main> | 
					
						
							| 
									
										
										
										
											2021-08-01 19:24:47 -08:00
										 |  |  |       <v-scroll-x-transition> | 
					
						
							| 
									
										
										
										
											2021-07-31 14:00:28 -08:00
										 |  |  |         <Nuxt /> | 
					
						
							| 
									
										
										
										
											2021-08-01 19:24:47 -08:00
										 |  |  |       </v-scroll-x-transition> | 
					
						
							| 
									
										
										
										
											2021-07-31 14:00:28 -08:00
										 |  |  |     </v-main> | 
					
						
							| 
									
										
										
										
											2021-08-01 19:24:47 -08:00
										 |  |  |     <AppFloatingButton absolute /> | 
					
						
							| 
									
										
										
										
											2021-07-31 14:00:28 -08:00
										 |  |  |   </v-app> | 
					
						
							|  |  |  | </template> | 
					
						
							| 
									
										
										
										
											2021-08-01 19:24:47 -08:00
										 |  |  |    | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <script lang="ts"> | 
					
						
							| 
									
										
										
										
											2021-08-31 14:39:02 -08:00
										 |  |  | import { computed, defineComponent, useContext } from "@nuxtjs/composition-api"; | 
					
						
							| 
									
										
										
										
											2021-08-01 19:24:47 -08:00
										 |  |  | import AppHeader from "@/components/Layout/AppHeader.vue"; | 
					
						
							|  |  |  | import AppSidebar from "@/components/Layout/AppSidebar.vue"; | 
					
						
							|  |  |  | import AppFloatingButton from "@/components/Layout/AppFloatingButton.vue"; | 
					
						
							| 
									
										
										
										
											2021-09-01 21:39:40 -08:00
										 |  |  | import { useCookbooks } from "~/composables/use-group-cookbooks"; | 
					
						
							| 
									
										
										
										
											2021-07-31 14:00:28 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-01 19:24:47 -08:00
										 |  |  | export default defineComponent({ | 
					
						
							|  |  |  |   components: { AppHeader, AppSidebar, AppFloatingButton }, | 
					
						
							|  |  |  |   // @ts-ignore
 | 
					
						
							| 
									
										
										
										
											2021-08-09 16:19:23 -08:00
										 |  |  |   // middleware: process.env.GLOBAL_MIDDLEWARE,
 | 
					
						
							| 
									
										
										
										
											2021-08-01 19:24:47 -08:00
										 |  |  |   setup() { | 
					
						
							| 
									
										
										
										
											2021-08-31 14:39:02 -08:00
										 |  |  |     const { cookbooks } = useCookbooks(); | 
					
						
							|  |  |  |     // @ts-ignore
 | 
					
						
							|  |  |  |     const { $globals } = useContext(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     const cookbookLinks = computed(() => { | 
					
						
							|  |  |  |       if (!cookbooks.value) return []; | 
					
						
							|  |  |  |       return cookbooks.value.map((cookbook) => { | 
					
						
							|  |  |  |         return { | 
					
						
							|  |  |  |           icon: $globals.icons.pages, | 
					
						
							|  |  |  |           title: cookbook.name, | 
					
						
							|  |  |  |           to: `/cookbooks/${cookbook.slug}`, | 
					
						
							|  |  |  |         }; | 
					
						
							|  |  |  |       }); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  |     return { cookbookLinks }; | 
					
						
							| 
									
										
										
										
											2021-08-01 19:24:47 -08:00
										 |  |  |   }, | 
					
						
							|  |  |  |   data() { | 
					
						
							| 
									
										
										
										
											2021-07-31 14:00:28 -08:00
										 |  |  |     return { | 
					
						
							| 
									
										
										
										
											2021-08-01 19:24:47 -08:00
										 |  |  |       sidebar: null, | 
					
						
							| 
									
										
										
										
											2021-09-02 11:24:17 -08:00
										 |  |  |       bottomLink: [ | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |           icon: this.$globals.icons.cog, | 
					
						
							|  |  |  |           title: this.$t("general.settings"), | 
					
						
							|  |  |  |           to: "/user/profile", | 
					
						
							|  |  |  |           restricted: true, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |       ], | 
					
						
							| 
									
										
										
										
											2021-08-01 19:24:47 -08:00
										 |  |  |       topLinks: [ | 
					
						
							| 
									
										
										
										
											2021-07-31 14:00:28 -08:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2021-08-23 12:24:38 -08:00
										 |  |  |           icon: this.$globals.icons.calendar, | 
					
						
							|  |  |  |           restricted: true, | 
					
						
							|  |  |  |           title: this.$t("meal-plan.meal-planner"), | 
					
						
							|  |  |  |           children: [ | 
					
						
							|  |  |  |             { | 
					
						
							|  |  |  |               icon: this.$globals.icons.calendarMultiselect, | 
					
						
							|  |  |  |               title: this.$t("meal-plan.planner"), | 
					
						
							|  |  |  |               to: "/meal-plan/planner", | 
					
						
							|  |  |  |               restricted: true, | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |             { | 
					
						
							|  |  |  |               icon: this.$globals.icons.calendarWeek, | 
					
						
							|  |  |  |               title: this.$t("meal-plan.dinner-this-week"), | 
					
						
							|  |  |  |               to: "/meal-plan/this-week", | 
					
						
							|  |  |  |               restricted: true, | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |             { | 
					
						
							|  |  |  |               icon: this.$globals.icons.calendarToday, | 
					
						
							|  |  |  |               title: this.$t("meal-plan.dinner-today"), | 
					
						
							|  |  |  |               to: "/meal-plan/today", | 
					
						
							|  |  |  |               restricted: true, | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |           ], | 
					
						
							| 
									
										
										
										
											2021-07-31 14:00:28 -08:00
										 |  |  |         }, | 
					
						
							|  |  |  |         { | 
					
						
							| 
									
										
										
										
											2021-08-23 12:24:38 -08:00
										 |  |  |           icon: this.$globals.icons.formatListCheck, | 
					
						
							|  |  |  |           title: this.$t("shopping-list.shopping-lists"), | 
					
						
							|  |  |  |           to: "/shopping-list", | 
					
						
							|  |  |  |           restricted: true, | 
					
						
							| 
									
										
										
										
											2021-08-01 19:24:47 -08:00
										 |  |  |         }, | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |           icon: this.$globals.icons.viewModule, | 
					
						
							|  |  |  |           to: "/recipes/all", | 
					
						
							|  |  |  |           title: this.$t("sidebar.all-recipes"), | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2021-08-23 12:24:38 -08:00
										 |  |  |         { | 
					
						
							|  |  |  |           icon: this.$globals.icons.search, | 
					
						
							|  |  |  |           to: "/search", | 
					
						
							|  |  |  |           title: this.$t("sidebar.search"), | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2021-08-01 19:24:47 -08:00
										 |  |  |         { | 
					
						
							|  |  |  |           icon: this.$globals.icons.tags, | 
					
						
							| 
									
										
										
										
											2021-08-08 20:52:44 -08:00
										 |  |  |           to: "/recipes/categories", | 
					
						
							| 
									
										
										
										
											2021-08-01 19:24:47 -08:00
										 |  |  |           title: this.$t("sidebar.categories"), | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |           icon: this.$globals.icons.tags, | 
					
						
							| 
									
										
										
										
											2021-08-08 20:52:44 -08:00
										 |  |  |           to: "/recipes/tags", | 
					
						
							| 
									
										
										
										
											2021-08-01 19:24:47 -08:00
										 |  |  |           title: this.$t("sidebar.tags"), | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2021-07-31 14:00:28 -08:00
										 |  |  |       ], | 
					
						
							| 
									
										
										
										
											2021-08-01 19:24:47 -08:00
										 |  |  |     }; | 
					
						
							|  |  |  |   }, | 
					
						
							| 
									
										
										
										
											2021-08-06 16:28:12 -08:00
										 |  |  |   head: { | 
					
						
							|  |  |  |     title: "Home", | 
					
						
							|  |  |  |   }, | 
					
						
							| 
									
										
										
										
											2021-08-01 19:24:47 -08:00
										 |  |  | }); | 
					
						
							| 
									
										
										
										
											2021-07-31 14:00:28 -08:00
										 |  |  | </script> | 
					
						
							| 
									
										
										
										
											2021-08-01 19:24:47 -08:00
										 |  |  |        | 
					
						
							|  |  |  |       <style scoped> | 
					
						
							|  |  |  | </style>+ |