-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up project pages with related publications (#445)
- Loading branch information
Showing
17 changed files
with
427 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
export function simpleId(url) { | ||
export function simpleProductId(url) { | ||
return url.slice(url.lastIndexOf("/") + 1, url.lastIndexOf(".")); | ||
} | ||
|
||
export function simpleProjectId(url) { | ||
return url.slice(url.lastIndexOf('/')+1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import React from "react"; | ||
import md5 from 'md5'; | ||
import { simpleProjectId } from './helpers.js' | ||
|
||
import Header from "./header.html"; | ||
import Footer from "./footer.html"; | ||
import Publications from "./publications.html"; | ||
|
||
import "./css/lobid.css"; | ||
import "./css/bootstrap.min.css"; | ||
import "./css/font-awesome.min.css"; | ||
|
||
import jsonLdPng from "./images/json-ld.png"; | ||
|
||
export class Project extends React.Component { | ||
|
||
constructor(props) { | ||
super(props); | ||
this.props = props; | ||
} | ||
|
||
asLinks(field) { | ||
return this.props.project[field] && <tr><td>{this.props[field]}</td><td>{this.props.project[field].map((link) => | ||
<div key={link.id}><a href={link.id}>{link.id.replace('https://', '').replace('http://', '')}</a><br /></div> | ||
)}</td></tr> | ||
} | ||
|
||
render() { | ||
return ( | ||
<div className="container"> | ||
<p /> | ||
<Header | ||
language={this.props.language} | ||
languageLink={this.props.languageLink} | ||
languageTooltip={this.props.languageTooltip} | ||
publications={this.props.publications} | ||
teamLink={this.props.teamLink} | ||
contactPointId={this.props.contactPointId} | ||
/> | ||
<div> | ||
<div className="page-header"> | ||
<h1> | ||
{this.props.project.name.label} | ||
<small> | ||
{this.props.project.alternateName && this.props.project.alternateName.map(s => <span> | {s}</span>)} | ||
<a title="Beschreibung als JSON-LD anzeigen" href={'/project/' + simpleProjectId(this.props.project.id) + '.json'}><img className='json-ld-icon' src={jsonLdPng} alt="JSON-LD" /></a></small> | ||
</h1> | ||
</div> | ||
|
||
<div className="row"> | ||
<div className="col-md-9"> | ||
<p className={this.props.project.description.label.length < 400 && "lead"}>{this.props.project.description.label}</p> | ||
<table className="table table-striped table-condensed"> | ||
<thead> | ||
<tr><th width="20%" /><th width="80%" /></tr> | ||
</thead> | ||
<tbody> | ||
<tr><td>Website</td><td><a href={this.props.project.id}>{this.props.project.id}</a></td></tr> | ||
{this.props.project.endDate && <tr><td>Abgeschlossen</td><td>{this.props.project.endDate}</td></tr>} | ||
{this.asLinks("hasPart")} | ||
{this.asLinks("isBasedOn")} | ||
{this.asLinks("isRelatedTo")} | ||
{this.asLinks("enhances")} | ||
{this.asLinks("result")} | ||
</tbody> | ||
<tfoot /> | ||
</table> | ||
</div> | ||
<div className="col-md-3"> | ||
<img alt={this.props.project.name.label} id="index-image" src={this.props.project.image || `https://gravatar.com/avatar/${md5(this.props.project.id)}?s=300&d=identicon`} /> | ||
</div> | ||
</div> | ||
<Publications pubs={this.props.pubs} publications={this.props.publications} /> | ||
<Footer companyDetails={this.props.companyDetails} privacy={this.props.privacy} /> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import React from "react"; | ||
import { graphql } from "gatsby"; | ||
import { Project } from "../components/project.html"; | ||
|
||
export default function ProjectPage({ data, location, pageContext }) { | ||
const project = data.allFile.edges.slice(-1).pop().node.childProjectJson | ||
return (<Project | ||
project={project} | ||
pubs={data.allPublicationJson.edges | ||
.map(edge => edge.node) | ||
.filter(p => p.about && p.about.find(a => a.id.includes(pageContext.id))) | ||
.sort((a, b) => b.datePublished.localeCompare(a.datePublished)) | ||
} | ||
contactName="Kontakt" | ||
publications="Publikationen" | ||
language="English" | ||
teamLink="/team-de" | ||
hasPart="Besteht aus" | ||
isBasedOn="Basiert auf" | ||
isRelatedTo="Bezug" | ||
enhances="Erweitert" | ||
result="Ergebnis" | ||
companyDetails="Impressum" | ||
privacy="Datenschutz" | ||
contactPointId="mailto:[email protected]" | ||
/>); | ||
} | ||
|
||
export const query = graphql` | ||
query ProjectQuery($id: String!) { | ||
allFile (filter: { name: { eq : $id }}) { | ||
edges { | ||
node { | ||
childProjectJson { | ||
name { | ||
label: de | ||
} | ||
description { | ||
label: de | ||
} | ||
id | ||
enhances { | ||
id | ||
} | ||
isBasedOn { | ||
id | ||
} | ||
alternateName | ||
endDate | ||
result { | ||
id | ||
} | ||
} | ||
} | ||
} | ||
} | ||
allPublicationJson { | ||
edges { | ||
node { | ||
id | ||
type | ||
creator { | ||
id | ||
} | ||
name { | ||
de | ||
en | ||
} | ||
about { | ||
id | ||
} | ||
datePublished | ||
fields { | ||
jsonFile | ||
} | ||
} | ||
} | ||
} | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"@context": "https://schema.org/", | ||
"id": "https://service-wiki.hbz-nrw.de/display/SEM/Alma+Migration", | ||
"type": [ | ||
"Project" | ||
], | ||
"name": { | ||
"de": "lobid/Alma-Migration", | ||
"en": "lobid/Alma Migration" | ||
}, | ||
"description": { | ||
"en": "Switch lobid-resources ETL and indexing from Aleph to Alma Marc21 XML", | ||
"de": "Der schrittweise Umstieg der hbz-Verbundbibliotheken auf das Bibliotheksmanagementsystem Alma im Rahmen des GO:AL-Projekts (GOAL) bringt auch für die Gruppe Offene Infrastruktur dauerhaft Aufgaben mit sich: lobid indexiert unter anderem die Verbunddaten des hbz, die nun schrittweise nach Alma wandern. Demenstprechend müssen sämtliche Prozesse zum Extrahieren, Transformieren und Laden (ETL) der Verbunddaten angepasst werden, damit sie (auch) auf Basis von Alma-Daten funktionieren." | ||
}, | ||
"url": "https://github.com/hbz/lobid-resources/milestone/1", | ||
"enhances": [ | ||
{ | ||
"id": "https://lobid.org" | ||
} | ||
], | ||
"isBasedOn": [ | ||
{ | ||
"id": "https://metafacture.org" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"@context": "https://schema.org/", | ||
"id": "https://github.com/dini-ag-kim/lrmi-profile", | ||
"type": [ | ||
"Project" | ||
], | ||
"name": { | ||
"de": "LRMI-Metadatenprofil", | ||
"en": "LRMI Metadata Profile" | ||
}, | ||
"description": { | ||
"en": "A schema.org/LRMI-based profile for describing OER developed and published as JSON Schema", | ||
"de": "In diesem Projekt wird die erste offizielle Version eines Metadatenprofils für die web-konforme Publikation von Metadaten für Lehr- und Lernressourcen im deutschsprachigen Raum entwickelt. Es basiert auf dem schema.org-Vokabular mit seinen LRMI_Erweiterungen (Learning Resource Metadata Initiative) und fokussiert auf die Publikation der Metadaten als JSON-LD.\n\nDas Profil ist Basis für das Index-Schema im OERSI-Projekt (OEI) und soll als Vorgabe dienen für die Vergabe von Metadaten für OERs, die mit Fördergeldern des Landes NRW erstellt werden.\n\nFür die Validierung von Metadaten im Hinblick auf ihre Konformität zum Profil wird ein JSON Schema gepflegt." | ||
}, | ||
"isBasedOn": [ | ||
{ | ||
"id": "https://github.com/dini-ag-kim/oer-stoeberspecs" | ||
} | ||
] | ||
} |
Oops, something went wrong.