Commit d363bdf2 authored by Laurent Wouters's avatar Laurent Wouters
Browse files

Implementation of FoaF person view

parent c27af4bb416c
<template>
<div>
<div class="view-header">
<div className="alert alert-info" role="alert">
{{descriptor.name}}
</div>
<div class="container">
<div class="row">
<div class="col-sm-4">
<img :src="person.depiction" height="300px"/>
</div>
<div>
<ul>
<li>Name: {{person.name}}</li>
<li>Gender: {{person.gender}}</li>
<li>Depiction: <img :src="person.depiction" height="300px"/></li>
<li>Birth: {{person.birth}}</li>
<li>Death: {{person.death}}</li>
<li>Bio: {{person.bio}}</li>
</ul>
<div class="col-sm-8">
<h1>{{person.title}} {{person.name}}</h1>
<table class="table table-bordered table-hover">
<tbody>
<tr>
<td><b>Nickname</b></td>
<td>{{person.nickname}}</td>
</tr>
<tr>
<td><b>Gender</b></td>
<td>{{person.gender}}</td>
</tr>
<tr>
<td><b>First name</b></td>
<td>{{person.firstName}}</td>
</tr>
<tr>
<td><b>Last name</b></td>
<td>{{person.lastName}}</td>
</tr>
<tr>
<td><b>Bio</b></td>
<td>{{person.bio}}</td>
</tr>
</tbody>
</table>
<hr/>
<div v-for="uri in person.influenced" v-bind:key="uri" class="card">
<div className="card-body">
<span>Influenced: </span>
<a v-on:click="() => context.event.onRequestNavigateTo(uri)" href="uri">{{uri}}</a>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: ["descriptor", "person"]
props: ["context", "person"]
};
</script>
......
......@@ -57,6 +57,7 @@ const ALIAS = [
"http://purl.org/dc/terms/Agent"
],
["http://xmlns.com/foaf/0.1/title"],
["http://xmlns.com/foaf/0.1/gender"],
["http://xmlns.com/foaf/0.1/nick"],
[
"http://xmlns.com/foaf/0.1/name",
......@@ -116,6 +117,7 @@ const ALIAS = [
*/
interface FoaFPerson {
title: string;
gender: string;
nickname: string;
name: string;
firstName: string;
......@@ -196,15 +198,17 @@ function loadPerson(
return getRelatedEntities(entityTarget, property);
}
let depiction = r("http://xmlns.com/foaf/0.1/depiction");
return {
title: l("http://xmlns.com/foaf/0.1/name"),
title: l("http://xmlns.com/foaf/0.1/title"),
gender: l("http://xmlns.com/foaf/0.1/gender"),
nickname: l("http://xmlns.com/foaf/0.1/nick"),
name: l("http://xmlns.com/foaf/0.1/name"),
firstName: l("http://xmlns.com/foaf/0.1/firstName"),
lastName: l("http://xmlns.com/foaf/0.1/lastName"),
phone: l("http://xmlns.com/foaf/0.1/phone"),
homepage: l("http://xmlns.com/foaf/0.1/homepage"),
depiction: l("http://xmlns.com/foaf/0.1/depiction"),
depiction: depiction.length > 0 ? depiction[0] : null,
thumbnail: l("http://xmlns.com/foaf/0.1/thumbnail"),
knows: r("http://xmlns.com/foaf/0.1/knows"),
birthday: l("http://xmlns.com/foaf/0.1/birthday"),
......@@ -268,7 +272,7 @@ class FoaFPersonRendering implements implementation.ViewImplementation {
"PersonImpl",
{
props: {
descriptor: this.descriptor,
context: context,
person: person
}
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment