mirror of https://github.com/pixelfed/pixelfed
commit
b9697d15d6
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{17:function(t,e,s){t.exports=s("ntcu")},BzCV:function(t,e,s){"use strict";s.r(e);var n={props:["collection-id"],data:function(){return{loaded:!1,posts:[]}},beforeMount:function(){this.fetchItems()},mounted:function(){},methods:{fetchItems:function(){var t=this;axios.get("/api/local/collection/items/"+this.collectionId).then(function(e){t.posts=e.data})},previewUrl:function(t){return t.sensitive?"/storage/no-preview.png?v="+(new Date).getTime():t.media_attachments[0].preview_url},previewBackground:function(t){return"background-image: url("+this.previewUrl(t)+");"}}},a=s("KHd+"),i=Object(a.a)(n,function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",[s("div",{staticClass:"row"},t._l(t.posts,function(e,n){return s("div",{staticClass:"col-4 p-0 p-sm-2 p-md-3 p-xs-1"},[s("a",{staticClass:"card info-overlay card-md-border-0",attrs:{href:e.url}},[s("div",{staticClass:"square"},["photo:album"==e.pf_type?s("span",{staticClass:"float-right mr-3 post-icon"},[s("i",{staticClass:"fas fa-images fa-2x"})]):t._e(),t._v(" "),"video"==e.pf_type?s("span",{staticClass:"float-right mr-3 post-icon"},[s("i",{staticClass:"fas fa-video fa-2x"})]):t._e(),t._v(" "),"video:album"==e.pf_type?s("span",{staticClass:"float-right mr-3 post-icon"},[s("i",{staticClass:"fas fa-film fa-2x"})]):t._e(),t._v(" "),s("div",{staticClass:"square-content",style:t.previewBackground(e)}),t._v(" "),s("div",{staticClass:"info-overlay-text"},[s("h5",{staticClass:"text-white m-auto font-weight-bold"},[s("span",[s("span",{staticClass:"far fa-heart fa-lg p-2 d-flex-inline"}),t._v(" "),s("span",{staticClass:"d-flex-inline"},[t._v(t._s(e.favourites_count))])]),t._v(" "),s("span",[s("span",{staticClass:"fas fa-retweet fa-lg p-2 d-flex-inline"}),t._v(" "),s("span",{staticClass:"d-flex-inline"},[t._v(t._s(e.reblogs_count))])])])])])])])}),0)])},[],!1,null,"5edf1095",null);e.default=i.exports},"KHd+":function(t,e,s){"use strict";function n(t,e,s,n,a,i,o,r){var c,l="function"==typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=s,l._compiled=!0),n&&(l.functional=!0),i&&(l._scopeId="data-v-"+i),o?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),a&&a.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},l._ssrRegister=c):a&&(c=r?function(){a.call(this,this.$root.$options.shadowRoot)}:a),c)if(l.functional){l._injectStyles=c;var f=l.render;l.render=function(t,e){return c.call(e),f(t,e)}}else{var p=l.beforeCreate;l.beforeCreate=p?[].concat(p,c):[c]}return{exports:t,options:l}}s.d(e,"a",function(){return n})},ntcu:function(t,e,s){Vue.component("collection-component",s("BzCV").default)}},[[17,0]]]);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{14:function(e,a,o){e.exports=o("YMO/")},"YMO/":function(e,a,o){(function(e){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}ace.define("ace/theme/monokai",["require","exports","module","ace/lib/dom"],function(e,a,o){a.isDark=!0,a.cssClass="ace-monokai",a.cssText=".ace-monokai .ace_gutter {background: #2F3129;color: #8F908A}.ace-monokai .ace_print-margin {width: 1px;background: #555651}.ace-monokai {background-color: #272822;color: #F8F8F2}.ace-monokai .ace_cursor {color: #F8F8F0}.ace-monokai .ace_marker-layer .ace_selection {background: #49483E}.ace-monokai.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #272822;}.ace-monokai .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-monokai .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #49483E}.ace-monokai .ace_marker-layer .ace_active-line {background: #202020}.ace-monokai .ace_gutter-active-line {background-color: #272727}.ace-monokai .ace_marker-layer .ace_selected-word {border: 1px solid #49483E}.ace-monokai .ace_invisible {color: #52524d}.ace-monokai .ace_entity.ace_name.ace_tag,.ace-monokai .ace_keyword,.ace-monokai .ace_meta.ace_tag,.ace-monokai .ace_storage {color: #F92672}.ace-monokai .ace_punctuation,.ace-monokai .ace_punctuation.ace_tag {color: #fff}.ace-monokai .ace_constant.ace_character,.ace-monokai .ace_constant.ace_language,.ace-monokai .ace_constant.ace_numeric,.ace-monokai .ace_constant.ace_other {color: #AE81FF}.ace-monokai .ace_invalid {color: #F8F8F0;background-color: #F92672}.ace-monokai .ace_invalid.ace_deprecated {color: #F8F8F0;background-color: #AE81FF}.ace-monokai .ace_support.ace_constant,.ace-monokai .ace_support.ace_function {color: #66D9EF}.ace-monokai .ace_fold {background-color: #A6E22E;border-color: #F8F8F2}.ace-monokai .ace_storage.ace_type,.ace-monokai .ace_support.ace_class,.ace-monokai .ace_support.ace_type {font-style: italic;color: #66D9EF}.ace-monokai .ace_entity.ace_name.ace_function,.ace-monokai .ace_entity.ace_other,.ace-monokai .ace_entity.ace_other.ace_attribute-name,.ace-monokai .ace_variable {color: #A6E22E}.ace-monokai .ace_variable.ace_parameter {font-style: italic;color: #FD971F}.ace-monokai .ace_string {color: #E6DB74}.ace-monokai .ace_comment {color: #75715E}.ace-monokai .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y}",e("../lib/dom").importCssString(a.cssText,a.cssClass)}),ace.require(["ace/theme/monokai"],function(c){"object"==o(e)&&"object"==o(a)&&e&&(e.exports=c)})}).call(this,o("YuTi")(e))},YuTi:function(e,a){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}}},[[14,0]]]);
|
||||
(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{14:function(e,a,o){e.exports=o("YMO/")},"YMO/":function(e,a,o){(function(e){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}ace.define("ace/theme/monokai",["require","exports","module","ace/lib/dom"],function(e,a,o){a.isDark=!0,a.cssClass="ace-monokai",a.cssText=".ace-monokai .ace_gutter {background: #2F3129;color: #8F908A}.ace-monokai .ace_print-margin {width: 1px;background: #555651}.ace-monokai {background-color: #272822;color: #F8F8F2}.ace-monokai .ace_cursor {color: #F8F8F0}.ace-monokai .ace_marker-layer .ace_selection {background: #49483E}.ace-monokai.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #272822;}.ace-monokai .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-monokai .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #49483E}.ace-monokai .ace_marker-layer .ace_active-line {background: #202020}.ace-monokai .ace_gutter-active-line {background-color: #272727}.ace-monokai .ace_marker-layer .ace_selected-word {border: 1px solid #49483E}.ace-monokai .ace_invisible {color: #52524d}.ace-monokai .ace_entity.ace_name.ace_tag,.ace-monokai .ace_keyword,.ace-monokai .ace_meta.ace_tag,.ace-monokai .ace_storage {color: #F92672}.ace-monokai .ace_punctuation,.ace-monokai .ace_punctuation.ace_tag {color: #fff}.ace-monokai .ace_constant.ace_character,.ace-monokai .ace_constant.ace_language,.ace-monokai .ace_constant.ace_numeric,.ace-monokai .ace_constant.ace_other {color: #AE81FF}.ace-monokai .ace_invalid {color: #F8F8F0;background-color: #F92672}.ace-monokai .ace_invalid.ace_deprecated {color: #F8F8F0;background-color: #AE81FF}.ace-monokai .ace_support.ace_constant,.ace-monokai .ace_support.ace_function {color: #66D9EF}.ace-monokai .ace_fold {background-color: #A6E22E;border-color: #F8F8F2}.ace-monokai .ace_storage.ace_type,.ace-monokai .ace_support.ace_class,.ace-monokai .ace_support.ace_type {font-style: italic;color: #66D9EF}.ace-monokai .ace_entity.ace_name.ace_function,.ace-monokai .ace_entity.ace_other,.ace-monokai .ace_entity.ace_other.ace_attribute-name,.ace-monokai .ace_variable {color: #A6E22E}.ace-monokai .ace_variable.ace_parameter {font-style: italic;color: #FD971F}.ace-monokai .ace_string {color: #E6DB74}.ace-monokai .ace_comment {color: #75715E}.ace-monokai .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y}",e("../lib/dom").importCssString(a.cssText,a.cssClass)}),ace.require(["ace/theme/monokai"],function(c){"object"==o(e)&&"object"==o(a)&&e&&(e.exports=c)})}).call(this,o("YuTi")(e))},YuTi:function(e,a){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}}},[[14,0]]]);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,4 @@
|
||||
Vue.component(
|
||||
'collection-compose',
|
||||
require('./components/CollectionCompose.vue').default
|
||||
);
|
@ -0,0 +1,4 @@
|
||||
Vue.component(
|
||||
'collection-component',
|
||||
require('./components/CollectionComponent.vue').default
|
||||
);
|
@ -0,0 +1,69 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-4 p-0 p-sm-2 p-md-3 p-xs-1" v-for="(s, index) in posts">
|
||||
<a class="card info-overlay card-md-border-0" :href="s.url">
|
||||
<div class="square">
|
||||
<span v-if="s.pf_type == 'photo:album'" class="float-right mr-3 post-icon"><i class="fas fa-images fa-2x"></i></span>
|
||||
<span v-if="s.pf_type == 'video'" class="float-right mr-3 post-icon"><i class="fas fa-video fa-2x"></i></span>
|
||||
<span v-if="s.pf_type == 'video:album'" class="float-right mr-3 post-icon"><i class="fas fa-film fa-2x"></i></span>
|
||||
<div class="square-content" v-bind:style="previewBackground(s)">
|
||||
</div>
|
||||
<div class="info-overlay-text">
|
||||
<h5 class="text-white m-auto font-weight-bold">
|
||||
<span>
|
||||
<span class="far fa-heart fa-lg p-2 d-flex-inline"></span>
|
||||
<span class="d-flex-inline">{{s.favourites_count}}</span>
|
||||
</span>
|
||||
<span>
|
||||
<span class="fas fa-retweet fa-lg p-2 d-flex-inline"></span>
|
||||
<span class="d-flex-inline">{{s.reblogs_count}}</span>
|
||||
</span>
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style type="text/css" scoped></style>
|
||||
|
||||
<script type="text/javascript">
|
||||
export default {
|
||||
props: ['collection-id'],
|
||||
|
||||
data() {
|
||||
return {
|
||||
loaded: false,
|
||||
posts: [],
|
||||
}
|
||||
},
|
||||
|
||||
beforeMount() {
|
||||
this.fetchItems();
|
||||
},
|
||||
|
||||
mounted() {
|
||||
},
|
||||
|
||||
methods: {
|
||||
fetchItems() {
|
||||
axios.get('/api/local/collection/items/' + this.collectionId)
|
||||
.then(res => {
|
||||
this.posts = res.data;
|
||||
});
|
||||
},
|
||||
|
||||
previewUrl(status) {
|
||||
return status.sensitive ? '/storage/no-preview.png?v=' + new Date().getTime() : status.media_attachments[0].preview_url;
|
||||
},
|
||||
|
||||
previewBackground(status) {
|
||||
let preview = this.previewUrl(status);
|
||||
return 'background-image: url(' + preview + ');';
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,257 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div v-if="loaded" class="row">
|
||||
<div class="col-12 col-md-6 offset-md-3 pt-5">
|
||||
<div class="text-center pb-4">
|
||||
<h1>Create Collection</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-4 pt-3">
|
||||
<div class="card rounded-0 shadow-none border " style="min-height: 440px;">
|
||||
<div class="card-body">
|
||||
<div>
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label for="title" class="font-weight-bold text-muted">Title</label>
|
||||
<input type="text" class="form-control" id="title" placeholder="Collection Title" v-model="collection.title">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="description" class="font-weight-bold text-muted">Description</label>
|
||||
<textarea class="form-control" id="description" placeholder="Example description here" v-model="collection.description" rows="3">
|
||||
</textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="visibility" class="font-weight-bold text-muted">Visibility</label>
|
||||
<select class="custom-select" v-model="collection.visibility">
|
||||
<option value="public">Public</option>
|
||||
<option value="private">Followers Only</option>
|
||||
</select>
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<p>
|
||||
<button type="button" class="btn btn-primary font-weight-bold btn-block" @click="publish">Publish</button>
|
||||
</p>
|
||||
<p>
|
||||
<button type="button" class="btn btn-outline-primary font-weight-bold btn-block" @click="save">Save</button>
|
||||
</p>
|
||||
<p class="mb-0">
|
||||
<button type="button" class="btn btn-outline-secondary font-weight-bold btn-block" @click="deleteCollection">Delete</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-md-8 pt-3">
|
||||
<div>
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="nav-item">
|
||||
<a :class="[tab == 'add' ? 'nav-link font-weight-bold bg-white active' : 'nav-link font-weight-bold text-muted']" href="#" @click.prevent="tab = 'add'">Add Posts</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a :class="[tab == 'all' ? 'nav-link font-weight-bold bg-white active' : 'nav-link font-weight-bold text-muted']" href="#" @click.prevent="tab = 'all'">Preview</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="card rounded-0 shadow-none border border-top-0">
|
||||
<div class="card-body" style="height: 460px; overflow-y: auto">
|
||||
<div v-if="tab == 'all'" class="row">
|
||||
<div class="col-4 p-1" v-for="(s, index) in posts">
|
||||
<a class="card info-overlay card-md-border-0" :href="s.url">
|
||||
<div class="square">
|
||||
<span v-if="s.pf_type == 'photo:album'" class="float-right mr-3 post-icon"><i class="fas fa-images fa-2x"></i></span>
|
||||
<span v-if="s.pf_type == 'video'" class="float-right mr-3 post-icon"><i class="fas fa-video fa-2x"></i></span>
|
||||
<span v-if="s.pf_type == 'video:album'" class="float-right mr-3 post-icon"><i class="fas fa-film fa-2x"></i></span>
|
||||
<div class="square-content" v-bind:style="previewBackground(s)">
|
||||
</div>
|
||||
<div class="info-overlay-text">
|
||||
<h5 class="text-white m-auto font-weight-bold">
|
||||
<span>
|
||||
<span class="far fa-heart fa-lg p-2 d-flex-inline"></span>
|
||||
<span class="d-flex-inline">{{s.favourites_count}}</span>
|
||||
</span>
|
||||
<span>
|
||||
<span class="fas fa-retweet fa-lg p-2 d-flex-inline"></span>
|
||||
<span class="d-flex-inline">{{s.reblogs_count}}</span>
|
||||
</span>
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="tab == 'add'">
|
||||
<div class="form-group">
|
||||
<label for="title" class="font-weight-bold text-muted">Add Post by URL</label>
|
||||
<input type="text" class="form-control" placeholder="https://pixelfed.dev/p/admin/1" v-model="id">
|
||||
<p class="help-text small text-muted">Only local, public posts can be added</p>
|
||||
</div>
|
||||
<div class="form-group pt-4">
|
||||
<label for="title" class="font-weight-bold text-muted">Add Recent Post</label>
|
||||
<div>
|
||||
<div v-for="(s, index) in recentPosts" :class="[selectedPost == s.id ? 'box-shadow border border-warning d-inline-block m-1':'d-inline-block m-1']" @click="selectPost(s)">
|
||||
<div class="cursor-pointer" :style="'width: 175px; height: 175px; ' + previewBackground(s)"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<button type="button" class="btn btn-primary font-weight-bold btn-block" @click="addId">Add Post</button>
|
||||
</div>
|
||||
<div v-if="tab == 'order'">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script type="text/javascript">
|
||||
export default {
|
||||
props: ['collection-id', 'profile-id'],
|
||||
data() {
|
||||
return {
|
||||
loaded: false,
|
||||
limit: 8,
|
||||
step: 1,
|
||||
title: '',
|
||||
description: '',
|
||||
visibility: 'private',
|
||||
collection: {
|
||||
title: '',
|
||||
description: '',
|
||||
visibility: 'public'
|
||||
},
|
||||
id: '',
|
||||
posts: [],
|
||||
tab: 'add',
|
||||
tabs: [
|
||||
'all',
|
||||
'add',
|
||||
'order'
|
||||
],
|
||||
recentPosts: [],
|
||||
selectedPost: '',
|
||||
}
|
||||
},
|
||||
beforeMount() {
|
||||
axios.get('/api/local/collection/' + this.collectionId)
|
||||
.then(res => {
|
||||
this.collection = res.data;
|
||||
});
|
||||
},
|
||||
mounted() {
|
||||
this.fetchRecentPosts();
|
||||
this.fetchItems();
|
||||
},
|
||||
methods: {
|
||||
addToIds(id) {
|
||||
axios.post('/api/local/collection/item', {
|
||||
collection_id: this.collectionId,
|
||||
post_id: id
|
||||
}).then(res => {
|
||||
this.fetchItems();
|
||||
this.fetchRecentPosts();
|
||||
this.tab = 'all';
|
||||
this.id = '';
|
||||
}).catch(err => {
|
||||
swal('Invalid URL', 'The post you entered was invalid', 'error');
|
||||
this.id = '';
|
||||
})
|
||||
},
|
||||
|
||||
fetchItems() {
|
||||
axios.get('/api/local/collection/items/' + this.collectionId)
|
||||
.then(res => {
|
||||
this.posts = res.data;
|
||||
this.loaded = true;
|
||||
});
|
||||
},
|
||||
|
||||
addId() {
|
||||
let max = 18;
|
||||
if(this.posts.length >= max) {
|
||||
swal('Error', 'You can only add ' + max + ' posts per collection', 'error');
|
||||
return;
|
||||
}
|
||||
let url = this.id;
|
||||
let origin = window.location.origin;
|
||||
let split = url.split('/');
|
||||
if(url.slice(0, origin.length) !== origin) {
|
||||
swal('Invalid URL', 'You can only add posts from this instance', 'error');
|
||||
this.id = '';
|
||||
}
|
||||
if(url.slice(0, origin.length + 3) !== origin + '/p/' || split.length !== 6) {
|
||||
swal('Invalid URL', 'Invalid URL', 'error');
|
||||
this.id = '';
|
||||
}
|
||||
this.addToIds(split[5]);
|
||||
return;
|
||||
},
|
||||
|
||||
previewUrl(status) {
|
||||
return status.sensitive ? '/storage/no-preview.png?v=' + new Date().getTime() : status.media_attachments[0].preview_url;
|
||||
},
|
||||
|
||||
previewBackground(status) {
|
||||
let preview = this.previewUrl(status);
|
||||
return 'background-image: url(' + preview + ');background-size:cover;';
|
||||
},
|
||||
|
||||
fetchRecentPosts() {
|
||||
axios.get('/api/v1/accounts/' + this.profileId + '/statuses', {
|
||||
params: {
|
||||
only_media: true,
|
||||
min_id: 1,
|
||||
}
|
||||
}).then(res => {
|
||||
this.recentPosts = res.data.filter(s => {
|
||||
let ids = this.posts.map(s => {
|
||||
return s.id;
|
||||
});
|
||||
return s.visibility == 'public' && s.sensitive == false && ids.indexOf(s.id) == -1;
|
||||
}).slice(0,3);
|
||||
});
|
||||
},
|
||||
|
||||
selectPost(status) {
|
||||
this.selectedPost = status.id;
|
||||
this.id = status.url;
|
||||
},
|
||||
|
||||
publish() {
|
||||
axios.post('/api/local/collection/' + this.collectionId + '/publish', {
|
||||
title: this.collection.title,
|
||||
description: this.collection.description,
|
||||
visibility: this.collection.visibility
|
||||
})
|
||||
.then(res => {
|
||||
window.location.href = res.data;
|
||||
});
|
||||
},
|
||||
|
||||
save() {
|
||||
axios.post('/api/local/collection/' + this.collectionId, {
|
||||
title: this.collection.title,
|
||||
description: this.collection.description,
|
||||
visibility: this.collection.visibility
|
||||
})
|
||||
.then(res => {
|
||||
swal('Saved!', 'You have successfully saved this collection.', 'success');
|
||||
});
|
||||
},
|
||||
|
||||
deleteCollection() {
|
||||
let confirm = window.confirm('Are you sure you want to delete this collection?');
|
||||
if(!confirm) {
|
||||
return;
|
||||
}
|
||||
axios.delete('/api/local/collection/' + this.collectionId)
|
||||
.then(res => {
|
||||
window.location.href = '/';
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,24 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
|
||||
<collection-compose collection-id="{{$collection->id}}" profile-id="{{Auth::user()->profile_id}}"></collection-compose>
|
||||
|
||||
@endsection
|
||||
|
||||
@push('styles')
|
||||
<style type="text/css">
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript" src="{{ mix('js/collectioncompose.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ mix('js/compose.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
new Vue({
|
||||
el: '#content'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
@ -0,0 +1,33 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12 mt-5 py-5">
|
||||
<div class="text-center">
|
||||
<h1>Collection</h1>
|
||||
<h4 class="text-muted">{{$collection->title}}</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<collection-component collection-id="{{$collection->id}}"></collection-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@push('styles')
|
||||
<style type="text/css">
|
||||
</style>
|
||||
@endpush
|
||||
@push('scripts')
|
||||
<script type="text/javascript" src="{{mix('js/compose.js')}}"></script>
|
||||
<script type="text/javascript" src="{{mix('js/collections.js')}}"></script>
|
||||
<script type="text/javascript">
|
||||
new Vue({
|
||||
el: '#content'
|
||||
})
|
||||
</script>
|
||||
@endpush
|
Loading…
Reference in New Issue