Merge pull request #1519 from pixelfed/frontend-ui-refactor

Update CollectionCompose.vue component
This commit is contained in:
daniel 2019-07-17 23:36:31 -06:00 committed by GitHub
commit 7e1f1b20f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,7 @@
"/css/appdark.css": "/css/appdark.css?id=1b13fc163fa4deb9233f",
"/css/landing.css": "/css/landing.css?id=31de3e75de8690f7ece5",
"/css/quill.css": "/css/quill.css?id=81604d62610b0dbffad6",
"/js/collectioncompose.js": "/js/collectioncompose.js?id=200765234feeb3b1351c",
"/js/collectioncompose.js": "/js/collectioncompose.js?id=a117b4e0b1d2fd859de5",
"/js/collections.js": "/js/collections.js?id=93bac411f11eb701648f",
"/js/components.js": "/js/components.js?id=7e4df37c02f12db5ef96",
"/js/compose.js": "/js/compose.js?id=df5bd23aef5b73027cce",

View File

@ -30,7 +30,8 @@
</form>
<hr>
<p>
<button type="button" class="btn btn-primary font-weight-bold btn-block" @click="publish">Publish</button>
<button v-if="posts.length > 0" type="button" class="btn btn-primary font-weight-bold btn-block" @click="publish">Publish</button>
<button v-else type="button" class="btn btn-primary font-weight-bold btn-block disabled" disabled>Publish</button>
</p>
<p>
<button type="button" class="btn btn-outline-primary font-weight-bold btn-block" @click="save">Save</button>
@ -221,6 +222,10 @@ export default {
},
publish() {
if(this.posts.length == 0) {
swal('Error', 'You cannot publish an empty collection');
return;
}
axios.post('/api/local/collection/' + this.collectionId + '/publish', {
title: this.collection.title,
description: this.collection.description,
@ -228,6 +233,8 @@ export default {
})
.then(res => {
window.location.href = res.data;
}).catch(err => {
swal('Something went wrong', 'There was a problem with your request, please try again later.', 'error');
});
},