Browse Source

Use base card component for guideline card

pull/341/head
Hironsan 5 years ago
parent
commit
33ca1fdcdd
2 changed files with 38 additions and 21 deletions
  1. 30
      frontend/components/containers/annotation/GuidelineButton.vue
  2. 29
      frontend/components/organisms/annotation/GuidelineCard.vue

30
frontend/components/containers/annotation/GuidelineButton.vue

@ -1,27 +1,39 @@
<template>
<base-modal
text="Show guideline"
>
<template v-if="currentProject" v-slot="slotProps">
<div>
<v-btn
class="text-capitalize"
outlined
@click="dialog=true"
>
Show guideline
</v-btn>
<base-dialog :dialog="dialog">
<guideline-card
v-if="currentProject"
:guideline-text="currentProject.guideline"
@close="slotProps.close"
@close="dialog=false"
/>
</template>
</base-modal>
</base-dialog>
</div>
</template>
<script>
import { mapActions, mapGetters } from 'vuex'
import BaseModal from '@/components/molecules/BaseModal'
import BaseDialog from '@/components/molecules/BaseDialog'
import GuidelineCard from '@/components/organisms/annotation/GuidelineCard'
export default {
components: {
BaseModal,
BaseDialog,
GuidelineCard
},
data() {
return {
dialog: false
}
},
computed: {
...mapGetters('projects', ['currentProject'])
},

29
frontend/components/organisms/annotation/GuidelineCard.vue

@ -1,28 +1,27 @@
<template>
<v-card>
<v-card-title
class="headline grey lighten-2"
primary-title
>
Annotation Guideline
</v-card-title>
<v-card-text>
<base-card
title="Annotation Guideline"
cancel-text="Close"
@cancel="close"
>
<template #content>
<viewer
:value="guidelineText"
/>
</v-card-text>
</v-card>
</template>
</base-card>
</template>
<script>
import 'tui-editor/dist/tui-editor-contents.css'
import 'highlight.js/styles/github.css'
import { Viewer } from '@toast-ui/vue-editor'
import BaseCard from '@/components/molecules/BaseCard'
export default {
components: {
Viewer
Viewer,
BaseCard
},
props: {
@ -31,6 +30,12 @@ export default {
default: '',
required: true
}
},
methods: {
close() {
this.$emit('close')
}
}
}
</script>
Loading…
Cancel
Save