8 changed files with 313 additions and 34 deletions
@ -0,0 +1,60 @@
@@ -0,0 +1,60 @@
|
||||
<template> |
||||
<v-list-item class="px-2"> |
||||
<v-list-item-avatar> |
||||
<v-img |
||||
:src="contributor.researcher.avatar || require('~/assets/avatar.png')" |
||||
></v-img> |
||||
</v-list-item-avatar> |
||||
<v-list-item-content> |
||||
<v-list-item-title class="text-h6"> |
||||
{{ contributor.researcher.display_name }} |
||||
</v-list-item-title> |
||||
<v-list-item-subtitle>{{ |
||||
contributor.researcher.email_address |
||||
}}</v-list-item-subtitle> |
||||
|
||||
<v-list-item-subtitle |
||||
>{{ $t('study.faculty') }}: |
||||
|
||||
<span v-if="contributor.researcher.faculty"> |
||||
{{ contributor.researcher.faculty.name }} |
||||
</span> |
||||
<span v-else> |
||||
{{ $t('contributors.table.no_faculty') }} |
||||
</span> |
||||
</v-list-item-subtitle> |
||||
|
||||
<v-list-item-subtitle> |
||||
{{ $t('contributor.role') }}: {{ contributor.role |
||||
}}<span v-if="contributor.isOwner" |
||||
>, {{ $t('contributor.role.owner') }}</span |
||||
> |
||||
</v-list-item-subtitle> |
||||
</v-list-item-content> |
||||
</v-list-item> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
props: { |
||||
studyId: { |
||||
type: [String, Number], |
||||
default: '', |
||||
}, |
||||
contributor: { |
||||
type: Object, |
||||
default: () => ({ |
||||
id: '', |
||||
researcher: { |
||||
id: '', |
||||
first_name: '', |
||||
last_name: '', |
||||
email_address: '', |
||||
faculty: '', |
||||
}, |
||||
role: '', |
||||
}), |
||||
}, |
||||
}, |
||||
} |
||||
</script> |
@ -0,0 +1,29 @@
@@ -0,0 +1,29 @@
|
||||
<template> |
||||
<v-btn @click="goToEditContributor"> |
||||
{{ $t('contributors.editButton.button') }} |
||||
</v-btn> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
props: { |
||||
studyId: { |
||||
type: [Number, String], |
||||
default: 0, |
||||
}, |
||||
contributorId: { |
||||
type: [Number, String], |
||||
default: 0, |
||||
}, |
||||
}, |
||||
methods: { |
||||
goToEditContributor() { |
||||
this.$router.push( |
||||
this.localePath( |
||||
`/researchStudies/${this.studyId}/contributors/${this.contributorId}/edit` |
||||
) |
||||
) |
||||
}, |
||||
}, |
||||
} |
||||
</script> |
@ -0,0 +1,150 @@
@@ -0,0 +1,150 @@
|
||||
<template> |
||||
<v-card> |
||||
<ui-rug-card-title> |
||||
{{ $t('page.studies.study.contributors.contributor.detail.title') }} |
||||
{{ contributor.researcher.display_name }} |
||||
</ui-rug-card-title> |
||||
|
||||
<v-card-text class="d-flex flex-row mb-6"> |
||||
<table> |
||||
<tr> |
||||
<th></th> |
||||
<th></th> |
||||
<th></th> |
||||
</tr> |
||||
|
||||
<tr> |
||||
<td> |
||||
{{ |
||||
$t( |
||||
'page.studies.study.contributors.contributor.detail.study_name' |
||||
) |
||||
}} |
||||
</td> |
||||
<td>{{ study.name }}</td> |
||||
<td rowspan="7"> |
||||
<v-avatar size="200"> |
||||
<v-img |
||||
:src=" |
||||
contributor.researcher.avatar || |
||||
require('~/assets/avatar.png') |
||||
" |
||||
></v-img> |
||||
</v-avatar> |
||||
</td> |
||||
</tr> |
||||
|
||||
<tr> |
||||
<td> |
||||
{{ |
||||
$t( |
||||
'page.studies.study.contributors.contributor.detail.first_name' |
||||
) |
||||
}} |
||||
</td> |
||||
<td>{{ contributor.researcher.first_name }}</td> |
||||
</tr> |
||||
|
||||
<tr> |
||||
<td> |
||||
{{ |
||||
$t('page.studies.study.contributors.contributor.detail.last_name') |
||||
}} |
||||
</td> |
||||
<td>{{ contributor.researcher.last_name }}</td> |
||||
</tr> |
||||
<tr> |
||||
<td> |
||||
{{ |
||||
$t( |
||||
'page.studies.study.contributors.contributor.detail.email_address' |
||||
) |
||||
}} |
||||
</td> |
||||
<td>{{ contributor.researcher.email_address }}</td> |
||||
</tr> |
||||
|
||||
<tr> |
||||
<td> |
||||
{{ |
||||
$t( |
||||
'page.studies.study.contributors.contributor.detail.university' |
||||
) |
||||
}} |
||||
</td> |
||||
<td> |
||||
{{ |
||||
contributor.researcher.university |
||||
? contributor.researcher.university.name |
||||
: '' |
||||
}} |
||||
</td> |
||||
</tr> |
||||
|
||||
<tr> |
||||
<td> |
||||
{{ |
||||
$t('page.studies.study.contributors.contributor.detail.faculty') |
||||
}} |
||||
</td> |
||||
<td> |
||||
{{ |
||||
contributor.researcher.faculty |
||||
? contributor.researcher.faculty.name |
||||
: '' |
||||
}} |
||||
</td> |
||||
</tr> |
||||
|
||||
<tr> |
||||
<td> |
||||
{{ $t('page.studies.study.contributors.contributor.detail.role') }} |
||||
</td> |
||||
<td>{{ contributor.role }}</td> |
||||
</tr> |
||||
</table> |
||||
</v-card-text> |
||||
<contributor-edit-button |
||||
v-if="admin" |
||||
:contributor-id="contributor.id" |
||||
:study-id="study.id" |
||||
/> |
||||
</v-card> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
async asyncData({ store, route }) { |
||||
const studyId = route.params.studyId |
||||
const contributorId = route.params.contributorId |
||||
|
||||
// This does not work when you reload the browser.... It looses this information in the store..... why?? |
||||
const studyData = store.getters['studies/getActiveStudy'] |
||||
const studyAdmin = store.getters['authorisation/isAdminOfStudy']({ |
||||
study: studyData, |
||||
}) |
||||
|
||||
await store.dispatch('studies/detailContributor', { |
||||
studyId, |
||||
contributorId, |
||||
}) |
||||
|
||||
return { |
||||
contributor: store.getters['studies/getActiveContributorForStudy'], |
||||
study: studyData, |
||||
admin: studyAdmin, |
||||
} |
||||
}, |
||||
data() { |
||||
return {} |
||||
}, |
||||
head() { |
||||
const $t = this.$t.bind(this) |
||||
return { |
||||
title: $t( |
||||
'page.researchStudies.studyId.contributors.contributorId.detail.title' |
||||
), |
||||
} |
||||
}, |
||||
} |
||||
</script> |
Loading…
Reference in new issue