Skip to content

Commit 7153cc2

Browse files
committed
Simplify each annotation page
1 parent dca3b1e commit 7153cc2

File tree

4 files changed

+59
-160
lines changed

4 files changed

+59
-160
lines changed

frontend/layouts/annotation.vue

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,36 @@
1818
/>
1919
</v-navigation-drawer>
2020

21-
<nuxt />
21+
<v-content>
22+
<v-container fluid>
23+
<v-row
24+
no-gutters
25+
class="d-none d-sm-flex"
26+
>
27+
<v-col v-if="currentDoc">
28+
<approve-button :approved="approved" />
29+
<filter-button />
30+
<guideline-button />
31+
</v-col>
32+
<v-spacer />
33+
<v-col>
34+
<paginator />
35+
</v-col>
36+
</v-row>
37+
<v-row justify="center">
38+
<v-col cols="12" md="9">
39+
<nuxt />
40+
</v-col>
41+
<v-col cols="12" md="3">
42+
<metadata-box
43+
v-if="currentDoc"
44+
:metadata="JSON.parse(currentDoc.meta)"
45+
/>
46+
</v-col>
47+
</v-row>
48+
</v-container>
49+
</v-content>
50+
2251
<bottom-navigator class="d-flex d-sm-none" />
2352
</v-app>
2453
</template>
@@ -28,12 +57,24 @@ import { mapActions, mapGetters } from 'vuex'
2857
import TheSideBar from '~/components/organisms/layout/TheSideBar'
2958
import TheHeader from '~/components/organisms/layout/TheHeader'
3059
import BottomNavigator from '@/components/containers/annotation/BottomNavigator'
60+
import Paginator from '~/components/containers/annotation/Paginator'
61+
import GuidelineButton from '@/components/containers/annotation/GuidelineButton'
62+
import MetadataBox from '@/components/organisms/annotation/MetadataBox'
63+
import FilterButton from '@/components/containers/annotation/FilterButton'
64+
import ApproveButton from '@/components/containers/annotation/ApproveButton'
3165
3266
export default {
67+
middleware: ['check-auth', 'auth'],
68+
3369
components: {
3470
TheSideBar,
3571
TheHeader,
36-
BottomNavigator
72+
BottomNavigator,
73+
Paginator,
74+
GuidelineButton,
75+
FilterButton,
76+
ApproveButton,
77+
MetadataBox
3778
},
3879
data() {
3980
return {
@@ -42,7 +83,8 @@ export default {
4283
},
4384
4485
computed: {
45-
...mapGetters('projects', ['getLink', 'getCurrentUserRole'])
86+
...mapGetters('projects', ['getLink', 'getCurrentUserRole']),
87+
...mapGetters('documents', ['currentDoc', 'approved'])
4688
},
4789
4890
created() {
@@ -51,6 +93,10 @@ export default {
5193
5294
methods: {
5395
...mapActions('projects', ['setCurrentProject'])
96+
},
97+
98+
validate({ params }) {
99+
return /^\d+$/.test(params.id)
54100
}
55101
}
56102
</script>
Lines changed: 6 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,19 @@
11
<template>
2-
<v-content>
3-
<v-container fluid>
4-
<v-row
5-
no-gutters
6-
class="d-none d-sm-flex"
7-
>
8-
<v-col v-if="currentDoc">
9-
<approve-button :approved="approved" />
10-
<filter-button />
11-
<guideline-button />
12-
</v-col>
13-
<v-spacer />
14-
<v-col>
15-
<paginator />
16-
</v-col>
17-
</v-row>
18-
<v-row justify="center">
19-
<v-col cols="12" md="9">
20-
<v-card>
21-
<v-card-text class="title">
22-
<entity-item-box />
23-
</v-card-text>
24-
</v-card>
25-
</v-col>
26-
<v-col cols="12" md="3">
27-
<metadata-box
28-
v-if="currentDoc"
29-
:metadata="JSON.parse(currentDoc.meta)"
30-
/>
31-
</v-col>
32-
</v-row>
33-
</v-container>
34-
</v-content>
2+
<v-card>
3+
<v-card-text class="title">
4+
<entity-item-box />
5+
</v-card-text>
6+
</v-card>
357
</template>
368

379
<script>
38-
import { mapGetters } from 'vuex'
3910
import EntityItemBox from '~/components/containers/annotation/EntityItemBox'
40-
import Paginator from '~/components/containers/annotation/Paginator'
41-
import ApproveButton from '@/components/containers/annotation/ApproveButton'
42-
import GuidelineButton from '@/components/containers/annotation/GuidelineButton'
43-
import FilterButton from '@/components/containers/annotation/FilterButton'
44-
import MetadataBox from '@/components/organisms/annotation/MetadataBox'
4511
4612
export default {
4713
layout: 'annotation',
4814
49-
middleware: ['check-auth', 'auth'],
50-
5115
components: {
52-
ApproveButton,
53-
EntityItemBox,
54-
FilterButton,
55-
Paginator,
56-
GuidelineButton,
57-
MetadataBox
58-
},
59-
60-
computed: {
61-
...mapGetters('documents', ['currentDoc', 'approved'])
62-
},
63-
64-
validate({ params }) {
65-
return /^\d+$/.test(params.id)
16+
EntityItemBox
6617
}
6718
}
6819
</script>
Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,15 @@
11
<template>
2-
<v-content>
3-
<v-container fluid>
4-
<v-row
5-
no-gutters
6-
class="d-none d-sm-flex"
7-
>
8-
<v-col v-if="currentDoc">
9-
<approve-button :approved="approved" />
10-
<filter-button />
11-
<guideline-button />
12-
</v-col>
13-
<v-spacer />
14-
<v-col>
15-
<paginator />
16-
</v-col>
17-
</v-row>
18-
<v-row justify="center">
19-
<v-col cols="12" md="9">
20-
<seq2seq-container />
21-
</v-col>
22-
<v-col cols="12" md="3">
23-
<metadata-box
24-
v-if="currentDoc"
25-
:metadata="JSON.parse(currentDoc.meta)"
26-
/>
27-
</v-col>
28-
</v-row>
29-
</v-container>
30-
</v-content>
2+
<seq2seq-container />
313
</template>
324

335
<script>
34-
import { mapGetters } from 'vuex'
356
import Seq2seqContainer from '~/components/containers/annotation/Seq2seqContainer'
36-
import Paginator from '~/components/containers/annotation/Paginator'
37-
import GuidelineButton from '@/components/containers/annotation/GuidelineButton'
38-
import MetadataBox from '@/components/organisms/annotation/MetadataBox'
39-
import FilterButton from '@/components/containers/annotation/FilterButton'
40-
import ApproveButton from '@/components/containers/annotation/ApproveButton'
417
428
export default {
439
layout: 'annotation',
4410
45-
middleware: ['check-auth', 'auth'],
46-
4711
components: {
48-
ApproveButton,
49-
FilterButton,
50-
Seq2seqContainer,
51-
Paginator,
52-
GuidelineButton,
53-
MetadataBox
54-
},
55-
56-
computed: {
57-
...mapGetters('documents', ['currentDoc', 'approved'])
58-
},
59-
60-
validate({ params }) {
61-
return /^\d+$/.test(params.id)
12+
Seq2seqContainer
6213
}
6314
}
6415
</script>
Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,15 @@
11
<template>
2-
<v-content>
3-
<v-container fluid>
4-
<v-row
5-
no-gutters
6-
class="d-none d-sm-flex"
7-
>
8-
<v-col v-if="currentDoc">
9-
<approve-button :approved="approved" />
10-
<filter-button />
11-
<guideline-button />
12-
</v-col>
13-
<v-spacer />
14-
<v-col>
15-
<paginator />
16-
</v-col>
17-
</v-row>
18-
<v-row justify="center">
19-
<v-col cols="12" md="9">
20-
<text-classification />
21-
</v-col>
22-
<v-col cols="12" md="3">
23-
<metadata-box
24-
v-if="currentDoc"
25-
:metadata="JSON.parse(currentDoc.meta)"
26-
/>
27-
</v-col>
28-
</v-row>
29-
</v-container>
30-
</v-content>
2+
<text-classification />
313
</template>
324

335
<script>
34-
import { mapGetters } from 'vuex'
356
import TextClassification from '~/components/containers/annotation/TextClassification'
36-
import Paginator from '~/components/containers/annotation/Paginator'
37-
import GuidelineButton from '@/components/containers/annotation/GuidelineButton'
38-
import MetadataBox from '@/components/organisms/annotation/MetadataBox'
39-
import FilterButton from '@/components/containers/annotation/FilterButton'
40-
import ApproveButton from '@/components/containers/annotation/ApproveButton'
417
428
export default {
439
layout: 'annotation',
4410
45-
middleware: ['check-auth', 'auth'],
46-
4711
components: {
48-
ApproveButton,
49-
FilterButton,
50-
TextClassification,
51-
Paginator,
52-
GuidelineButton,
53-
MetadataBox
54-
},
55-
56-
computed: {
57-
...mapGetters('documents', ['currentDoc', 'approved'])
58-
},
59-
60-
validate({ params }) {
61-
return /^\d+$/.test(params.id)
12+
TextClassification
6213
}
6314
}
6415
</script>

0 commit comments

Comments
 (0)