Classes :
{{ c }}
@@ -96,9 +149,9 @@
-
+
+
+
@@ -120,6 +173,7 @@ import { setUrlParams, getUrlParameter } from '@theme/util/filterHelpers'
import { isResourceInLibrary } from '@theme/util'
import Spell from '@theme/components/Spell'
import MySpellsButton from '@theme/global-components/MySpellsButton'
+import Cookies from 'js-cookie'
export default {
components: { Breadcrumb, Spell, MySpellsButton },
@@ -137,18 +191,27 @@ export default {
],
page: 1,
pageCount: 0,
- headers: [
- { text: "", align: 'center', sortable: false, value: 'isInSpellBook' },
- { text: "Nom", align: 'start', sortable: true, value: 'title' },
- { text: "Niveau", align: 'center', sortable: true, value: 'frontmatter.level' },
- { text: "École", align: 'start', sortable: false, value: 'frontmatter.school' },
- { text: "Temps d'incantation", align: 'start', sortable: false, value: 'frontmatter.casting_time' },
- { text: "Durée", align: 'start', sortable: false, value: 'frontmatter.duration' },
- { text: "Concentration", align: 'center', sortable: false, value: 'frontmatter.concentration' },
- { text: "Rituel", align: 'center', sortable: false, value: 'frontmatter.ritual' },
- { text: "Composantes", align: 'center', sortable: false, value: 'frontmatter.components' },
- // { text: "Classes", align: 'start', sortable: false, value: 'frontmatter.classes' }
- ],
+ // headers: [
+ // { text: "", align: 'center', sortable: false, value: 'isInSpellBook' },
+ // { text: "Nom", align: 'start', sortable: true, value: 'title' },
+ // { text: "Niveau", align: 'center', sortable: true, value: 'frontmatter.level' },
+ // { text: "École", align: 'start', sortable: false, value: 'frontmatter.school' },
+ // { text: "Temps d'incantation", align: 'start', sortable: false, value: 'frontmatter.casting_time' },
+ // { text: "Durée", align: 'start', sortable: false, value: 'frontmatter.duration' },
+ // { text: "Concentration", align: 'center', sortable: false, value: 'frontmatter.concentration' },
+ // { text: "Rituel", align: 'center', sortable: false, value: 'frontmatter.ritual' },
+ // { text: "Composantes", align: 'center', sortable: false, value: 'frontmatter.components' },
+ // { text: "Description", align: 'start', sortable: false, value: 'frontmatter.description' },
+ // ],
+ showColumn: {
+ school: true,
+ castingTime: true,
+ duration: true,
+ concentration: true,
+ ritual: true,
+ components: true,
+ description: false,
+ }
}
},
@@ -165,6 +228,36 @@ export default {
componentMaterial: state => state.spellFilters.componentMaterial,
}),
+ headers() {
+ let headers = [
+ { text: "", align: 'center', sortable: false, value: 'isInSpellBook' },
+ { text: "Nom", align: 'start', sortable: true, value: 'title' },
+ { text: "Niveau", align: 'center', sortable: true, value: 'frontmatter.level' }
+ ]
+ if (this.showColumn.school) {
+ headers.push({ text: "École", align: 'start', sortable: false, value: 'frontmatter.school' })
+ }
+ if (this.showColumn.castingTime) {
+ headers.push({ text: "Temps d'incantation", align: 'start', sortable: false, value: 'frontmatter.casting_time' })
+ }
+ if (this.showColumn.duration) {
+ headers.push({ text: "Durée", align: 'start', sortable: false, value: 'frontmatter.duration' })
+ }
+ if (this.showColumn.concentration) {
+ headers.push({ text: "Concentration", align: 'center', sortable: false, value: 'frontmatter.concentration' })
+ }
+ if (this.showColumn.ritual) {
+ headers.push({ text: "Rituel", align: 'center', sortable: false, value: 'frontmatter.ritual' })
+ }
+ if (this.showColumn.components) {
+ headers.push({ text: "Composantes", align: 'center', sortable: false, value: 'frontmatter.components' })
+ }
+ if (this.showColumn.description) {
+ headers.push({ text: "Description", align: 'start', sortable: false, value: 'frontmatter.description' })
+ }
+ return headers
+ },
+
selectedClasses() {
let result = []
for (let c of this.classes) {
@@ -341,6 +434,10 @@ export default {
}
return level.level.toString() + '
ème'
},
+
+ setShowColumn () {
+ Cookies.set('heros-et-dragons-grimoire-colonnes', this.showColumn)
+ },
},
mounted () {
@@ -357,6 +454,12 @@ export default {
if (page) {
this.page = page
}
+
+ // Choix des colonnes à afficher
+ const showColumn = Cookies.get('heros-et-dragons-grimoire-colonnes')
+ if (showColumn) {
+ this.showColumn = JSON.parse(showColumn)
+ }
}
}