|
1 | 1 | <template>
|
2 |
| - <v-card class="ContentCard elevation-4"> |
3 |
| - <v-card-actions class="ContentCard-Actions"> |
4 |
| - <subject-tag |
5 |
| - v-for="(item, idx) in subjects" |
6 |
| - :key="idx" |
7 |
| - class="ContentCard-SubjectTag" |
8 |
| - :name="item.name || '教科名'" |
9 |
| - :icon="item.icon || ''" |
10 |
| - :icon-color="item.iconColor || 'white'" |
11 |
| - :background-color="item.backgroundColor || '#A5D8FF'" |
| 2 | + <div class="ContentCard-Outer"> |
| 3 | + <v-card class="ContentCard elevation-4"> |
| 4 | + <v-card-actions class="ContentCard-Actions"> |
| 5 | + <subject-tag |
| 6 | + class="ContentCard-SubjectTag" |
| 7 | + :name="lesson.subject.name || '教科名'" |
| 8 | + icon-color="white" |
| 9 | + :background-color="lesson.subject.color || '#A5D8FF'" |
| 10 | + /> |
| 11 | + <subject-tag |
| 12 | + v-if="lesson.videos.length > 0" |
| 13 | + class="ContentCard-SubjectTag" |
| 14 | + :name="'動画'" |
| 15 | + :icon="'mdi-video'" |
| 16 | + :icon-color="'#424242'" |
| 17 | + :background-color="'#E0E0E0'" |
| 18 | + /> |
| 19 | + </v-card-actions> |
| 20 | + <v-card-title> |
| 21 | + <h2 class="ContentCard-Title">{{ lesson.title }}</h2> |
| 22 | + </v-card-title> |
| 23 | + <v-card-text> |
| 24 | + <p class="ContentCard-Description">{{ lesson.description }}</p> |
| 25 | + </v-card-text> |
| 26 | + </v-card> |
| 27 | + <div v-if="editable" class="ContentCard-Button-Outer"> |
| 28 | + <content-card-editor-button |
| 29 | + class="ContentCard-Button" |
| 30 | + icon-name="mdi-eye-off" |
| 31 | + @click="$emit('toggleHidden')" |
12 | 32 | />
|
13 |
| - <subject-tag |
14 |
| - class="ContentCard-SubjectTag" |
15 |
| - :name="'動画'" |
16 |
| - :icon="'mdi-video'" |
17 |
| - :icon-color="'#424242'" |
18 |
| - :background-color="'#E0E0E0'" |
| 33 | + <content-card-editor-button |
| 34 | + class="ContentCard-Button" |
| 35 | + icon-name="mdi-pencil" |
| 36 | + @click="$emit('clickEditButton')" |
19 | 37 | />
|
20 |
| - </v-card-actions> |
21 |
| - <v-card-title> |
22 |
| - <h2 class="ContentCard-Title">{{ title }}</h2> |
23 |
| - </v-card-title> |
24 |
| - <v-card-text> |
25 |
| - <p class="ContentCard-Description">{{ description }}</p> |
26 |
| - </v-card-text> |
27 |
| - </v-card> |
| 38 | + <!-- |
| 39 | + <content-card-editor-button |
| 40 | + class="ContentCard-Button" |
| 41 | + icon-name="mdi-file-multiple" |
| 42 | + /> |
| 43 | + --> |
| 44 | + </div> |
| 45 | + </div> |
28 | 46 | </template>
|
29 | 47 |
|
30 | 48 | <script lang="ts">
|
31 | 49 | import Vue from 'vue'
|
32 | 50 | import SubjectTag from '@/components/SubjectTag.vue'
|
| 51 | +import ContentCardEditorButton from '@/components/ContentCardEditorButton.vue' |
| 52 | +import { classData } from '~/types/store/classData' |
33 | 53 |
|
34 | 54 | export default Vue.extend({
|
35 |
| - components: { SubjectTag }, |
| 55 | + components: { |
| 56 | + SubjectTag, |
| 57 | + ContentCardEditorButton |
| 58 | + }, |
36 | 59 | props: {
|
37 |
| - subjects: { |
38 |
| - type: Array, |
39 |
| - default: () => [] |
40 |
| - }, |
41 |
| - title: { |
42 |
| - type: String, |
43 |
| - default: '' |
| 60 | + lesson: { |
| 61 | + type: Object as () => classData.Lesson, |
| 62 | + required: true |
44 | 63 | },
|
45 |
| - description: { |
46 |
| - type: String, |
47 |
| - default: '' |
| 64 | + editable: { |
| 65 | + type: Boolean, |
| 66 | + default: false |
48 | 67 | }
|
49 | 68 | }
|
50 | 69 | })
|
51 | 70 | </script>
|
52 | 71 |
|
53 | 72 | <style scoped lang="scss">
|
| 73 | +.ContentCard-Outer { |
| 74 | + display: flex; |
| 75 | +} |
| 76 | +.ContentCard-Button-Outer { |
| 77 | + display: flex; |
| 78 | + flex-direction: column; |
| 79 | + flex: 0 1 auto; |
| 80 | + margin-left: 12px; |
| 81 | + .ContentCard-Button { |
| 82 | + margin-bottom: 12px; |
| 83 | + } |
| 84 | +} |
54 | 85 | .ContentCard {
|
| 86 | + flex: 1 1 auto; |
55 | 87 | color: $color-gray;
|
56 | 88 | border-radius: 14px !important;
|
57 | 89 | .ContentCard-Actions {
|
|
0 commit comments