From 0fe880c53f36dafa49672e326115c02e87fbb3a9 Mon Sep 17 00:00:00 2001 From: Eric Gauzens Date: Mon, 13 May 2024 15:10:41 -0400 Subject: [PATCH] Updated project details page --- pages/about/projects/[projectId].vue | 183 +++++++++++++-------------- 1 file changed, 89 insertions(+), 94 deletions(-) diff --git a/pages/about/projects/[projectId].vue b/pages/about/projects/[projectId].vue index 78c4d67b..ef0dcc11 100644 --- a/pages/about/projects/[projectId].vue +++ b/pages/about/projects/[projectId].vue @@ -2,86 +2,63 @@
-
- - -
- + + +
+
+
+ +
+

+ {{ title }} +

+
+
+ FOCUS: {{ focus }} +
+
+ PRINCIPAL INVESTIGATOR: {{ investigator }} +
+
+ INSTITUTION: {{ institution }} +
+
+ FUNDING PROGRAM(S): {{ fundingProgram.join(', ') }} +
+
+ NIH AWARD: + + {{ awardId }} + +
-
+
+
- - - - -
SHARE
- - - -

- {{ title }} -

-
- - -
- - View All Projects > - + + View All Projects > + +
+
+
+ +
+ Associated Content +
+
+
+
+ +
+
+
+
@@ -93,6 +70,7 @@ import marked from '@/mixins/marked/index' import { isInternalLink, opensInNewTab } from '@/mixins/marked/index' import { propOr, isEmpty } from 'ramda' import consortiaMixin from '@/mixins/consortia' +import { ref } from 'vue' export default { name: 'ProjectDetails', @@ -130,7 +108,8 @@ export default { }) return { fields: project.fields, - associatedDatasets: propOr([], 'datasets', associatedDatasets) + associatedDatasets: propOr([], 'datasets', associatedDatasets), + associatedDatasetsMaxHeight: ref(0) } } catch (e) { console.error(e) @@ -141,6 +120,14 @@ export default { this.fetchConsortiaStyle(this.fundingProgram) }, + watch: { + consortiaStyle: { + handler: function(){ + this.associatedDatasetsMaxHeight = this.$refs.projectDetailsContainer.clientHeight - 19 + } + } + }, + computed: { breadcrumb() { return [ @@ -163,7 +150,7 @@ export default { consortiaType: this.fundingProgram } }, - label: 'Projects' + label: `${this.fundingProgram}` } ] }, @@ -171,37 +158,37 @@ export default { * Get image Source * @returns {String} */ - getImageSrc: function() { + getImageSrc: function () { return this.fields.institution.fields.logo ? this.fields.institution.fields.logo.fields.file.url : '' }, - title: function() { + title: function () { return this.fields.title }, - description: function() { + description: function () { return this.fields.description }, - fundingProgram: function() { + fundingProgram: function () { return this.fields.program }, - awardId: function() { + awardId: function () { return this.fields.awardId }, - institution: function() { + institution: function () { return this.fields.institution.fields.name }, - investigator: function() { + investigator: function () { return this.fields.principleInvestigator }, - nihReporterUrl: function() { + nihReporterUrl: function () { return this.fields.nihReporterUrl || '#' }, /** * Get image source * @returns {String} */ - getImageAlt: function() { + getImageAlt: function () { return this.fields.institution.fields.logo ? this.fields?.institution.fields.logo.fields.file.description : '' @@ -210,10 +197,10 @@ export default { * Compute subtitle based on its project section * @returns {String} */ - focus: function() { + focus: function () { return propOr([], 'focus', this.fields).join(", ") }, - showAssociatedDatasets: function() { + showAssociatedDatasets: function () { return !isEmpty(this.associatedDatasets) }, allProjectsLink() { @@ -236,17 +223,14 @@ export default { .row { display: flex; } -.back-link { - color: white; - font-weight: 500; -} -.first-column { - max-width: 25rem; +.space-between { + justify-content: space-between; } .image-container { display: flex; aspect-ratio: 1; border: 1px solid $lineColor2; + max-width: 10rem; } .image { height: auto; @@ -259,10 +243,8 @@ hr { border-right: none; } .associated-datasets-container { - max-height: 20rem; overflow: auto; overflow-x: hidden; - text-overflow: hidden; } .content { :deep(img) { @@ -287,4 +269,17 @@ hr { width: 1.5rem; height: 1.5rem; } +.projects-details-container { + height: fit-content; +} +.projects-subpage { + padding: 1rem 2rem !important; +} +.associated-subpage { + height: fit-content; + padding-left: 1rem !important; + padding-right: 0rem !important; + padding-top: 1rem !important; + padding-bottom: 0 !important; +}