Added persona page
This commit is contained in:
@@ -1,14 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="character-sheet layout column">
|
<div class="character-sheet layout column">
|
||||||
<v-toolbar app :color="character.color || 'secondary'" :dark="isDarkColor(character.color || theme.primary)">
|
<v-toolbar
|
||||||
|
app clipped-left
|
||||||
|
:color="character.color || 'secondary'"
|
||||||
|
:dark="isDarkColor(character.color || theme.primary)"
|
||||||
|
>
|
||||||
<v-btn v-if="showMenuButton" flat icon @click="toggleDrawer">
|
<v-btn v-if="showMenuButton" flat icon @click="toggleDrawer">
|
||||||
<v-icon>menu</v-icon>
|
<v-icon>menu</v-icon>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
|
<div class="flex">{{character.name}}</div>
|
||||||
<v-btn flat icon @click="recompute(character._id)">
|
<v-btn flat icon @click="recompute(character._id)">
|
||||||
<v-icon>refresh</v-icon>
|
<v-icon>refresh</v-icon>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
<span>{{character.name}}</span>
|
|
||||||
<v-spacer/>
|
|
||||||
<v-menu bottom left transition="slide-y-transition" data-id="creature-menu">
|
<v-menu bottom left transition="slide-y-transition" data-id="creature-menu">
|
||||||
<template v-slot:activator="{ on }">
|
<template v-slot:activator="{ on }">
|
||||||
<v-btn icon v-on="on">
|
<v-btn icon v-on="on">
|
||||||
@@ -34,10 +37,11 @@
|
|||||||
</v-list>
|
</v-list>
|
||||||
</v-menu>
|
</v-menu>
|
||||||
<v-tabs
|
<v-tabs
|
||||||
slot="extension"
|
v-model="tab"
|
||||||
v-model="tab"
|
slot="extension"
|
||||||
centered
|
centered
|
||||||
>
|
grow
|
||||||
|
>
|
||||||
<v-tab>
|
<v-tab>
|
||||||
Stats
|
Stats
|
||||||
</v-tab>
|
</v-tab>
|
||||||
@@ -51,9 +55,12 @@
|
|||||||
Spells
|
Spells
|
||||||
</v-tab>
|
</v-tab>
|
||||||
<v-tab>
|
<v-tab>
|
||||||
Tree
|
Persona
|
||||||
</v-tab>
|
</v-tab>
|
||||||
</v-tabs>
|
<v-tab>
|
||||||
|
Tree
|
||||||
|
</v-tab>
|
||||||
|
</v-tabs>
|
||||||
</v-toolbar>
|
</v-toolbar>
|
||||||
<v-content class="flex" v-if="$subReady.singleCharacter">
|
<v-content class="flex" v-if="$subReady.singleCharacter">
|
||||||
<v-tabs-items v-model="tab">
|
<v-tabs-items v-model="tab">
|
||||||
@@ -69,6 +76,9 @@
|
|||||||
<v-tab-item>
|
<v-tab-item>
|
||||||
<spells-tab :creature-id="creatureId"/>
|
<spells-tab :creature-id="creatureId"/>
|
||||||
</v-tab-item>
|
</v-tab-item>
|
||||||
|
<v-tab-item>
|
||||||
|
<persona-tab :creature-id="creatureId"/>
|
||||||
|
</v-tab-item>
|
||||||
<v-tab-item>
|
<v-tab-item>
|
||||||
<tree-tab :creature-id="creatureId"/>
|
<tree-tab :creature-id="creatureId"/>
|
||||||
</v-tab-item>
|
</v-tab-item>
|
||||||
@@ -90,6 +100,7 @@
|
|||||||
import FeaturesTab from '/imports/ui/creature/character/characterSheetTabs/FeaturesTab.vue';
|
import FeaturesTab from '/imports/ui/creature/character/characterSheetTabs/FeaturesTab.vue';
|
||||||
import InventoryTab from '/imports/ui/creature/character/characterSheetTabs/InventoryTab.vue';
|
import InventoryTab from '/imports/ui/creature/character/characterSheetTabs/InventoryTab.vue';
|
||||||
import SpellsTab from '/imports/ui/creature/character/characterSheetTabs/SpellsTab.vue';
|
import SpellsTab from '/imports/ui/creature/character/characterSheetTabs/SpellsTab.vue';
|
||||||
|
import PersonaTab from '/imports/ui/creature/character/characterSheetTabs/PersonaTab.vue';
|
||||||
import TreeTab from '/imports/ui/creature/character/characterSheetTabs/TreeTab.vue';
|
import TreeTab from '/imports/ui/creature/character/characterSheetTabs/TreeTab.vue';
|
||||||
import { recomputeCreature } from '/imports/api/creature/creatureComputation.js';
|
import { recomputeCreature } from '/imports/api/creature/creatureComputation.js';
|
||||||
|
|
||||||
@@ -103,6 +114,7 @@
|
|||||||
FeaturesTab,
|
FeaturesTab,
|
||||||
InventoryTab,
|
InventoryTab,
|
||||||
SpellsTab,
|
SpellsTab,
|
||||||
|
PersonaTab,
|
||||||
TreeTab,
|
TreeTab,
|
||||||
},
|
},
|
||||||
data(){return {
|
data(){return {
|
||||||
@@ -177,6 +189,9 @@
|
|||||||
.v-tabs__bar {
|
.v-tabs__bar {
|
||||||
background: none !important;
|
background: none !important;
|
||||||
}
|
}
|
||||||
|
.v-tabs__container--grow .v-tabs__div {
|
||||||
|
max-width: 180px !important;
|
||||||
|
}
|
||||||
.v-window-item, .v-window, .v-window__container {
|
.v-window-item, .v-window, .v-window__container {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
<template lang="html">
|
||||||
|
<div class="inventory">
|
||||||
|
<column-layout>
|
||||||
|
<div>
|
||||||
|
<v-card hover @click="showCharacterForm" data-id="creature-summary">
|
||||||
|
<v-card-title class="title">
|
||||||
|
{{creature.name}}
|
||||||
|
</v-card-title>
|
||||||
|
<v-card-text>
|
||||||
|
{{creature.alignment}}<br/>
|
||||||
|
{{creature.gender}}
|
||||||
|
</v-card-text>
|
||||||
|
</v-card>
|
||||||
|
</div>
|
||||||
|
<div v-for="note in notes">
|
||||||
|
<note-card :model="note" :key="note._id"/>
|
||||||
|
</div>
|
||||||
|
</column-layout>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Creatures from '/imports/api/creature/Creatures.js';
|
||||||
|
import CreatureProperties from '/imports/api/creature/CreatureProperties.js';
|
||||||
|
import ColumnLayout from '/imports/ui/components/ColumnLayout.vue';
|
||||||
|
import NoteCard from '/imports/ui/properties/components/persona/NoteCard.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
creatureId: String,
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
ColumnLayout,
|
||||||
|
NoteCard,
|
||||||
|
},
|
||||||
|
meteor: {
|
||||||
|
notes(){
|
||||||
|
return CreatureProperties.find({
|
||||||
|
'ancestors.id': this.creatureId,
|
||||||
|
type: 'note',
|
||||||
|
removed: {$ne: true},
|
||||||
|
}, {
|
||||||
|
sort: {order: 1},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
creature(){
|
||||||
|
return Creatures.findOne(this.creatureId);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
showCharacterForm(){
|
||||||
|
this.$store.commit('pushDialogStack', {
|
||||||
|
component: 'creature-form-dialog',
|
||||||
|
elementId: 'creature-summary',
|
||||||
|
data: {
|
||||||
|
_id: this.creatureId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="css" scoped>
|
||||||
|
</style>
|
||||||
34
app/imports/ui/properties/components/persona/NoteCard.vue
Normal file
34
app/imports/ui/properties/components/persona/NoteCard.vue
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<template lang="html">
|
||||||
|
<v-card :color="model.color" :data-id="model._id" hover @click="clickProperty(model._id)">
|
||||||
|
<v-card-title class="title">
|
||||||
|
{{model.name}}
|
||||||
|
</v-card-title>
|
||||||
|
<v-card-text>
|
||||||
|
<property-description :value="model.description"/>
|
||||||
|
</v-card-text>
|
||||||
|
</v-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import PropertyDescription from '/imports/ui/properties/viewers/shared/PropertyDescription.vue';
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
PropertyDescription,
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
model: Object,
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
clickProperty(_id){
|
||||||
|
this.$store.commit('pushDialogStack', {
|
||||||
|
component: 'creature-property-dialog',
|
||||||
|
elementId: `${_id}`,
|
||||||
|
data: {_id},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="css" scoped>
|
||||||
|
</style>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<template lang="html">
|
<template lang="html">
|
||||||
<p v-if="value" class="mt-3">
|
<div>
|
||||||
<markdown-text :markdown="value"/>
|
<markdown-text v-if="value" :markdown="value"/>
|
||||||
</p>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
Reference in New Issue
Block a user