Loading src/components/JamaCollection.vue +0 −2 Original line number Diff line number Diff line Loading @@ -123,8 +123,6 @@ @tag-added="tagAdded" /> <!-- <JamaMetadataEditor :item="collection"/>--> <component :is="getMetadataComponent" :item="collection" Loading src/components/JamaCollectionTile.vue +12 −38 Original line number Diff line number Diff line Loading @@ -33,42 +33,6 @@ </v-hover> </template> <!--<template>--> <!-- <v-hover>--> <!-- <template v-slot:default="{ hover }">--> <!-- <v-card :id="collection.title" draggable height="200"--> <!-- :title="collection.title"--> <!-- class="clickable d-flex flex-column justify-space-between collection-tile"--> <!-- :data-metas="metaAttrValues"--> <!-- :elevation="hover ? 24 : 1"--> <!-- @dragstart="dragStarted($event)"--> <!-- @click="select()"--> <!-- @dragover.prevent--> <!-- @drop.prevent="dropped($event)">--> <!-- <v-icon color="amber lighten-1">mdi-folder</v-icon>--> <!-- <div v-if="collection.represented_by" class="collection-avatar">--> <!-- <v-avatar--> <!-- size="72"--> <!-- class="profile"--> <!-- tile--> <!-- >--> <!-- <img--> <!-- alt="Avatar"--> <!-- :src="collection.represented_by.urls.m"--> <!-- >--> <!-- </v-avatar>--> <!-- </div>--> <!-- <v-card-title class="grey--text body-2">--> <!-- {{ label }}--> <!-- </v-card-title>--> <!-- </v-card>--> <!-- </template>--> <!-- </v-hover>--> <!--</template>--> <script> export default { Loading Loading @@ -106,15 +70,25 @@ export default { try { let source = JSON.parse(evt.dataTransfer.getData("text/html")) if (source) { if(source.type === 'collection') { this.$emit('move-collection', source, this.collection); } else{ this.$emit('move-resource', source, this.collection); } } } catch (e) { console.error(e); } return false; }, dragStarted(evt) { evt.dataTransfer.setData('text/html', JSON.stringify({id: this.collection.id, title: this.collection.title})); evt.dataTransfer.setData('text/html', JSON.stringify({ type: 'collection', id: this.collection.id, title: this.collection.title })); } } } Loading src/components/JamaItemsMosaic.vue +30 −3 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ :collection="collection" @collection-selected="collectionSelected" @move-collection="moveCollection" @move-resource="moveResource" /> </v-col> Loading Loading @@ -91,8 +92,8 @@ export default { }, props: { currentCollection: {type : Object, default : null}, currentResource: {type :Object, default : null}, // currentCollection: {type : Object, default : null}, // currentResource: {type :Object, default : null}, dnd: { //drag and drop allowed type: Boolean, default: false Loading Loading @@ -124,7 +125,14 @@ export default { const {xl, lg, sm, xs} = this.$vuetify.breakpoint; return xl ? 2 : lg ? 3 : sm ? 6 : xs ? 12 : 4 }, ...mapGetters(["isPickerMode", "sortOptions", "collections", "resources","selectedCollections","selectedResources"]) ...mapGetters([ "isPickerMode", "sortOptions", "collections", "resources", "selectedCollections", "selectedResources", "currentCollection"]) }, methods: { Loading @@ -145,6 +153,19 @@ export default { ) }, moveResource(resource, target) { this.$jamaConfirm( this.$t('resource.move', [resource.title, target.title]), (res) => { if (res) { this.$jamaClient.moveItems(this.currentCollection.id, target.id, [], [resource.id]).then(() => { this.$emit('resource-moved', resource, target) }) } } ) }, aboutResource(resource) { this.$emit('about-selected', resource) }, Loading Loading @@ -205,11 +226,17 @@ export default { "en": { "collection": { "move": "Move collection \"{0}\" to \"{1}\" ?" }, "resource": { "move": "Move resource \"{0}\" to \"{1}\" ?" } }, "fr": { "collection": { "move": "Souhaitez-vous déplacer le dossier \"{0}\" vers \"{1}\" ?" }, "resource": { "move": "Souhaitez-vous déplacer la ressource \"{0}\" vers \"{1}\" ?" } } } Loading src/components/JamaResourceTile.vue +8 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ :elevation="active || hover ? 24 : 1" :title="resource.title" :data-metas="metaAttrValues" @dragstart="dragStarted($event)" @click="select()" > <v-img Loading Loading @@ -119,6 +120,13 @@ export default { return 'mdi-file' } }, dragStarted(evt) { evt.dataTransfer.setData('text/html', JSON.stringify({ id: this.resource.id, title: this.resource.title, type: 'resource'})); } Loading src/components/VueJama.vue +38 −13 Original line number Diff line number Diff line Loading @@ -192,6 +192,7 @@ @collection-selected="collectionSelected" @resource-selected="resourceSelected" @collection-moved="reloadCurrentCollection" @resource-moved="reloadCurrentCollection" @sort-options-changed="reloadCurrentCollection" @resource-dropped="resourceDropped" /> Loading Loading @@ -600,6 +601,29 @@ export default { Vue.prototype.$jamaAlert = this.jamaAlert Vue.prototype.$jamaPrompt = this.jamaPrompt Vue.prototype.$jamaConfirm = this.jamaConfirm document.addEventListener('keydown', (e) => { if (!this.currentResource) return; let offset = null; switch (e.key) { case "ArrowLeft": offset = -1; break; case "ArrowRight": offset = 1 break; default : return; } if(offset){ let target = this.resources[this.currentResourceIndex + offset]; if (target) document.querySelector('#jama-resource-tile-' + target.id).click(); } }) }, methods: { Loading Loading @@ -842,6 +866,7 @@ export default { <style lang="scss" scoped> @import '../assets/css/_variables.scss'; h1 > a { vertical-align: top; } Loading Loading
src/components/JamaCollection.vue +0 −2 Original line number Diff line number Diff line Loading @@ -123,8 +123,6 @@ @tag-added="tagAdded" /> <!-- <JamaMetadataEditor :item="collection"/>--> <component :is="getMetadataComponent" :item="collection" Loading
src/components/JamaCollectionTile.vue +12 −38 Original line number Diff line number Diff line Loading @@ -33,42 +33,6 @@ </v-hover> </template> <!--<template>--> <!-- <v-hover>--> <!-- <template v-slot:default="{ hover }">--> <!-- <v-card :id="collection.title" draggable height="200"--> <!-- :title="collection.title"--> <!-- class="clickable d-flex flex-column justify-space-between collection-tile"--> <!-- :data-metas="metaAttrValues"--> <!-- :elevation="hover ? 24 : 1"--> <!-- @dragstart="dragStarted($event)"--> <!-- @click="select()"--> <!-- @dragover.prevent--> <!-- @drop.prevent="dropped($event)">--> <!-- <v-icon color="amber lighten-1">mdi-folder</v-icon>--> <!-- <div v-if="collection.represented_by" class="collection-avatar">--> <!-- <v-avatar--> <!-- size="72"--> <!-- class="profile"--> <!-- tile--> <!-- >--> <!-- <img--> <!-- alt="Avatar"--> <!-- :src="collection.represented_by.urls.m"--> <!-- >--> <!-- </v-avatar>--> <!-- </div>--> <!-- <v-card-title class="grey--text body-2">--> <!-- {{ label }}--> <!-- </v-card-title>--> <!-- </v-card>--> <!-- </template>--> <!-- </v-hover>--> <!--</template>--> <script> export default { Loading Loading @@ -106,15 +70,25 @@ export default { try { let source = JSON.parse(evt.dataTransfer.getData("text/html")) if (source) { if(source.type === 'collection') { this.$emit('move-collection', source, this.collection); } else{ this.$emit('move-resource', source, this.collection); } } } catch (e) { console.error(e); } return false; }, dragStarted(evt) { evt.dataTransfer.setData('text/html', JSON.stringify({id: this.collection.id, title: this.collection.title})); evt.dataTransfer.setData('text/html', JSON.stringify({ type: 'collection', id: this.collection.id, title: this.collection.title })); } } } Loading
src/components/JamaItemsMosaic.vue +30 −3 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ :collection="collection" @collection-selected="collectionSelected" @move-collection="moveCollection" @move-resource="moveResource" /> </v-col> Loading Loading @@ -91,8 +92,8 @@ export default { }, props: { currentCollection: {type : Object, default : null}, currentResource: {type :Object, default : null}, // currentCollection: {type : Object, default : null}, // currentResource: {type :Object, default : null}, dnd: { //drag and drop allowed type: Boolean, default: false Loading Loading @@ -124,7 +125,14 @@ export default { const {xl, lg, sm, xs} = this.$vuetify.breakpoint; return xl ? 2 : lg ? 3 : sm ? 6 : xs ? 12 : 4 }, ...mapGetters(["isPickerMode", "sortOptions", "collections", "resources","selectedCollections","selectedResources"]) ...mapGetters([ "isPickerMode", "sortOptions", "collections", "resources", "selectedCollections", "selectedResources", "currentCollection"]) }, methods: { Loading @@ -145,6 +153,19 @@ export default { ) }, moveResource(resource, target) { this.$jamaConfirm( this.$t('resource.move', [resource.title, target.title]), (res) => { if (res) { this.$jamaClient.moveItems(this.currentCollection.id, target.id, [], [resource.id]).then(() => { this.$emit('resource-moved', resource, target) }) } } ) }, aboutResource(resource) { this.$emit('about-selected', resource) }, Loading Loading @@ -205,11 +226,17 @@ export default { "en": { "collection": { "move": "Move collection \"{0}\" to \"{1}\" ?" }, "resource": { "move": "Move resource \"{0}\" to \"{1}\" ?" } }, "fr": { "collection": { "move": "Souhaitez-vous déplacer le dossier \"{0}\" vers \"{1}\" ?" }, "resource": { "move": "Souhaitez-vous déplacer la ressource \"{0}\" vers \"{1}\" ?" } } } Loading
src/components/JamaResourceTile.vue +8 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ :elevation="active || hover ? 24 : 1" :title="resource.title" :data-metas="metaAttrValues" @dragstart="dragStarted($event)" @click="select()" > <v-img Loading Loading @@ -119,6 +120,13 @@ export default { return 'mdi-file' } }, dragStarted(evt) { evt.dataTransfer.setData('text/html', JSON.stringify({ id: this.resource.id, title: this.resource.title, type: 'resource'})); } Loading
src/components/VueJama.vue +38 −13 Original line number Diff line number Diff line Loading @@ -192,6 +192,7 @@ @collection-selected="collectionSelected" @resource-selected="resourceSelected" @collection-moved="reloadCurrentCollection" @resource-moved="reloadCurrentCollection" @sort-options-changed="reloadCurrentCollection" @resource-dropped="resourceDropped" /> Loading Loading @@ -600,6 +601,29 @@ export default { Vue.prototype.$jamaAlert = this.jamaAlert Vue.prototype.$jamaPrompt = this.jamaPrompt Vue.prototype.$jamaConfirm = this.jamaConfirm document.addEventListener('keydown', (e) => { if (!this.currentResource) return; let offset = null; switch (e.key) { case "ArrowLeft": offset = -1; break; case "ArrowRight": offset = 1 break; default : return; } if(offset){ let target = this.resources[this.currentResourceIndex + offset]; if (target) document.querySelector('#jama-resource-tile-' + target.id).click(); } }) }, methods: { Loading Loading @@ -842,6 +866,7 @@ export default { <style lang="scss" scoped> @import '../assets/css/_variables.scss'; h1 > a { vertical-align: top; } Loading