Routed library page and cleaned up errors
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import SimpleSchema from 'simpl-schema';
|
||||
import schema from '/imports/api/schema.js';
|
||||
import ChildSchema from '/imports/api/creature/parenting/ChildSchema.js';
|
||||
import librarySchemas from '/imports/api/library/librarySchemas.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { CreatureSchema } from '/imports/api/creature/properties/Creatures.js';
|
||||
import { CreatureSchema } from '/imports/api/creature/Creatures.js';
|
||||
import { ActionSchema } from '/imports/api/creature/properties/Actions.js';
|
||||
import { AttributeSchema } from '/imports/api/creature/properties/Attributes.js';
|
||||
import { ClassSchema } from '/imports/api/creature/properties/Classes.js';
|
||||
@@ -13,8 +13,8 @@ import { ProficiencySchema } from '/imports/api/creature/properties/Proficiencie
|
||||
import { SkillSchema } from '/imports/api/creature/properties/Skills.js';
|
||||
import { SpellListSchema } from '/imports/api/creature/properties/SpellLists.js';
|
||||
import { SpellSchema } from '/imports/api/creature/properties/Spells.js';
|
||||
import { ContainerSchema } from '/imports/api/creature/properties/Containers.js';
|
||||
import { ItemSchema } from '/imports/api/creature/properties/Items.js';
|
||||
import { ContainerSchema } from '/imports/api/creature/properties/inventory/Containers.js';
|
||||
import { ItemSchema } from '/imports/api/creature/properties/inventory/Items.js';
|
||||
|
||||
|
||||
const librarySchemas = {
|
||||
|
||||
@@ -1,10 +1,39 @@
|
||||
<template lang="html">
|
||||
<tree-node-list :children="libraryChildren" :group="library._id"s/>
|
||||
<v-card-text>
|
||||
<tree-node-list :children="libraryChildren" :group="library._id" v-if="libraryChildren"/>
|
||||
<template v-else>This library is empty</template>
|
||||
</v-card-text>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
}
|
||||
import Libraries from '/imports/api/library/Libraries.js';
|
||||
import LibraryNodes from '/imports/api/library/LibraryNodes.js';
|
||||
import TreeNodeList from '/imports/ui/components/tree/TreeNodeList.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
TreeNodeList,
|
||||
},
|
||||
props: {
|
||||
libraryId: String,
|
||||
},
|
||||
meteor: {
|
||||
$subscribe: {
|
||||
'library': this.libraryId,
|
||||
},
|
||||
library(){
|
||||
return Libraries.findOne(this.libraryId);
|
||||
},
|
||||
libraryChildren(){
|
||||
if (!this.library) return;
|
||||
return LibraryNodes.find({
|
||||
"parent.id": this.library._id
|
||||
}, {
|
||||
sort: {order: 1},
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="css" scoped>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<v-list-tile
|
||||
v-for="library in libraries"
|
||||
:key="library._id"
|
||||
:to="library.url"
|
||||
:to="`/library/${library._id}`"
|
||||
:data-id="library._id"
|
||||
>
|
||||
<v-list-tile-content>
|
||||
|
||||
@@ -2,28 +2,21 @@
|
||||
<toolbar-layout>
|
||||
<span slot="toolbar">Library</span>
|
||||
<v-card class="ma-4">
|
||||
<library-contents-container>
|
||||
<v-card-text v-else-if="$subReady.library">
|
||||
You aren't subscribed to any libraries :O
|
||||
</v-card-text>
|
||||
<v-card-text v-if="!$subReady.library" class="layout row justify-center">
|
||||
<v-progress-circular indeterminate/>
|
||||
</v-card-text>
|
||||
<library-contents-container
|
||||
:library-id="$route.params.id"
|
||||
/>
|
||||
</v-card>
|
||||
<v-btn fixed fab bottom right
|
||||
color="primary"
|
||||
@click="insertLibrary"
|
||||
data-id="insert-library-fab"
|
||||
>
|
||||
<v-icon>add</v-icon>
|
||||
</v-btn>
|
||||
</toolbar-layout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
}
|
||||
</script>
|
||||
import ToolbarLayout from '/imports/ui/layouts/ToolbarLayout.vue';
|
||||
import LibraryContentsContainer from '/imports/ui/library/LibraryContentsContainer.vue';
|
||||
|
||||
<style lang="css" scoped>
|
||||
</style>
|
||||
export default {
|
||||
components: {
|
||||
ToolbarLayout,
|
||||
LibraryContentsContainer,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -5,6 +5,7 @@ import Vue from 'vue';
|
||||
import Home from '/imports/ui/pages/Home.vue';
|
||||
import CharacterList from '/imports/ui/pages/CharacterList.vue';
|
||||
import Libraries from '/imports/ui/pages/Libraries.vue';
|
||||
import Library from '/imports/ui/pages/Library.vue';
|
||||
import CharacterSheetPage from '/imports/ui/pages/CharacterSheetPage.vue';
|
||||
import SignIn from '/imports/ui/pages/SignIn.vue' ;
|
||||
import Register from '/imports/ui/pages/Register.vue' ;
|
||||
@@ -33,6 +34,9 @@ RouterFactory.configure(factory => {
|
||||
},{
|
||||
path: '/library',
|
||||
component: Libraries,
|
||||
},{
|
||||
path: '/library/:id',
|
||||
component: Library,
|
||||
},{
|
||||
path: '/character/:id/:urlName',
|
||||
component: CharacterSheetPage,
|
||||
|
||||
Reference in New Issue
Block a user