Skip to content

Commit

Permalink
Show projects in member pages (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsteeg committed Dec 17, 2021
1 parent 54ae1c7 commit b3082e7
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gatsby/lobid/src/components/member.html.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Header from "./header.html";
import Footer from "./footer.html";
import Publications from "./publications.html";
import Products from "./products.html";
import Projects from "./projects.html";

import "./css/lobid.css";
import "./css/bootstrap.min.css";
Expand Down Expand Up @@ -69,6 +70,8 @@ export class Member extends React.Component {
</div>
<p className="lead">{this.props.makesOfferName}</p>
<Products products={this.props.products} lang={this.props.lang}/>
<p className="lead">{this.props.projectsName}</p>
<Projects projects={this.props.projects} lang={this.props.lang}/>
<Publications pubs={this.props.pubs} publications={this.props.publications} />
<Footer companyDetails={this.props.companyDetails} privacy={this.props.privacy} />
</div>
Expand Down
25 changes: 25 additions & 0 deletions gatsby/lobid/src/components/projects.html.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from "react";
import { getImage, simpleId } from './helpers.js'

export default class Projects extends React.Component {
render() {
return (
<div className="container">
{this.props.projects
.map((details) =>
<div key={details.id}>
{getImage(details.id, details.image)}
<p className="details">
<a href={"/project/" + simpleId(details.id)}>
{details.alternateName || simpleId(details.id)}
</a>
<br />
{(details.name && details.name[this.props.lang]) || details.alternateName}
</p>
</div>
)}
<p />
</div>
);
}
}
23 changes: 23 additions & 0 deletions gatsby/lobid/src/templates/member.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ export default function MemberPage({ data, location, pageContext }) {
.map(edge => edge.node)
.filter(p => p.membership.find(m => m.member.id === member.id))
}
projects={data.allProjectJson.edges
.map(edge => edge.node)
.filter(p => p.membership.find(m => m.member.id === member.id))
}
pubs={data.allPublicationJson.edges
.map(edge => edge.node)
.filter(p => p.creator.find(c => c.id === member.id))
Expand All @@ -21,6 +25,7 @@ export default function MemberPage({ data, location, pageContext }) {
language="English"
teamLink="/team-de"
makesOfferName="Produkte"
projectsName="Projekte"
memberName="Mitglieder"
memberFormerName="Ehemalige"
companyDetails="Impressum"
Expand Down Expand Up @@ -92,5 +97,23 @@ export const query = graphql`
}
}
}
allProjectJson {
edges {
node {
id
image
name {
de
en
}
alternateName
membership {
member {
id
}
}
}
}
}
}
`;

0 comments on commit b3082e7

Please sign in to comment.