|
@@ -2,12 +2,12 @@
|
|
|
<div class="paginated-media">
|
|
|
<div class="media" ref="media">
|
|
|
<div v-for="image in images"
|
|
|
- v-bind:key="image.identifier"
|
|
|
+ v-bind:key="image.id"
|
|
|
class="image"
|
|
|
@click="$emit('click', image)">
|
|
|
<img :alt="image.name" :src="image.src">
|
|
|
|
|
|
- <div v-if="current && current.identifier === image.identifier"
|
|
|
+ <div v-if="current && current.id === image.id"
|
|
|
class="active"/>
|
|
|
|
|
|
<div v-if="deletable"
|
|
@@ -84,7 +84,7 @@ export default {
|
|
|
}, 500);
|
|
|
},
|
|
|
change: function (file) {
|
|
|
- if (file.project_id === this.$root.project.identifier)
|
|
|
+ if (file.project_id === this.$root.project.id)
|
|
|
this.get();
|
|
|
},
|
|
|
edit: function (file) {
|
|
@@ -98,10 +98,10 @@ export default {
|
|
|
// edited file is in the current image list
|
|
|
if (this.filter !== false) {
|
|
|
for (let image of this.images) {
|
|
|
- if (image.identifier === file.identifier) {
|
|
|
+ if (image.id === file.id) {
|
|
|
this.get(() => {
|
|
|
// click the first image if the current shown was removed
|
|
|
- if (this.current.identifier === file.identifier) {
|
|
|
+ if (this.current.id === file.id) {
|
|
|
this.$emit('click', this.images[0]);
|
|
|
}
|
|
|
});
|
|
@@ -111,7 +111,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
deleteElement: function (element) {
|
|
|
- this.$root.socket.post(`/data/${element.identifier}/remove`, {remove: true});
|
|
|
+ this.$root.socket.post(`/data/${element.id}/remove`, {remove: true});
|
|
|
},
|
|
|
prevPage: function (callback) {
|
|
|
if (this.page > 1)
|
|
@@ -160,11 +160,11 @@ export default {
|
|
|
|
|
|
let url;
|
|
|
if (this.filter === undefined || this.filter === false)
|
|
|
- url = `/projects/${this.$root.project.identifier}/data/${offset}/${limit}`;
|
|
|
+ url = `/projects/${this.$root.project.id}/data/${offset}/${limit}`;
|
|
|
else if (this.filter === null)
|
|
|
- url = `/projects/${this.$root.project.identifier}/data/0/${offset}/${limit}`;
|
|
|
+ url = `/projects/${this.$root.project.id}/data/0/${offset}/${limit}`;
|
|
|
else
|
|
|
- url = `/projects/${this.$root.project.identifier}/data/${this.filter}/${offset}/${limit}`;
|
|
|
+ url = `/projects/${this.$root.project.id}/data/${this.filter}/${offset}/${limit}`;
|
|
|
|
|
|
// call endpoint
|
|
|
this.$root.socket.get(url)
|
|
@@ -201,9 +201,9 @@ export default {
|
|
|
if (this.images.length === 0)
|
|
|
return;
|
|
|
|
|
|
- if (this.current.identifier < this.images[0].identifier)
|
|
|
+ if (this.current.id < this.images[0].id)
|
|
|
this.prevPage(this.findCurrent);
|
|
|
- else if (this.current.identifier > this.images[this.images.length - 1].identifier)
|
|
|
+ else if (this.current.id > this.images[this.images.length - 1].id)
|
|
|
this.nextPage(this.findCurrent);
|
|
|
}
|
|
|
},
|
|
@@ -221,7 +221,7 @@ export default {
|
|
|
this.findCurrent();
|
|
|
|
|
|
// receive previous and next element
|
|
|
- this.$root.socket.get(`/data/${this.current.identifier}/previous_next`)
|
|
|
+ this.$root.socket.get(`/data/${this.current.id}/previous_next`)
|
|
|
.then(response => response.json())
|
|
|
.then(data => {
|
|
|
if (this.filter === undefined || this.filter === false) {
|