Commit ab154687 authored by schneider210's avatar schneider210
Browse files

fix: display meta items only if provided by the api

parent 9b8ce7f4
Pipeline #167518 passed with stages
in 3 minutes and 19 seconds
This diff is collapsed.
......@@ -167,7 +167,7 @@ export default {
* caller: *created-hook*
*/
getConfig() {
this.config = JSON.parse(document.getElementById('emo-config').text);
this.config = JSON.parse(document.getElementById('tido-config').text);
},
/**
* fetch all data provided on 'item level'
......@@ -178,17 +178,16 @@ export default {
getItemData(url) {
this.request(url)
.then((data) => {
this.collectiontitle = data.title;
this.collectiontitle = data.title.title;
this.contenturl = data.content;
this.imageurl = data.image && data.image.id ? data.image.id : '';
this.itemlabel = data.n ? data.n : 'No itemlabel :(';
// note: the scholars didn't mark the item language yet, so atm the API provides them all.
// since we know, we are dealing with the arabic part of the collection, we define the language to be arabic.
const [arabic] = data['x-langString'].split(',');
const [language] = data['x-langString'] ? data['x-langString'].split(',') : data.lang;
this.itemlanguage = arabic;
this.itemlanguage = language;
});
},
/**
......
......@@ -22,7 +22,7 @@
</q-item-section>
</q-item>
<q-item v-if="config.meta.collection.collector">
<q-item v-if="config.meta.collection.collector && collection.collector.name">
<q-item-section>
<q-item-label
overline
......@@ -36,7 +36,7 @@
</q-item-section>
</q-item>
<q-item v-if="config.meta.collection.description">
<q-item v-if="config.meta.collection.description && collection.description">
<q-item-section>
<q-item-label
overline
......@@ -65,7 +65,7 @@
</q-item-section>
</q-item>
<q-item v-if="config.meta.manifest.label">
<q-item v-if="config.meta.manifest.label && title">
<q-item-section>
<q-item-label
overline
......@@ -77,7 +77,7 @@
</q-item-section>
</q-item>
<q-item v-if="config.meta.manifest.creation">
<q-item v-if="config.meta.manifest.creation && date">
<q-item-section>
<q-item-label
overline
......@@ -89,7 +89,7 @@
</q-item-section>
</q-item>
<q-item v-if="config.meta.manifest.editor">
<q-item v-if="config.meta.manifest.editor && editor">
<q-item-section>
<q-item-label
overline
......@@ -101,7 +101,7 @@
</q-item-section>
</q-item>
<q-item v-if="config.meta.manifest.location">
<q-item v-if="config.meta.manifest.location && location">
<q-item-section>
<q-item-label
overline
......@@ -113,7 +113,7 @@
</q-item-section>
</q-item>
<q-item v-if="config.meta.manifest.origin">
<q-item v-if="config.meta.manifest.origin && origin">
<q-item-section>
<q-item-label
overline
......@@ -207,12 +207,15 @@ export default {
return this.manifests[this.sequenceindex]['x-date'];
},
editor() {
let editors = '';
if (Array.isArray(this.manifests[this.sequenceindex]['x-editor'])) {
let editors = '';
Object.values(this.manifests[this.sequenceindex]['x-editor']).forEach((ed) => {
editors += `${ed.name}, `;
});
return editors.slice(0, -2);
Object.values(this.manifests[this.sequenceindex]['x-editor']).forEach((ed) => {
editors += `${ed.name}, `;
});
return editors.slice(0, -2);
}
return '';
},
itemcount() {
return this.manifests[this.sequenceindex].sequence.length;
......
......@@ -9,11 +9,7 @@
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="initial-scale=1, maximum-scale=5, minimum-scale=1, width=device-width<% if (ctx.mode.cordova || ctx.mode.capacitor) { %>, viewport-fit=cover<% } %>">
<link rel="icon" type="image/ico" href="statics/icons/favicon.ico">
<link rel="icon" type="image/png" href="statics/icons/app-logo-128x128.png">
<link rel="icon" type="image/png" sizes="16x16" href="statics/icons/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="statics/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="statics/icons/favicon-96x96.png">
<link rel="icon" type="image/x-icon" href="statics/icons/favicon.ico">
</head>
<body>
......@@ -21,7 +17,7 @@
<strong>We're sorry but TextViewer doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<script id="emo-config" type="application/json">
<script id="tido-config" type="application/json">
{
"entrypoint": "https://ahikar-test.sub.uni-goettingen.de/api/textapi/ahikar/3r9ps/collection.json",
"colors": {
......
Supports Markdown
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