Added persona page

This commit is contained in:
Stefan Zermatten
2020-03-13 14:56:43 +02:00
parent 9290c9570c
commit 7fe2292c2a
4 changed files with 127 additions and 13 deletions

View File

@@ -1,14 +1,17 @@
<template>
<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-icon>menu</v-icon>
</v-btn>
<div class="flex">{{character.name}}</div>
<v-btn flat icon @click="recompute(character._id)">
<v-icon>refresh</v-icon>
</v-btn>
<span>{{character.name}}</span>
<v-spacer/>
<v-menu bottom left transition="slide-y-transition" data-id="creature-menu">
<template v-slot:activator="{ on }">
<v-btn icon v-on="on">
@@ -34,10 +37,11 @@
</v-list>
</v-menu>
<v-tabs
slot="extension"
v-model="tab"
centered
>
v-model="tab"
slot="extension"
centered
grow
>
<v-tab>
Stats
</v-tab>
@@ -51,9 +55,12 @@
Spells
</v-tab>
<v-tab>
Tree
</v-tab>
</v-tabs>
Persona
</v-tab>
<v-tab>
Tree
</v-tab>
</v-tabs>
</v-toolbar>
<v-content class="flex" v-if="$subReady.singleCharacter">
<v-tabs-items v-model="tab">
@@ -69,6 +76,9 @@
<v-tab-item>
<spells-tab :creature-id="creatureId"/>
</v-tab-item>
<v-tab-item>
<persona-tab :creature-id="creatureId"/>
</v-tab-item>
<v-tab-item>
<tree-tab :creature-id="creatureId"/>
</v-tab-item>
@@ -90,6 +100,7 @@
import FeaturesTab from '/imports/ui/creature/character/characterSheetTabs/FeaturesTab.vue';
import InventoryTab from '/imports/ui/creature/character/characterSheetTabs/InventoryTab.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 { recomputeCreature } from '/imports/api/creature/creatureComputation.js';
@@ -103,6 +114,7 @@
FeaturesTab,
InventoryTab,
SpellsTab,
PersonaTab,
TreeTab,
},
data(){return {
@@ -177,6 +189,9 @@
.v-tabs__bar {
background: none !important;
}
.v-tabs__container--grow .v-tabs__div {
max-width: 180px !important;
}
.v-window-item, .v-window, .v-window__container {
height: 100%;
}

View File

@@ -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>

View 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>

View File

@@ -1,7 +1,7 @@
<template lang="html">
<p v-if="value" class="mt-3">
<markdown-text :markdown="value"/>
</p>
<div>
<markdown-text v-if="value" :markdown="value"/>
</div>
</template>
<script>