Skip to content

Commit

Permalink
Merge pull request #132 from brown-ccv/our-work-detail
Browse files Browse the repository at this point in the history
feat(our-work): dynamic routing for detail pages
  • Loading branch information
Ashley S. Lee authored Sep 6, 2023
2 parents d404d4f + 7d0a4ac commit 1d13d2b
Show file tree
Hide file tree
Showing 8 changed files with 841 additions and 2,278 deletions.
20 changes: 6 additions & 14 deletions components/blocks/FilesToCards.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
variant="light"
accent="warning"
width="medium"
@click.native="$router.push(`${item.path}`)"
>
<template #header>
<template v-for="(tagClass, tagType) in tagColors">
Expand Down Expand Up @@ -185,20 +186,8 @@
</span>
</template>
<template #content>
{{ item.description }}
</template>
<template #footer>
<section v-if="item.links" class="link-group">
<div><i class="mdi mdi-link p-1 title"></i></div>
<a
v-for="link in item.links"
:key="link.url"
class="m-1 link-item d-button has-background-link has-text-white has-text-weight-semibold is-size-5 link-button"
:href="link.url"
>
<span>{{ link.category.toUpperCase() }} </span>
</a>
</section>
{{ truncateDescription(item.description) }}
<a @click="$router.push(`${item.path}`)">...Read more </a>
</template>
</DCard>
</div>
Expand Down Expand Up @@ -384,6 +373,9 @@ export default {
common(a, b) {
return b.filter(Set.prototype.has.bind(new Set(a)));
},
truncateDescription(string) {
return string.split(' ').splice(0, 9).join(' ');
},
},
};
</script>
Expand Down
150 changes: 150 additions & 0 deletions components/blocks/OurWorkDetail.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
<template>
<main class="card-container-wrapper is-flex is-justify-content-center">
<div class="mt-5">
<DCard
class="mx-3 my-3 px-3"
variant="light"
accent="light"
width="large"
>
<template #header>
<template v-for="(tagClass, tagType) in tagColors">
<span
v-for="tag in filteredData[tagType]"
:key="tag"
class="radius-0 tag m-1"
:class="tagClass"
>
{{ tag }}
</span>
</template>
<h2 class="title has-text-black pt-3">{{ data.title }}</h2>
<div v-if="data.date">Updated: {{ data.date }}</div>
<span>
<div
v-for="(contributorArray, contributorType) in contributors(data)"
:key="contributorType"
>
<div>
<i
v-if="contributorArray"
:class="['mdi', contributorIcon[contributorType], 'mdi-24px']"
></i>
</div>
<span
v-for="(entry, index) in contributorArray"
:key="entry.name"
>
<a v-if="contributorType === 'people'"
:href="
'https://directory.brown.edu/uuid/' +
find_uuid(entry.name).brown_directory_uuid
"
aria-label="information icon"
><span class="icon"><i class="mdi mdi-information" /></span>
</a>
<a :href="contributorLink(entry)">{{ entry.name }}</a
><span v-if="index + 1 < contributorArray.length">, </span>
</span>
</div>
</span>
<div>
<p>{{ data.description }}</p>
</div>
</template>
<template #footer>
<section v-if="data.links" class="link-group">
<div><i class="mdi mdi-link p-1 title"></i></div>
<a
v-for="d in data.links"
:key="d.url"
class="m-1 link-item d-button has-background-link has-text-white has-text-weight-semibold is-size-5 link-button"
:href="d.url"
>
<span>{{ d.category.toUpperCase() }} </span>
</a>
</section>
</template>
</DCard>
</div>
</main>
</template>

<script>
import DCard from '@/components/base/DCard.vue';
export default {
components: {
DCard,
},
props: {
data: {
type: Object,
required: true,
},
people: {
type: Array,
required: true,
},
},
data: () => ({
ascending: true,
sortBy: [],
searchGroup: [],
tags: ['department', 'groups', 'tags', 'languages', 'active'],
tagColors: {
department: 'is-yellow',
groups: 'is-yellow',
tags: 'is-link',
languages: 'is-info',
active: 'is-info',
},
contributorIcon: {
investigators: 'mdi-brain',
people: 'mdi-account-multiple',
},
}),
computed: {
filteredData() {
const f = [this.data].filter((d) => !d.hidden);
f.forEach(function (obj) {
for (const key in obj) {
if (obj[key] === false) {
obj[key] = ['inactive'];
} else if (obj[key] === true) {
obj[key] = ['active'];
}
}
});
return f[0];
},
},
methods: {
clearAll() {
this.searchGroup = [];
},
contributors(card) {
const subset = (({ investigators, people }) => ({
investigators,
people,
}))(card);
return subset;
},
contributorLink(contributor) {
if ('link' in contributor) {
return contributor.link;
} else if ('github_user' in contributor) {
return 'https://github.com/' + contributor.github_user;
} else {
return undefined;
}
},
common(a, b) {
return b.filter(Set.prototype.has.bind(new Set(a)));
},
find_uuid(name) {
const person = this.people[0].data.find((item) => item.name === name);
return person;
},
},
};
</script>
2 changes: 1 addition & 1 deletion content
Submodule content updated 92 files
+26 −10 .github/workflows/preview_on_pr.yml
+6 −2 .github/workflows/prod_deply_on_merge.yml
+2 −1 .gitignore
+7 −6 about/facilities.md
+58 −35 about/people.yml
+2 −2 about/teams.md
+0 −0 banners/.gitkeep
+0 −0 banners/announcements/.gitkeep
+0 −43 banners/covid.yml
+714 −0 blog/nextflow.md
+0 −90 blog/test-1.md
+0 −16 blog/test-2.md
+59 −0 blog/vr-volume-viewer.md
+ images/blog/nextflow/FastQC.png
+ images/blog/nextflow/count words workflow output with custom parameter.png
+ images/blog/nextflow/count words workflow output.png
+ images/blog/nextflow/create github token.png
+ images/blog/nextflow/nextflow generated commands.png
+ images/blog/nextflow/reproduce.png
+ images/blog/nextflow/workflow output 2.png
+ images/blog/nextflow/workflow output with custom parameter.png
+ images/blog/nextflow/workflow output.png
+ images/blog/nextflow/workflow.png
+ images/blog/vr-volume-viewer/image1.png
+ images/blog/vr-volume-viewer/image2.png
+ images/blog/vr-volume-viewer/image3.png
+ images/blog/vr-volume-viewer/image4a.png
+ images/blog/vr-volume-viewer/image4b.png
+ images/blog/vr-volume-viewer/image5.gif
+ images/people/aisulu_hover.jpg
+ images/people/aisulu_main.jpg
+ images/people/anna_hover.jpg
+ images/people/anna_main.jpg
+ images/people/ashley_hover.jpg
+ images/people/ashley_main.jpg
+ images/people/camilo_hover.jpg
+ images/people/eric_hover.jpg
+ images/people/eric_main.jpg
+ images/people/galen_hover.jpg
+ images/people/galen_main.jpg
+ images/people/heather_hover.jpg
+ images/people/heather_main.jpg
+ images/people/mary_hover.jpg
+ images/people/mary_main.jpg
+ images/people/minsik_hover.jpg
+ images/people/minsik_main.jpg
+ images/people/pratibha_hover.jpg
+ images/people/pratibha_main.jpg
+ images/people/rain_hover.jpg
+ images/people/rain_main.jpg
+ images/people/tim_hover.jpg
+22 −0 our-work/collaborations/acadia.yml
+2 −0 our-work/collaborations/aer.yml
+19 −0 our-work/collaborations/biomed.yml
+7 −7 our-work/collaborations/bnc.yml
+21 −0 our-work/collaborations/brainerd.yml
+2 −2 our-work/collaborations/braingate.yml
+4 −0 our-work/collaborations/peac.yml
+4 −2 our-work/collaborations/pphc.yml
+2 −6 our-work/collaborations/riddc.yml
+2 −2 our-work/collaborations/serre.yml
+6 −4 our-work/collaborations/tpl.yml
+2 −0 our-work/software/autora.yml
+2 −2 our-work/software/beehive.yml
+15 −0 our-work/software/chamber.yml
+25 −0 our-work/software/honeycomb.yml
+2 −2 our-work/software/materials-db.yml
+5 −3 our-work/software/nb-data-explorer.yml
+18 −0 our-work/software/nlp-syllabi.yml
+15 −0 our-work/software/nmr-web-app.yml
+17 −0 our-work/software/profound.yml
+4 −2 our-work/software/project-portal.yml
+2 −2 our-work/software/provident.yml
+17 −0 our-work/software/signal.yml
+4 −2 our-work/software/titan.yml
+2 −0 our-work/software/xnat-tools.yml
+17 −0 our-work/software/yajima.yml
+19 −0 our-work/workshops-and-talks/how-to-pr.yml
+16 −0 our-work/workshops-and-talks/introduction-to-python.yml
+18 −0 our-work/workshops-and-talks/remote_renderer.yml
+19 −0 our-work/workshops-and-talks/soma.yml
+1 −1 rates.md
+6 −0 schemas/banners-frontmatter.yml
+0 −13 schemas/banners.yml
+8 −3 schemas/collaborations.yml
+10 −2 schemas/software.yml
+6 −3 schemas/workshops-and-talks.yml
+11 −10 services/computing/oscar.md
+1 −1 services/computing/stronghold.md
+15 −0 services/consulting/hardware-purchasing.md
+4 −4 services/file-storage-and-transfer/hibernate.md
+18 −19 storage-tool.yml
Loading

0 comments on commit 1d13d2b

Please sign in to comment.