Skip to content

Commit

Permalink
Merge pull request #106 from nih-sparc/allow-for-multiple-institution…
Browse files Browse the repository at this point in the history
…s-and-PIs

Allow for multiple institutions and PI's
  • Loading branch information
egauzens authored May 16, 2024
2 parents 9551798 + 0aed32c commit bb03b90
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions pages/about/projects/[projectId].vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<div v-if="focus" class="body1">
FOCUS: <span class="label4">{{ focus }}</span>
</div>
<div v-if="investigator" class="body1 mb-4">
PRINCIPAL INVESTIGATOR: <span class="label4">{{ investigator }}</span>
<div v-if="investigators" class="body1 mb-4">
PRINCIPAL INVESTIGATOR(S): <span class="label4">{{ investigators.join(', ') }}</span>
</div>
<div v-if="institution" class="body1 mb-4">
INSTITUTION: <span class="label4">{{ institution }}</span>
<div v-if="institutions" class="body1 mb-4">
INSTITUTION(S): <span class="label4">{{ institutions }}</span>
</div>
<div v-if="fundingProgram.length > 0" class="body1 mb-4">
FUNDING PROGRAM(S): <span class="label4">{{ fundingProgram.join(', ') }}</span>
Expand Down Expand Up @@ -159,8 +159,8 @@ export default {
* @returns {String}
*/
getImageSrc: function () {
return this.fields.institution.fields.logo
? this.fields.institution.fields.logo.fields.file.url
return this.fields.institutions[0].fields.logo
? this.fields.institutions[0].fields.logo.fields.file.url
: ''
},
title: function () {
Expand All @@ -175,11 +175,15 @@ export default {
awardId: function () {
return this.fields.awardId
},
institution: function () {
return this.fields.institution.fields.name
institutions: function () {
let names = ''
this.fields.institutions.forEach(institution => {
names += institution.fields.name + ", "
})
return names.substring(0, names.length - 2)
},
investigator: function () {
return this.fields.principleInvestigator
investigators: function () {
return this.fields.principalInvestigators
},
nihReporterUrl: function () {
return this.fields.nihReporterUrl || '#'
Expand All @@ -189,8 +193,8 @@ export default {
* @returns {String}
*/
getImageAlt: function () {
return this.fields.institution.fields.logo
? this.fields?.institution.fields.logo.fields.file.description
return this.fields.institutions[0].fields.logo
? this.fields?.institutions[0].fields.logo.fields.file.description
: ''
},
/**
Expand Down

0 comments on commit bb03b90

Please sign in to comment.