Commit 09918c9c authored by Laurent Wouters's avatar Laurent Wouters
Browse files

[fix] Fixing the person view for Cubicweb

parent 6cc6e0b1de92
...@@ -153,9 +153,9 @@ export interface Person extends rdfMeta.Loadable { ...@@ -153,9 +153,9 @@ export interface Person extends rdfMeta.Loadable {
lastName: string; lastName: string;
phone: string; phone: string;
homepage: string; homepage: string;
depiction: string; depiction: rdfMeta.Loadable;
thumbnail: string; thumbnail: rdfMeta.Loadable;
knows: string[]; knows: rdfMeta.Loadable[];
birthday: string; birthday: string;
age: string; age: string;
bio: string; bio: string;
...@@ -214,8 +214,8 @@ export interface Track extends rdfMeta.Loadable { ...@@ -214,8 +214,8 @@ export interface Track extends rdfMeta.Loadable {
export interface Talk extends rdfMeta.Loadable { export interface Talk extends rdfMeta.Loadable {
title: string; title: string;
abstract: string; abstract: string;
authors: string[]; authors: rdfMeta.Loadable[];
docs: string[]; docs: rdfMeta.Loadable[];
trackOrConferences: (Track | Conference)[]; trackOrConferences: (Track | Conference)[];
} }
...@@ -282,7 +282,12 @@ PERSON_METACLASS.properties = [ ...@@ -282,7 +282,12 @@ PERSON_METACLASS.properties = [
"http://xmlns.com/foaf/0.1/thumbnail", "http://xmlns.com/foaf/0.1/thumbnail",
LINK_METACLASS LINK_METACLASS
), ),
new rdfMeta.MetaPropertyData("knows", "http://xmlns.com/foaf/0.1/knows"), new rdfMeta.MetaPropertyObject(
"knows",
"http://xmlns.com/foaf/0.1/knows",
PERSON_METACLASS,
true
),
new rdfMeta.MetaPropertyData( new rdfMeta.MetaPropertyData(
"birthday", "birthday",
"http://xmlns.com/foaf/0.1/birthday" "http://xmlns.com/foaf/0.1/birthday"
......
...@@ -111,6 +111,12 @@ ...@@ -111,6 +111,12 @@
</div> </div>
<hr/> <hr/>
<h3>Links</h3> <h3>Links</h3>
<div v-for="related in person.knows" v-bind:key="related.__resource.uri" class="card">
<div className="card-body">
<span>Knows: </span>
<a v-on:click="(event) => {event.preventDefault(); context.event.onRequestNavigateTo(related.__resource);}" :href=related.__resource.uri>{{related.name != null ? related.name : related.__resource.uri}}</a>
</div>
</div>
</div> </div>
</div> </div>
<hr/> <hr/>
......
...@@ -103,6 +103,11 @@ class PersonRendering implements implementation.ViewImplementation { ...@@ -103,6 +103,11 @@ class PersonRendering implements implementation.ViewImplementation {
person.influencedBy.map((person: Person) => person.influencedBy.map((person: Person) =>
application.cloneResource(person.__resource) application.cloneResource(person.__resource)
) )
)
.concat(
person.knows.map((person: Person) =>
application.cloneResource(person.__resource)
)
); );
let errors: string[] = []; let errors: string[] = [];
let previous = Vue.config.errorHandler; let previous = Vue.config.errorHandler;
......
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