|
@@ -1,10 +1,10 @@
|
|
<template>
|
|
<template>
|
|
<div class="project-labels-window">
|
|
<div class="project-labels-window">
|
|
<div class="label" v-for="label in labels" :key="label.id">
|
|
<div class="label" v-for="label in labels" :key="label.id">
|
|
- <h2>
|
|
|
|
- <img alt="delete" src="@/assets/icons/x-circle.svg" @click="removeLabel(label.id)">
|
|
|
|
- {{ label.name }}
|
|
|
|
- </h2>
|
|
|
|
|
|
+ <editable-headline :value="label.name"
|
|
|
|
+ @change="editLabel(label.id, $event)"
|
|
|
|
+ @remove="removeLabel(label.id)">{{ label.name }}
|
|
|
|
+ </editable-headline>
|
|
|
|
|
|
<media-selector v-if="labeledImages[label.id].length > 0"
|
|
<media-selector v-if="labeledImages[label.id].length > 0"
|
|
:project-id="currentProject.id"
|
|
:project-id="currentProject.id"
|
|
@@ -29,10 +29,11 @@
|
|
<script>
|
|
<script>
|
|
import TextInput from "@/components/base/text-input";
|
|
import TextInput from "@/components/base/text-input";
|
|
import MediaSelector from "@/components/media/media-selector";
|
|
import MediaSelector from "@/components/media/media-selector";
|
|
|
|
+import EditableHeadline from "@/components/base/editable-headline";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "project-labels-window",
|
|
name: "project-labels-window",
|
|
- components: {MediaSelector, TextInput},
|
|
|
|
|
|
+ components: {EditableHeadline, MediaSelector, TextInput},
|
|
props: ['currentProject', 'socket'],
|
|
props: ['currentProject', 'socket'],
|
|
data: function () {
|
|
data: function () {
|
|
return {
|
|
return {
|
|
@@ -72,6 +73,9 @@ export default {
|
|
this.socket.post('/projects/' + this.currentProject.id + '/labels', {name: value});
|
|
this.socket.post('/projects/' + this.currentProject.id + '/labels', {name: value});
|
|
this.createLabelValue = '';
|
|
this.createLabelValue = '';
|
|
},
|
|
},
|
|
|
|
+ editLabel: function (id, value) {
|
|
|
|
+ this.socket.post('/projects/' + this.currentProject.id + '/labels/' + id, {name: value});
|
|
|
|
+ },
|
|
removeLabel: function (id) {
|
|
removeLabel: function (id) {
|
|
this.socket.post('/projects/' + this.currentProject.id + '/labels/' + id, {delete: true});
|
|
this.socket.post('/projects/' + this.currentProject.id + '/labels/' + id, {delete: true});
|
|
}
|
|
}
|
|
@@ -88,17 +92,6 @@ export default {
|
|
margin-bottom: 1rem;
|
|
margin-bottom: 1rem;
|
|
}
|
|
}
|
|
|
|
|
|
-h2 {
|
|
|
|
- display: flex;
|
|
|
|
- align-items: center;
|
|
|
|
- margin: 0;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-img {
|
|
|
|
- width: 1.5rem;
|
|
|
|
- margin-right: 0.75rem;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/deep/ .element {
|
|
/deep/ .element {
|
|
border: none;
|
|
border: none;
|
|
}
|
|
}
|