| 
									
										
										
										
											2021-08-06 16:28:12 -08:00
										 |  |  | <template> | 
					
						
							| 
									
										
										
										
											2021-09-04 20:24:32 -08:00
										 |  |  |   <v-container class="narrow-container"> | 
					
						
							|  |  |  |     <BasePageTitle divider> | 
					
						
							|  |  |  |       <template #header> | 
					
						
							|  |  |  |         <v-img max-height="100" max-width="100" :src="require('~/static/svgs/manage-cookbooks.svg')"></v-img> | 
					
						
							|  |  |  |       </template> | 
					
						
							|  |  |  |       <template #title> Cookbooks </template> | 
					
						
							|  |  |  |       Arrange and edit your cookbooks here. | 
					
						
							|  |  |  |     </BasePageTitle> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-31 14:39:02 -08:00
										 |  |  |     <BaseButton create @click="actions.createOne()" /> | 
					
						
							|  |  |  |     <v-expansion-panels class="mt-2"> | 
					
						
							|  |  |  |       <draggable v-model="cookbooks" handle=".handle" style="width: 100%" @change="actions.updateOrder()"> | 
					
						
							|  |  |  |         <v-expansion-panel v-for="(cookbook, index) in cookbooks" :key="index" class="my-2 my-border rounded"> | 
					
						
							|  |  |  |           <v-expansion-panel-header disable-icon-rotate class="headline"> | 
					
						
							| 
									
										
										
										
											2021-08-31 18:51:34 -08:00
										 |  |  |             <div class="d-flex align-center"> | 
					
						
							|  |  |  |               <v-icon large left> | 
					
						
							|  |  |  |                 {{ $globals.icons.pages }} | 
					
						
							|  |  |  |               </v-icon> | 
					
						
							|  |  |  |               {{ cookbook.name }} | 
					
						
							|  |  |  |             </div> | 
					
						
							| 
									
										
										
										
											2021-08-31 14:39:02 -08:00
										 |  |  |             <template #actions> | 
					
						
							| 
									
										
										
										
											2021-08-31 18:51:34 -08:00
										 |  |  |               <v-icon class="handle"> | 
					
						
							|  |  |  |                 {{ $globals.icons.arrowUpDown }} | 
					
						
							|  |  |  |               </v-icon> | 
					
						
							|  |  |  |               <v-btn color="info" fab small class="ml-2"> | 
					
						
							| 
									
										
										
										
											2021-08-31 14:39:02 -08:00
										 |  |  |                 <v-icon color="white"> | 
					
						
							|  |  |  |                   {{ $globals.icons.edit }} | 
					
						
							|  |  |  |                 </v-icon> | 
					
						
							|  |  |  |               </v-btn> | 
					
						
							|  |  |  |             </template> | 
					
						
							|  |  |  |           </v-expansion-panel-header> | 
					
						
							|  |  |  |           <v-expansion-panel-content> | 
					
						
							|  |  |  |             <v-card-text> | 
					
						
							|  |  |  |               <v-text-field v-model="cookbooks[index].name" label="Cookbook Name"></v-text-field> | 
					
						
							| 
									
										
										
										
											2021-08-31 18:51:34 -08:00
										 |  |  |               <v-textarea v-model="cookbooks[index].description" auto-grow :rows="2" label="Description"></v-textarea> | 
					
						
							| 
									
										
										
										
											2021-08-31 14:39:02 -08:00
										 |  |  |               <DomainRecipeCategoryTagSelector v-model="cookbooks[index].categories" /> | 
					
						
							|  |  |  |             </v-card-text> | 
					
						
							|  |  |  |             <v-card-actions> | 
					
						
							|  |  |  |               <v-spacer></v-spacer> | 
					
						
							|  |  |  |               <BaseButton delete @click="actions.deleteOne(cookbook.id)" /> | 
					
						
							| 
									
										
										
										
											2021-08-31 18:51:34 -08:00
										 |  |  |               <BaseButton save @click="actions.updateOne(cookbook)"> </BaseButton> | 
					
						
							| 
									
										
										
										
											2021-08-31 14:39:02 -08:00
										 |  |  |             </v-card-actions> | 
					
						
							|  |  |  |           </v-expansion-panel-content> | 
					
						
							|  |  |  |         </v-expansion-panel> | 
					
						
							|  |  |  |       </draggable> | 
					
						
							|  |  |  |     </v-expansion-panels> | 
					
						
							| 
									
										
										
										
											2021-08-06 16:28:12 -08:00
										 |  |  |   </v-container> | 
					
						
							|  |  |  | </template> | 
					
						
							|  |  |  |      | 
					
						
							|  |  |  | <script lang="ts"> | 
					
						
							|  |  |  | import { defineComponent } from "@nuxtjs/composition-api"; | 
					
						
							| 
									
										
										
										
											2021-08-31 14:39:02 -08:00
										 |  |  | import draggable from "vuedraggable"; | 
					
						
							| 
									
										
										
										
											2021-09-05 22:05:29 -08:00
										 |  |  | import { useCookbooks } from "@/composables/use-group-cookbooks"; | 
					
						
							| 
									
										
										
										
											2021-08-06 16:28:12 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | export default defineComponent({ | 
					
						
							| 
									
										
										
										
											2021-08-31 14:39:02 -08:00
										 |  |  |   components: { draggable }, | 
					
						
							| 
									
										
										
										
											2021-08-06 16:28:12 -08:00
										 |  |  |   setup() { | 
					
						
							| 
									
										
										
										
											2021-09-01 21:39:40 -08:00
										 |  |  |     const { cookbooks, actions } = useCookbooks(); | 
					
						
							| 
									
										
										
										
											2021-08-31 14:39:02 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     return { | 
					
						
							|  |  |  |       cookbooks, | 
					
						
							|  |  |  |       actions, | 
					
						
							|  |  |  |     }; | 
					
						
							| 
									
										
										
										
											2021-08-06 16:28:12 -08:00
										 |  |  |   }, | 
					
						
							| 
									
										
										
										
											2021-10-07 09:39:47 -08:00
										 |  |  |   head() { | 
					
						
							|  |  |  |     return { | 
					
						
							|  |  |  |       title: this.$t("settings.pages") as string, | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |   }, | 
					
						
							| 
									
										
										
										
											2021-08-06 16:28:12 -08:00
										 |  |  | }); | 
					
						
							|  |  |  | </script> | 
					
						
							|  |  |  |      | 
					
						
							| 
									
										
										
										
											2021-09-01 21:39:40 -08:00
										 |  |  | <style> | 
					
						
							| 
									
										
										
										
											2021-08-31 14:39:02 -08:00
										 |  |  | .my-border { | 
					
						
							| 
									
										
										
										
											2021-09-04 20:24:32 -08:00
										 |  |  |   border-left: 5px solid var(--v-primary-base) !important; | 
					
						
							| 
									
										
										
										
											2021-08-31 14:39:02 -08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2021-08-06 16:28:12 -08:00
										 |  |  | </style> |