| 
									
										
										
										
											2022-03-17 10:30:10 -08:00
										 |  |  | <template> | 
					
						
							|  |  |  |   <v-container> | 
					
						
							|  |  |  |     <BasePageTitle> | 
					
						
							|  |  |  |       <template #header> | 
					
						
							|  |  |  |         <v-img max-height="175" max-width="175" :src="require('~/static/svgs/manage-recipes.svg')"></v-img> | 
					
						
							|  |  |  |       </template> | 
					
						
							| 
									
										
										
										
											2023-01-29 02:39:51 +01:00
										 |  |  |       <template #title> {{ $t('data-pages.data-management') }} </template> | 
					
						
							|  |  |  |       {{ $t('data-pages.data-management-description') }} | 
					
						
							| 
									
										
										
										
											2022-03-17 10:30:10 -08:00
										 |  |  |       <template #content> | 
					
						
							|  |  |  |         <div> | 
					
						
							|  |  |  |           <BaseOverflowButton | 
					
						
							|  |  |  |             :btn-text="buttonText" | 
					
						
							|  |  |  |             mode="link" | 
					
						
							|  |  |  |             rounded | 
					
						
							| 
									
										
										
										
											2023-01-29 02:39:51 +01:00
										 |  |  |             :items="DATA_TYPE_OPTIONS" | 
					
						
							| 
									
										
										
										
											2022-03-17 10:30:10 -08:00
										 |  |  |           > | 
					
						
							|  |  |  |           </BaseOverflowButton> | 
					
						
							|  |  |  |         </div> | 
					
						
							|  |  |  |       </template> | 
					
						
							|  |  |  |     </BasePageTitle> | 
					
						
							|  |  |  |     <section> | 
					
						
							|  |  |  |       <v-scroll-x-transition> | 
					
						
							|  |  |  |         <NuxtChild /> | 
					
						
							|  |  |  |       </v-scroll-x-transition> | 
					
						
							|  |  |  |     </section> | 
					
						
							|  |  |  |   </v-container> | 
					
						
							|  |  |  | </template> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <script lang="ts"> | 
					
						
							| 
									
										
										
										
											2023-01-29 02:39:51 +01:00
										 |  |  | import { computed, defineComponent, useContext, useRoute } from "@nuxtjs/composition-api"; | 
					
						
							| 
									
										
										
										
											2022-03-17 10:30:10 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | export default defineComponent({ | 
					
						
							|  |  |  |   props: { | 
					
						
							|  |  |  |     value: { | 
					
						
							|  |  |  |       type: Boolean, | 
					
						
							|  |  |  |       default: false, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   setup() { | 
					
						
							| 
									
										
										
										
											2023-01-29 02:39:51 +01:00
										 |  |  |     const { i18n } = useContext(); | 
					
						
							| 
									
										
										
										
											2022-03-17 10:30:10 -08:00
										 |  |  |     const buttonLookup: { [key: string]: string } = { | 
					
						
							| 
									
										
										
										
											2023-01-29 02:39:51 +01:00
										 |  |  |       recipes: i18n.tc("general.recipes"), | 
					
						
							|  |  |  |       foods: i18n.tc("general.foods"), | 
					
						
							|  |  |  |       units: i18n.tc("general.units"), | 
					
						
							|  |  |  |       labels: i18n.tc("data-pages.labels.labels"), | 
					
						
							| 
									
										
										
										
											2023-11-21 15:31:05 +01:00
										 |  |  |       categories: i18n.tc("category.categories"), | 
					
						
							|  |  |  |       tags: i18n.tc("tag.tags"), | 
					
						
							|  |  |  |       tools: i18n.tc("tool.tools"), | 
					
						
							| 
									
										
										
										
											2022-03-17 10:30:10 -08:00
										 |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-05 19:07:02 -06:00
										 |  |  |     const route = useRoute(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     const DATA_TYPE_OPTIONS = computed(() => [ | 
					
						
							| 
									
										
										
										
											2023-01-29 02:39:51 +01:00
										 |  |  |       { | 
					
						
							|  |  |  |         text: i18n.t("general.recipes"), | 
					
						
							|  |  |  |         value: "new", | 
					
						
							|  |  |  |         to: "/group/data/recipes", | 
					
						
							| 
									
										
										
										
											2023-11-21 15:31:05 +01:00
										 |  |  |         divider: true, | 
					
						
							| 
									
										
										
										
											2023-01-29 02:39:51 +01:00
										 |  |  |       }, | 
					
						
							|  |  |  |       { | 
					
						
							|  |  |  |         text: i18n.t("general.foods"), | 
					
						
							|  |  |  |         value: "url", | 
					
						
							|  |  |  |         to: "/group/data/foods", | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       { | 
					
						
							|  |  |  |         text: i18n.t("general.units"), | 
					
						
							|  |  |  |         value: "new", | 
					
						
							|  |  |  |         to: "/group/data/units", | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       { | 
					
						
							|  |  |  |         text: i18n.t("data-pages.labels.labels"), | 
					
						
							|  |  |  |         value: "new", | 
					
						
							|  |  |  |         to: "/group/data/labels", | 
					
						
							| 
									
										
										
										
											2023-11-21 15:31:05 +01:00
										 |  |  |         divider: true, | 
					
						
							| 
									
										
										
										
											2023-01-29 02:39:51 +01:00
										 |  |  |       }, | 
					
						
							| 
									
										
										
										
											2023-11-21 15:31:05 +01:00
										 |  |  |       { | 
					
						
							|  |  |  |         text: i18n.t("category.categories"), | 
					
						
							|  |  |  |         value: "new", | 
					
						
							|  |  |  |         to: "/group/data/categories", | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       { | 
					
						
							|  |  |  |         text: i18n.t("tag.tags"), | 
					
						
							|  |  |  |         value: "new", | 
					
						
							|  |  |  |         to: "/group/data/tags", | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       { | 
					
						
							|  |  |  |         text: i18n.t("tool.tools"), | 
					
						
							|  |  |  |         value: "new", | 
					
						
							|  |  |  |         to: "/group/data/tools", | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2023-11-05 19:07:02 -06:00
										 |  |  |     ]); | 
					
						
							| 
									
										
										
										
											2022-03-17 10:30:10 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     const buttonText = computed(() => { | 
					
						
							|  |  |  |       const last = route.value.path.split("/").pop(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       if (last) { | 
					
						
							|  |  |  |         return buttonLookup[last]; | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-01-29 02:39:51 +01:00
										 |  |  |       return i18n.tc("data-pages.select-data"); | 
					
						
							| 
									
										
										
										
											2022-03-17 10:30:10 -08:00
										 |  |  |     }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return { | 
					
						
							|  |  |  |       buttonText, | 
					
						
							| 
									
										
										
										
											2023-01-29 02:39:51 +01:00
										 |  |  |       DATA_TYPE_OPTIONS | 
					
						
							| 
									
										
										
										
											2022-03-17 10:30:10 -08:00
										 |  |  |     }; | 
					
						
							|  |  |  |   }, | 
					
						
							| 
									
										
										
										
											2023-01-29 02:39:51 +01:00
										 |  |  |   head() { | 
					
						
							|  |  |  |     return { | 
					
						
							|  |  |  |       title: this.$tc("data-pages.data-management"), | 
					
						
							|  |  |  |     }; | 
					
						
							| 
									
										
										
										
											2022-03-17 10:30:10 -08:00
										 |  |  |   }, | 
					
						
							|  |  |  | }); | 
					
						
							|  |  |  | </script> |