kopia lustrzana https://github.com/pixelfed/pixelfed
Merge pull request #1519 from pixelfed/frontend-ui-refactor
Update CollectionCompose.vue componentpull/1525/head
commit
7e1f1b20f4
File diff suppressed because one or more lines are too long
|
@ -8,7 +8,7 @@
|
||||||
"/css/appdark.css": "/css/appdark.css?id=1b13fc163fa4deb9233f",
|
"/css/appdark.css": "/css/appdark.css?id=1b13fc163fa4deb9233f",
|
||||||
"/css/landing.css": "/css/landing.css?id=31de3e75de8690f7ece5",
|
"/css/landing.css": "/css/landing.css?id=31de3e75de8690f7ece5",
|
||||||
"/css/quill.css": "/css/quill.css?id=81604d62610b0dbffad6",
|
"/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/collections.js": "/js/collections.js?id=93bac411f11eb701648f",
|
||||||
"/js/components.js": "/js/components.js?id=7e4df37c02f12db5ef96",
|
"/js/components.js": "/js/components.js?id=7e4df37c02f12db5ef96",
|
||||||
"/js/compose.js": "/js/compose.js?id=df5bd23aef5b73027cce",
|
"/js/compose.js": "/js/compose.js?id=df5bd23aef5b73027cce",
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
</form>
|
</form>
|
||||||
<hr>
|
<hr>
|
||||||
<p>
|
<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>
|
||||||
<p>
|
<p>
|
||||||
<button type="button" class="btn btn-outline-primary font-weight-bold btn-block" @click="save">Save</button>
|
<button type="button" class="btn btn-outline-primary font-weight-bold btn-block" @click="save">Save</button>
|
||||||
|
@ -221,6 +222,10 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
publish() {
|
publish() {
|
||||||
|
if(this.posts.length == 0) {
|
||||||
|
swal('Error', 'You cannot publish an empty collection');
|
||||||
|
return;
|
||||||
|
}
|
||||||
axios.post('/api/local/collection/' + this.collectionId + '/publish', {
|
axios.post('/api/local/collection/' + this.collectionId + '/publish', {
|
||||||
title: this.collection.title,
|
title: this.collection.title,
|
||||||
description: this.collection.description,
|
description: this.collection.description,
|
||||||
|
@ -228,6 +233,8 @@ export default {
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
window.location.href = res.data;
|
window.location.href = res.data;
|
||||||
|
}).catch(err => {
|
||||||
|
swal('Something went wrong', 'There was a problem with your request, please try again later.', 'error');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue