Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

Commit

Permalink
Added some more data fields to be shown
Browse files Browse the repository at this point in the history
  • Loading branch information
lrosenth committed Jun 23, 2019
1 parent cf5800f commit f675831
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 39 deletions.
31 changes: 25 additions & 6 deletions src/views/Article.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
<template>
<v-layout>
<v-flex xs12 sm8 offset-sm2>
<v-card>
<v-card-title primary-title v-html="lexicon.citation"></v-card-title>
<v-card-text v-html="article.text"></v-card-text>
</v-card>
<v-card>
<v-card-title primary-title v-html="lexicon.citation"></v-card-title>
<v-card-text v-html="article.text"></v-card-text>
</v-card>
<v-card>
<v-card-title primary-title>Links</v-card-title>
<v-card-text>
<table>
<tr v-if="article.fonoteca_code"><td>Fonoteca</td><td>:</td><td>{{ article.fonoteca_code }}</td></tr>
<tr v-if="article.hls_code"><td>HLS</td><td>:</td><td>{{ article.hls_code }}</td></tr>
<tr v-if="article.oeml_code"><td>OEML</td><td>:</td><td>{{ article.oeml_code }}</td></tr>
<tr v-if="article.theaterlex_code"><td>Theaterlexikon</td><td>:</td><td>{{ article.theaterlex_code }}</td></tr>
<tr v-if="article.ticinolex_code"><td>Ticino Lexikon</td><td>:</td><td>{{ article.ticinolex_code }}</td></tr>
<tr><td>Weblink</td><td>:</td><td><a v-bind:href="article.weblink" target="_blank">{{ article.weblink }}</a></td></tr>
</table>
</v-card-text>
</v-card>
</v-flex>
</v-layout>
</template>
Expand Down Expand Up @@ -35,7 +48,13 @@
this.article = {
text: tmpdata.hasOwnProperty('mls:hasArticleText') ? tmpdata['mls:hasArticleText'][0].strval.replace(/\\n/g, "<br />") : '-',
lexicon_iri: tmpdata['mls:hasALinkToLexiconValue'][0].iri,
npages: tmpdata.hasOwnProperty('mls:hasPages') ? tmpdata['mls:hasPages'][0].strval : 'kein Text'
npages: tmpdata.hasOwnProperty('mls:hasPages') ? tmpdata['mls:hasPages'][0].strval : 'kein Text',
fonoteca_code: tmpdata.hasOwnProperty('mls:hasFonotecacode') ? tmpdata['mls:hasFonotecacode'][0].strval : undefined,
hls_code: tmpdata.hasOwnProperty('mls:hasHlsCcode') ? tmpdata['mls:hasHlsCcode'][0].strval : undefined,
oeml_code: tmpdata.hasOwnProperty('mls:hasOemlCode') ? tmpdata['mls:hasOemlCode'][0].strval : undefined,
theaterlex_code: tmpdata.hasOwnProperty('mls:hasTheaterLexCode') ? tmpdata['mls:hasTheaterLexCode'][0].strval : undefined,
ticinolex_code: tmpdata.hasOwnProperty('mls:hasTicinoLexCode') ? tmpdata['mls:hasTicinoLexCode'][0].strval : undefined,
weblink: tmpdata.hasOwnProperty('mls:hasWebLink') ? tmpdata['mls:hasWebLink'][0].strval : undefined
};
console.log(tmpdata);
axios({
Expand Down Expand Up @@ -66,4 +85,4 @@

<style scoped>
</style>
</style>
66 changes: 33 additions & 33 deletions src/views/Lemma.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
<td>Variante(n)</td><td>:</td><td><div v-for="tmp in lemma.props['mls:hasVariants']">{{ tmp.strval }}</div></td>
</tr>
<tr v-if="lemma.props.hasOwnProperty('mls:hasViaf')">
<td>VIAF</td><td>:</td><td>{{ lemma.props['mls:hasViaf'][0].strval }}</td>
<td>VIAF</td><td>:</td><td><v-btn color="info" :href="'https://viaf.org/' + lemma.props['mls:hasViaf'][0].strval">{{ lemma.props['mls:hasViaf'][0].strval }}</v-btn></td>
</tr>
<tr v-if="lemma.props.hasOwnProperty('mls:hasGnd')">
<td>GND</td><td>:</td><td>{{ lemma.props['mls:hasGnd'][0].strval }}</td>
<td>GND</td><td>:</td><td><v-btn color="info" :href="'http://d-nb.info/gnd/' + lemma.props['mls:hasGnd'][0].strval">{{ lemma.props['mls:hasGnd'][0].strval }}</v-btn></td>
</tr>
</table>
<div>Erscheint in:</div>
Expand All @@ -56,37 +56,37 @@ import {simplify_resource} from '../lib/jsonld_simplifier';
import lexfromlemma from './LexFromLemma';
export default {
name: 'lemma',
components: {
lexfromlemma
},
data: function() {
return {
lemma: {
props: {}
},
lexicon_iri: undefined,
lexicon: {
props: {gaga: 'gaga'}
},
server: this.$env.get('SERVER'),
ontology: this.$env.get('ONTOLOGY')
}
},
methods: {
getResourceData: function (iri) {
axios({
method: 'get',
url: this.server + '/v2/resourcess/' + encodeURIComponent(iri),
}).then(
response => (this.lemma = simplify_resource(response.data))
).catch(function (error) {
console.log(error);
})
}
},
mounted () {
this.getResourceData(this.$route.params.iri, 'lemma');
name: 'lemma',
components: {
lexfromlemma
},
data: function() {
return {
lemma: {
props: {}
},
lexicon_iri: undefined,
lexicon: {
props: {gaga: 'gaga'}
},
server: this.$env.get('SERVER'),
ontology: this.$env.get('ONTOLOGY'),
}
},
methods: {
getResourceData: function (iri) {
axios({
method: 'get',
url: this.server + '/v2/resources/' + encodeURIComponent(iri),
}).then(
response => (this.lemma = simplify_resource(response.data))
).catch(function (error) {
console.log(error);
})
},
},
mounted () {
this.getResourceData(this.$route.params.iri, 'lemma');
}
}
</script>

0 comments on commit f675831

Please sign in to comment.