|
|
|
|
@ -1,86 +1,75 @@ |
|
|
|
|
<template> |
|
|
|
|
<div> |
|
|
|
|
<Toolbar |
|
|
|
|
:handle-delete="del" |
|
|
|
|
:handle-list="list" |
|
|
|
|
v-if="item && isAdmin" |
|
|
|
|
:handle-edit="editHandler" |
|
|
|
|
:handle-delete="del" |
|
|
|
|
> |
|
|
|
|
<template slot="left"> |
|
|
|
|
<v-toolbar-title v-if="item">{{ |
|
|
|
|
`${$options.servicePrefix} ${item['@id']}` |
|
|
|
|
}}</v-toolbar-title> |
|
|
|
|
</template> |
|
|
|
|
</Toolbar> |
|
|
|
|
<br /> |
|
|
|
|
<div v-if="item" class="table-course-show"> |
|
|
|
|
<v-simple-table> |
|
|
|
|
<template slot="default"> |
|
|
|
|
<thead> |
|
|
|
|
<tr> |
|
|
|
|
<th>Field</th> |
|
|
|
|
<th>Value</th> |
|
|
|
|
<th>Field</th> |
|
|
|
|
<th>Value</th> |
|
|
|
|
</tr> |
|
|
|
|
</thead> |
|
|
|
|
<tbody> |
|
|
|
|
<tr> |
|
|
|
|
<td><strong>{{ $t('title') }}</strong></td> |
|
|
|
|
<td> |
|
|
|
|
{{ item['title'] }} |
|
|
|
|
</td> |
|
|
|
|
|
|
|
|
|
<td><strong>{{ $t('code') }}</strong></td> |
|
|
|
|
<td> |
|
|
|
|
{{ item['code'] }} |
|
|
|
|
</td> |
|
|
|
|
</tr> |
|
|
|
|
|
|
|
|
|
<tr> |
|
|
|
|
<td><strong>{{ $t('courseLanguage') }}</strong></td> |
|
|
|
|
<td> |
|
|
|
|
{{ item['courseLanguage'] }} |
|
|
|
|
</td> |
|
|
|
|
|
|
|
|
|
<td><strong>{{ $t('category') }}</strong></td> |
|
|
|
|
<td> |
|
|
|
|
<div v-if="item['category']"> |
|
|
|
|
{{ item['category'].name }} |
|
|
|
|
</div> |
|
|
|
|
<div v-else> |
|
|
|
|
- |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
</td> |
|
|
|
|
</tr> |
|
|
|
|
|
|
|
|
|
<tr> |
|
|
|
|
<td><strong>{{ $t('visibility') }}</strong></td> |
|
|
|
|
<td> |
|
|
|
|
{{ $n(item['visibility']) }} </td> |
|
|
|
|
|
|
|
|
|
<td><strong>{{ $t('departmentName') }}</strong></td> |
|
|
|
|
<td> |
|
|
|
|
{{ item['departmentName'] }} |
|
|
|
|
</td> |
|
|
|
|
</tr> |
|
|
|
|
|
|
|
|
|
<tr> |
|
|
|
|
<td><strong>{{ $t('departmentUrl') }}</strong></td> |
|
|
|
|
<td> |
|
|
|
|
{{ item['departmentUrl'] }} |
|
|
|
|
</td> |
|
|
|
|
|
|
|
|
|
<td><strong>{{ $t('expirationDate') }}</strong></td> |
|
|
|
|
<td> |
|
|
|
|
{{ formatDateTime(item['expirationDate'], 'long') }} </td> |
|
|
|
|
</tr> |
|
|
|
|
<div v-if="item" class="flex flex-row"> |
|
|
|
|
<div class="w-1/2"> |
|
|
|
|
<p class="text-lg"> |
|
|
|
|
{{ item['title'] }} |
|
|
|
|
</p> |
|
|
|
|
<div class="flex justify-center"> |
|
|
|
|
<div class="w-4/5"> |
|
|
|
|
<div |
|
|
|
|
v-html="item['content']" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<span class="w-1/2"> |
|
|
|
|
<q-markup-table> |
|
|
|
|
<tbody> |
|
|
|
|
<tr> |
|
|
|
|
<td><strong>{{ $t('Author') }}</strong></td> |
|
|
|
|
<td> |
|
|
|
|
{{ item['creator']['username'] }} |
|
|
|
|
</td> |
|
|
|
|
<td></td> |
|
|
|
|
<td/> |
|
|
|
|
</tr> |
|
|
|
|
<tr> |
|
|
|
|
<td><strong>{{ $t('Locale') }}</strong></td> |
|
|
|
|
<td> |
|
|
|
|
{{ item['locale'] }} |
|
|
|
|
</td> |
|
|
|
|
</tr> |
|
|
|
|
<tr> |
|
|
|
|
<td><strong>{{ $t('Enabled') }}</strong></td> |
|
|
|
|
<td> |
|
|
|
|
{{ item['enabled'] }} |
|
|
|
|
</td> |
|
|
|
|
</tr> |
|
|
|
|
<tr> |
|
|
|
|
<td><strong>{{ $t('Category') }}</strong></td> |
|
|
|
|
<td> |
|
|
|
|
{{ item['category']['title'] }} |
|
|
|
|
</td> |
|
|
|
|
</tr> |
|
|
|
|
<tr> |
|
|
|
|
<td><strong>{{ $t('Created at') }}</strong></td> |
|
|
|
|
<td> |
|
|
|
|
{{ item['createdAt'] ? $luxonDateTime.fromISO(item['createdAt']).toRelative() : '' }} |
|
|
|
|
</td> |
|
|
|
|
<td/> |
|
|
|
|
</tr> |
|
|
|
|
<tr> |
|
|
|
|
<td><strong>{{ $t('Updated at') }}</strong></td> |
|
|
|
|
<td> |
|
|
|
|
{{ item['updatedAt'] ? $luxonDateTime.fromISO(item['updatedAt']).toRelative() : '' }} |
|
|
|
|
</td> |
|
|
|
|
<td/> |
|
|
|
|
</tr> |
|
|
|
|
</tbody> |
|
|
|
|
</template> |
|
|
|
|
</v-simple-table> |
|
|
|
|
</q-markup-table> |
|
|
|
|
</span> |
|
|
|
|
</div> |
|
|
|
|
<Loading :visible="isLoading" /> |
|
|
|
|
|
|
|
|
|
<Loading :visible="isLoading" /> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
@ -90,29 +79,33 @@ import { mapFields } from 'vuex-map-fields'; |
|
|
|
|
import Loading from '../../components/Loading.vue'; |
|
|
|
|
import ShowMixin from '../../mixins/ShowMixin'; |
|
|
|
|
import Toolbar from '../../components/Toolbar.vue'; |
|
|
|
|
|
|
|
|
|
const servicePrefix = 'Course'; |
|
|
|
|
const servicePrefix = 'Page'; |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
name: 'CourseShow', |
|
|
|
|
servicePrefix, |
|
|
|
|
name: 'PageShow', |
|
|
|
|
components: { |
|
|
|
|
Loading, |
|
|
|
|
Toolbar |
|
|
|
|
Loading, |
|
|
|
|
Toolbar, |
|
|
|
|
}, |
|
|
|
|
mixins: [ShowMixin], |
|
|
|
|
computed: { |
|
|
|
|
...mapFields('course', { |
|
|
|
|
...mapFields('page', { |
|
|
|
|
isLoading: 'isLoading' |
|
|
|
|
}), |
|
|
|
|
...mapGetters('course', ['find']) |
|
|
|
|
...mapGetters('page', ['find']), |
|
|
|
|
...mapGetters({ |
|
|
|
|
'isAuthenticated': 'security/isAuthenticated', |
|
|
|
|
'isAdmin': 'security/isAdmin', |
|
|
|
|
'isCurrentTeacher': 'security/isCurrentTeacher', |
|
|
|
|
}), |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
...mapActions('course', { |
|
|
|
|
...mapActions('page', { |
|
|
|
|
deleteItem: 'del', |
|
|
|
|
reset: 'resetShow', |
|
|
|
|
retrieve: 'load' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
retrieve: 'loadWithQuery' |
|
|
|
|
}), |
|
|
|
|
}, |
|
|
|
|
servicePrefix |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|