diff --git a/resources/assets/js/components/CollectionComponent.vue b/resources/assets/js/components/CollectionComponent.vue index 904471861..1d029ce3b 100644 --- a/resources/assets/js/components/CollectionComponent.vue +++ b/resources/assets/js/components/CollectionComponent.vue @@ -67,8 +67,37 @@
@@ -161,6 +190,7 @@ export default { data() { return { + collection: {}, config: window.App.config, loaded: false, posts: [], @@ -179,14 +209,21 @@ export default { }, beforeMount() { - this.fetchCurrentUser(); - this.fetchItems(); + this.fetchCollection(); }, mounted() { }, methods: { + fetchCollection() { + axios.get('/api/local/collection/' + this.collectionId) + .then(res => { + this.collection = res.data; + this.fetchCurrentUser(); + }) + }, + fetchCurrentUser() { if(document.querySelectorAll('body')[0].classList.contains('loggedIn') == true) { axios.get('/api/pixelfed/v1/accounts/verify_credentials').then(res => { @@ -194,9 +231,13 @@ export default { this.owner = this.currentUser.id == this.profileId; window._sharedData.curUser = res.data; window.App.util.navatar(); + this.fetchItems(); }); + } else { + this.fetchItems(); } }, + fetchItems() { axios.get('/api/local/collection/items/' + this.collectionId) .then(res => { @@ -296,6 +337,26 @@ export default { } }, + publishCollection() { + if(this.owner == false) { + return; + } + + let confirmed = window.confirm('Are you sure you want to publish this collection?'); + if(confirmed) { + axios.post('/api/local/collection/' + this.collectionId + '/publish', { + title: this.title, + description: this.description, + visibility: this.visibility + }) + .then(res => { + window.location.href = '/'; + }); + } else { + return; + } + }, + updateCollection() { this.$refs.editModal.hide(); axios.post('/api/local/collection/' + this.collectionId, { @@ -367,4 +428,4 @@ export default { } } } - \ No newline at end of file + diff --git a/resources/assets/js/components/ComposeClassic.vue b/resources/assets/js/components/ComposeClassic.vue index f86363824..75f0ed80b 100644 --- a/resources/assets/js/components/ComposeClassic.vue +++ b/resources/assets/js/components/ComposeClassic.vue @@ -61,7 +61,7 @@ -
- - {{replyText.length}}/{{config.uploader.max_caption_length}} - - -
-
-
-
-
-
-
-