mirror of
				https://github.com/em-squared/5e-drs.git
				synced 2025-10-31 13:34:21 +00:00 
			
		
		
		
	ajout des liens de partage dans les bibliothèques personnelles + réparation des bibliothèques
This commit is contained in:
		
							parent
							
								
									d111a52ee7
								
							
						
					
					
						commit
						a8170ba02e
					
				
					 6 changed files with 46 additions and 6 deletions
				
			
		|  | @ -21,7 +21,7 @@ | |||
| 
 | ||||
|             <template v-slot:expanded-item="{ headers, item }"> | ||||
|               <td :colspan="headers.length" class="pa-4"> | ||||
|                 <MagicItem :magicItem="item" /> | ||||
|                 <MagicItem :magicItem="getMagicItem(item)" /> | ||||
|               </td> | ||||
|             </template> | ||||
| 
 | ||||
|  | @ -35,6 +35,7 @@ | |||
| 
 | ||||
|             <template v-slot:item.actions="{ item }"> | ||||
|               <div class="text-no-wrap"> | ||||
|                 <v-btn class="d-print-none" v-if="item.custom" small depressed icon @click="share(item)"><v-icon>mdi-share-variant</v-icon></v-btn> | ||||
|                 <v-btn class="d-print-none mr-2" small depressed icon @click.stop="toggleHidePrint(item)"> | ||||
|                   <v-icon v-if="isHiddenPrint(item)">mdi-printer-off</v-icon> | ||||
|                   <v-icon v-else>mdi-printer</v-icon> | ||||
|  | @ -55,7 +56,7 @@ | |||
|                 <v-btn class="d-print-none mr-2" small depressed link :to="{ path: '/creation-de-sort/', query: { key: magicItem.key } }"><v-icon left>mdi-pencil</v-icon> Modifier</v-btn> | ||||
|                 <v-btn color="error" class="d-print-none" small depressed @click="removeMagicItem(magicItem)"><v-icon left>mdi-delete</v-icon> Supprimer</v-btn> | ||||
|               </h2> | ||||
|               <MagicItem :magicItem="magicItem" :isList="true" :hideTitle="true" /> | ||||
|               <MagicItem :magicItem="getMagicItem(magicItem)" :isList="true" :hideTitle="true" /> | ||||
|             </div> | ||||
|           </div> | ||||
|         </div> | ||||
|  | @ -122,6 +123,17 @@ export default { | |||
|       this.$store.commit('myMagicItems/removeMagicItem', magicItem) | ||||
|       this.$store.commit('setSnackbarText', "L'objet magique " + magicItem.title + " a été supprimé de votre bibliothèque") | ||||
|       this.$store.commit('setIsOpenSnackbar', true) | ||||
|     }, | ||||
|     share (item) { | ||||
|       this.$store.commit('setShareURI', encode(item)) | ||||
|       this.$store.commit('setIsOpenShareHomebrewDialog', true) | ||||
|     }, | ||||
|     getMagicItem (item) { | ||||
|       if (!item.custom && item.path) { | ||||
|         let magicItem = this.$site.pages.find((el) => el.path === item.path || el.path === item.path + "/") | ||||
|         return magicItem | ||||
|       } | ||||
|       return item | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -21,7 +21,7 @@ | |||
| 
 | ||||
|             <template v-slot:expanded-item="{ headers, item }"> | ||||
|               <td :colspan="headers.length" class="pa-4"> | ||||
|                 <Monster class="column-count-2" :monster="item" /> | ||||
|                 <Monster class="column-count-2" :monster="getMonster(item)" /> | ||||
|               </td> | ||||
|             </template> | ||||
| 
 | ||||
|  | @ -43,6 +43,7 @@ | |||
| 
 | ||||
|             <template v-slot:item.actions="{ item }"> | ||||
|               <div class="text-no-wrap"> | ||||
|                 <v-btn class="d-print-none" v-if="item.custom" small depressed icon @click="share(item)"><v-icon>mdi-share-variant</v-icon></v-btn> | ||||
|                 <v-btn class="d-print-none mr-2" small depressed icon @click.stop="toggleHidePrint(item)"> | ||||
|                   <v-icon v-if="isHiddenPrint(item)">mdi-printer-off</v-icon> | ||||
|                   <v-icon v-else>mdi-printer</v-icon> | ||||
|  | @ -63,7 +64,7 @@ | |||
|                 <v-btn class="d-print-none mr-2" small depressed link :to="{ path: '/creation-de-monstre-pnj/', query: { key: monster.key } }"><v-icon left>mdi-pencil</v-icon> Modifier</v-btn> | ||||
|                 <v-btn color="error" class="d-print-none" small depressed @click="removeMonster(monster)"><v-icon left>mdi-delete</v-icon> Supprimer</v-btn> | ||||
|               </h1> | ||||
|               <Monster :monster="monster" :isList="true" :hideTitle="true" /> | ||||
|               <Monster :monster="getMonster(monster)" :isList="true" :hideTitle="true" /> | ||||
|             </div> | ||||
|           </div> | ||||
|         </div> | ||||
|  | @ -136,6 +137,17 @@ export default { | |||
|       this.$store.commit('myMonsters/removeMonster', monster) | ||||
|       this.$store.commit('setSnackbarText', "Le monstre " + monster.title + " a été supprimé de votre bestiaire") | ||||
|       this.$store.commit('setIsOpenSnackbar', true) | ||||
|     }, | ||||
|     share (item) { | ||||
|       this.$store.commit('setShareURI', encode(item)) | ||||
|       this.$store.commit('setIsOpenShareHomebrewDialog', true) | ||||
|     }, | ||||
|     getMonster (item) { | ||||
|       if (!item.custom && item.path) { | ||||
|         let monster = this.$site.pages.find((el) => el.path === item.path || el.path === item.path + "/") | ||||
|         return monster | ||||
|       } | ||||
|       return item | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -21,7 +21,7 @@ | |||
| 
 | ||||
|             <template v-slot:expanded-item="{ headers, item }"> | ||||
|               <td :colspan="headers.length" class="pa-4"> | ||||
|                 <Spell :spell="item" /> | ||||
|                 <Spell :spell="getSpell(item)" /> | ||||
|               </td> | ||||
|             </template> | ||||
| 
 | ||||
|  | @ -75,6 +75,7 @@ | |||
| 
 | ||||
|             <template v-slot:item.actions="{ item }"> | ||||
|               <div class="text-no-wrap"> | ||||
|                 <v-btn class="d-print-none" v-if="item.custom" small depressed icon @click="share(item)"><v-icon>mdi-share-variant</v-icon></v-btn> | ||||
|                 <v-btn class="d-print-none mr-2" small depressed icon @click.stop="toggleHidePrint(item)"> | ||||
|                   <v-icon v-if="isHiddenPrint(item)">mdi-printer-off</v-icon> | ||||
|                   <v-icon v-else>mdi-printer</v-icon> | ||||
|  | @ -98,7 +99,7 @@ | |||
|                     <v-btn class="d-print-none mr-2" small depressed link :to="{ path: '/creation-de-sort/', query: { key: spell.key } }"><v-icon left>mdi-pencil</v-icon> Modifier</v-btn> | ||||
|                     <v-btn color="error" class="d-print-none" small depressed @click="removeSpell(spell)"><v-icon left>mdi-delete</v-icon> Supprimer</v-btn> | ||||
|                   </h3> | ||||
|                   <Spell :spell="spell" :isList="true" :hideTitle="true" /> | ||||
|                   <Spell :spell="getSpell(spell)" :isList="true" :hideTitle="true" /> | ||||
|                 </template> | ||||
|               </div> | ||||
|             </div> | ||||
|  | @ -115,6 +116,7 @@ | |||
| 
 | ||||
| <script> | ||||
| import Spell from '@theme/components/Spell' | ||||
| import { encode } from '@theme/util/homebrew' | ||||
| 
 | ||||
| export default { | ||||
|   name: 'MySpells', | ||||
|  | @ -197,6 +199,17 @@ export default { | |||
|       this.$store.commit('mySpells/removeSpell', spell) | ||||
|       this.$store.commit('setSnackbarText', "Le sort " + spell.title + " a été supprimé de votre grimoire") | ||||
|       this.$store.commit('setIsOpenSnackbar', true) | ||||
|     }, | ||||
|     share (item) { | ||||
|       this.$store.commit('setShareURI', encode(item)) | ||||
|       this.$store.commit('setIsOpenShareHomebrewDialog', true) | ||||
|     }, | ||||
|     getSpell (item) { | ||||
|       if (!item.custom && item.path) { | ||||
|         let spell = this.$site.pages.find((el) => el.path === item.path || el.path === item.path + "/") | ||||
|         return spell | ||||
|       } | ||||
|       return item | ||||
|     } | ||||
|   }, | ||||
| } | ||||
|  |  | |||
|  | @ -222,6 +222,7 @@ export default { | |||
|         custom: true, | ||||
|         pid: 'magicItem', | ||||
|         key: Math.random().toString(36).substr(2, 9), | ||||
|         author: '', | ||||
|         title: '', | ||||
|         content: '', | ||||
|         hasAttunement: false, | ||||
|  |  | |||
|  | @ -412,6 +412,7 @@ export default { | |||
|         custom: true, | ||||
|         pid: 'monster', | ||||
|         key: Math.random().toString(36).substr(2, 9), | ||||
|         author: '', | ||||
|         title: '', | ||||
|         content: `## Capacités\n_**Capacité**_. Description de la capacité.\n\n## Actions\n_**Action**_. Description de l'action.`, | ||||
|         frontmatter: { | ||||
|  |  | |||
|  | @ -251,6 +251,7 @@ export default { | |||
|         custom: true, | ||||
|         pid: 'spell', | ||||
|         key: Math.random().toString(36).substr(2, 9), | ||||
|         author: '', | ||||
|         title: '', | ||||
|         content: '', | ||||
|         frontmatter: { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Maxime Moraine
						Maxime Moraine