diff --git a/app/imports/server/publications/library.js b/app/imports/server/publications/library.js
index ef68d79f..0a25ff59 100644
--- a/app/imports/server/publications/library.js
+++ b/app/imports/server/publications/library.js
@@ -25,8 +25,26 @@ Meteor.publish('libraries', function(){
{owner: this.userId},
{writers: this.userId},
{readers: this.userId},
- {_id: {$in: subs}},
+ { _id: {$in: subs}, public: true },
]
+ }, {
+ sort: {name: 1}
+ });
+ });
+});
+
+Meteor.publish('library', function(libraryId){
+ if (!libraryId) return [];
+ libraryIdSchema.validate({libraryId});
+ this.autorun(function (){
+ let userId = this.userId;
+ let library = Libraries.findOne(libraryId);
+ try { assertViewPermission(library, userId) }
+ catch(e){
+ return this.error(e);
+ }
+ return Libraries.find({
+ _id: libraryId,
});
});
});
diff --git a/app/imports/ui/library/LibraryAndNode.vue b/app/imports/ui/library/LibraryAndNode.vue
index e2d11a61..8f8cc1e8 100644
--- a/app/imports/ui/library/LibraryAndNode.vue
+++ b/app/imports/ui/library/LibraryAndNode.vue
@@ -19,13 +19,27 @@
>
+
+
+
$emit('selected', e)"
/>
@@ -48,9 +48,9 @@
small
icon
:disabled="!editPermission(library)"
- @click="editLibrary(library._id)"
+ @click="$router.push(`/library/${library._id}`)"
>
- create
+ arrow_forward
@@ -90,7 +90,7 @@ export default {
selectedNodeId: String,
},
data(){ return {
- expandedLibrary: null,
+ expandedLibrary: [],
};},
meteor: {
$subscribe: {
@@ -117,9 +117,7 @@ export default {
},
},
methods: {
- isExpanded(index){
- return this.expandedLibrary && this.expandedLibrary[index];
- },
+ log: console.log,
insertLibrary(){
if (this.paidBenefits){
this.$store.commit('pushDialogStack', {
diff --git a/app/imports/ui/library/LibraryContentsContainer.vue b/app/imports/ui/library/LibraryContentsContainer.vue
index 3f2bca15..2b5363a5 100644
--- a/app/imports/ui/library/LibraryContentsContainer.vue
+++ b/app/imports/ui/library/LibraryContentsContainer.vue
@@ -1,20 +1,30 @@
- $emit('selected', e)"
- @reordered="reordered"
- @reorganized="reorganized"
- />
-
+
+ $emit('selected', e)"
+ @reordered="reordered"
+ @reorganized="reorganized"
+ />
+
+
+
+
-
-
diff --git a/app/imports/ui/library/SingleLibraryToolbarItems.vue b/app/imports/ui/library/SingleLibraryToolbar.vue
similarity index 55%
rename from app/imports/ui/library/SingleLibraryToolbarItems.vue
rename to app/imports/ui/library/SingleLibraryToolbar.vue
index 2970d7cb..0726d701 100644
--- a/app/imports/ui/library/SingleLibraryToolbarItems.vue
+++ b/app/imports/ui/library/SingleLibraryToolbar.vue
@@ -1,28 +1,53 @@
-
-
- {{ subscribed ? 'Unsubscribe' : 'Subscribe' }}
-
-
- create
-
-
+
+
+
+
+ arrow_back
+
+
+
+ {{ library && library.name }}
+
+
+
+
+ {{ subscribed ? 'Unsubscribe' : 'Subscribe' }}
+
+
+ settings
+
+
+
diff --git a/app/imports/ui/router.js b/app/imports/ui/router.js
index c0175bcb..591f7045 100644
--- a/app/imports/ui/router.js
+++ b/app/imports/ui/router.js
@@ -6,8 +6,7 @@ import Home from '/imports/ui/pages/Home.vue';
import About from '/imports/ui/pages/About.vue';
import CharacterList from '/imports/ui/pages/CharacterList.vue';
import Library from '/imports/ui/pages/Library.vue';
-import SingleLibraryPage from '/imports/ui/pages/SingleLibraryPage.vue'
-import SingleLibraryToolbarItems from '/imports/ui/library/SingleLibraryToolbarItems.vue'
+import SingleLibraryToolbar from '/imports/ui/library/SingleLibraryToolbar.vue';
import CharacterSheetPage from '/imports/ui/pages/CharacterSheetPage.vue';
import CharacterSheetToolbar from '/imports/ui/creature/character/CharacterSheetToolbar.vue';
import CharacterSheetRightDrawer from '/imports/ui/creature/character/CharacterSheetRightDrawer.vue';
@@ -123,8 +122,8 @@ RouterFactory.configure(factory => {
name: 'singleLibrary',
path: '/library/:id',
components: {
- default: SingleLibraryPage,
- toolbarItems: SingleLibraryToolbarItems,
+ default: Library,
+ toolbar: SingleLibraryToolbar,
},
meta: {
title: 'Library',