diff options
Diffstat (limited to 'src/site/pages')
| -rw-r--r-- | src/site/pages/dashboard/index.vue | 55 |
1 files changed, 1 insertions, 54 deletions
diff --git a/src/site/pages/dashboard/index.vue b/src/site/pages/dashboard/index.vue index 84b0c45..b58e567 100644 --- a/src/site/pages/dashboard/index.vue +++ b/src/site/pages/dashboard/index.vue @@ -17,29 +17,6 @@ </div> </div> </div> - - <b-modal :active.sync="isAlbumsModalActive" - :width="640" - scroll="keep"> - <div class="card albumsModal"> - <div class="card-content"> - <div class="content"> - <h3 class="subtitle">Select the albums this file should be a part of</h3> - <hr> - <div class="columns is-multiline"> - <div v-for="(album, index) in albums" - :key="index" - class="column is-3"> - <div class="field"> - <b-checkbox :value="isAlbumSelected(album.id)" - @input="albumCheckboxClicked($event, album.id)">{{ album.name }}</b-checkbox> - </div> - </div> - </div> - </div> - </div> - </div> - </b-modal> </section> </template> @@ -55,10 +32,7 @@ export default { middleware: 'auth', data() { return { - files: [], - albums: [], - isAlbumsModalActive: false, - showingModalForFile: null + files: [] }; }, metaInfo() { @@ -66,39 +40,12 @@ export default { }, mounted() { this.getFiles(); - this.getAlbums(); }, methods: { - isAlbumSelected(id) { - if (!this.showingModalForFile) return; - const found = this.showingModalForFile.albums.find(el => el.id === id); - return found ? found.id ? true : false : false; - }, - openAlbumModal(file) { - this.showingModalForFile = file; - this.isAlbumsModalActive = true; - }, - async albumCheckboxClicked(value, id) { - const response = await this.$axios.$post(`file/album/${value ? 'add' : 'del'}`, { - albumId: id, - fileId: this.showingModalForFile.id - }); - this.$buefy.toast.open(response.message); - - // Not the prettiest solution to refetch on each click but it'll do for now - this.getFiles(); - }, async getFiles() { const response = await this.$axios.$get(`files`); this.files = response.files; - }, - async getAlbums() { - const response = await this.$axios.$get(`albums/dropdown`); - this.albums = response.albums; } } }; </script> -<style lang="scss" scoped> - .albumsModal .columns .column { padding: .25rem; } -</style> |