Commit 699d6427 authored by schneider210's avatar schneider210
Browse files

add pagelabel and language to infbar and metadata

parent 40370d0f
Pipeline #132442 passed with stages
in 6 minutes and 17 seconds
......@@ -2,10 +2,10 @@
<div id="q-app">
<q-layout view="hHh lpr fff">
<Header
:collection="collection"
:itemurl="itemurl"
:collectiontitle="collectiontitle"
:itemurls="itemurls"
:manifests="manifests"
:pagelabel="pagelabel"
:status="status"
/>
......@@ -14,7 +14,9 @@
:collection="collection"
:imageurl="imageurl"
:itemurl="itemurl"
:language="itemlanguage"
:manifests="manifests"
:pagelabel="pagelabel"
:request="request"
:tree="tree"
/>
......@@ -34,11 +36,15 @@ export default {
data() {
return {
collection: {},
collectiontitle: '',
contenturl: '',
config: {},
imageurl: '',
itemlanguage: '',
itemurl: '',
itemurls: [],
label: '',
pagelabel: '',
manifests: [],
status: {
image: true, text: true, metadata: true, treeview: true,
......@@ -69,25 +75,16 @@ export default {
getConfig() {
this.config = JSON.parse(document.getElementById('emo-config').text);
},
getImageUrl(url) {
getItemData(url) {
this.request(url)
.then((data) => {
this.collectiontitle = data.title;
this.contenturl = data.content;
this.imageurl = data.image && data.image.id ? data.image.id : '';
this.itemlanguage = data.language;
this.pagelabel = data.n ? data.n : 'No pagelabel :(';
});
},
getItemContent(itemurl) {
const itemcontent = {};
this.request(itemurl)
.then((data) => {
itemcontent.collectiontitle = data.title ? data.title : 'No Title provided';
itemcontent.contenturl = data.content;
itemcontent.imageurl = data.image && data.image.id ? data.image.id : '';
itemcontent.itemlanguage = data.language;
itemcontent.pagenumber = data.n ? data.n : 'No pagenumber provided';
});
return itemcontent;
},
getItemIndex(nodelabel) {
let idx = 0;
this.itemurls.forEach((item, index) => {
......@@ -100,6 +97,7 @@ export default {
getItemUrls(sequence, label) {
const urls = [];
let ctr = 0;
sequence.forEach((obj) => {
urls.push(
{
......@@ -150,7 +148,7 @@ export default {
// make sure that urls are set just once on init
if (!this.itemurl && data.sequence[0]) {
this.itemurl = data.sequence[0].id;
this.getImageUrl(data.sequence[0].id);
this.getItemData(data.sequence[0].id);
}
});
},
......@@ -182,7 +180,7 @@ export default {
// NOTE: Set imageurl to an empty string. Otherwise, if there is no corresponding image,
// the "preceding" image according to the "preceding" itemurl will be shown.
this.imageurl = '';
this.getImageUrl(url);
this.getItemData(url);
});
this.$root.$on('update-panel-status', (status) => {
......
......@@ -5,7 +5,7 @@
<q-icon class="q-pb-sm" size="40px" :name="fasChevronRight" />
<span>{{ cut(manifesttitle) }}</span>
<q-icon class="q-pb-sm" size="40px" :name="fasChevronRight" />
<span>Page {{ itemindex + 1 }}</span>
<span>{{ pagelabel }}</span>
</h1>
</div>
</template>
......@@ -16,19 +16,16 @@ import { fasChevronRight } from '@quasar/extras/fontawesome-v5';
export default {
name: 'Infobar',
props: {
collection: Object,
collectiontitle: String,
manifests: Array,
pagelabel: String,
},
data() {
return {
itemindex: 0,
sequenceindex: 0,
};
},
computed: {
collectiontitle() {
return this.collection.title ? this.collection.title[0].title : 'Manifest';
},
manifesttitle() {
return this.manifests[this.sequenceindex].label;
},
......@@ -45,14 +42,6 @@ export default {
this.$root.$on('update-sequence-index', (index) => {
this.sequenceindex = index;
});
this.$root.$on('update-item', (url) => {
this.manifests[this.sequenceindex].sequence.forEach((item, index) => {
if (item.id === url) {
this.itemindex = index;
}
});
});
},
};
</script>
......@@ -2,7 +2,7 @@
<div>
<q-list v-if="Object.keys(collection).length">
<q-item>
<q-item-section class="text-h6">Collection</q-item-section>
<q-item-section class="text-h6 caps">Collection</q-item-section>
</q-item>
<q-item>
<q-item-section>
......@@ -34,7 +34,7 @@
<q-list>
<q-item>
<q-item-section class="text-h6">
<q-item-section class="text-h6 caps">
Manuscript {{ sequenceindex + 1 }} / {{ manifests.length }}
</q-item-section>
</q-item>
......@@ -50,14 +50,20 @@
<q-list>
<q-item>
<q-item-section class="text-h6">
<q-item-section class="text-h6 caps">
Page {{ itemindex + 1 }} / {{ itemcount }}
</q-item-section>
</q-item>
<q-item>
<q-item-section>
<q-item-label overline class="text-uppercase">Label:</q-item-label>
<q-item-label>{{ }}</q-item-label>
<q-item-label>{{ pagelabel }}</q-item-label>
</q-item-section>
</q-item>
<q-item>
<q-item-section>
<q-item-label overline class="text-uppercase">Language:</q-item-label>
<q-item-label>{{ language }}</q-item-label>
</q-item-section>
</q-item>
</q-list>
......@@ -69,8 +75,9 @@ export default {
name: 'Metadata',
props: {
collection: Object,
itemurl: String,
language: String,
manifests: Array,
pagelabel: String,
},
data() {
return {
......@@ -101,3 +108,9 @@ export default {
},
};
</script>
<style scoped>
.caps {
font-variant: small-caps;
}
</style>
......@@ -7,9 +7,9 @@
col-12
q-px-md
"
:collection="collection"
:itemurl="itemurl"
:collectiontitle="collectiontitle"
:manifests="manifests"
:pagelabel="pagelabel"
/>
</div>
......@@ -57,10 +57,10 @@ export default {
Togglebar,
},
props: {
collection: Object,
itemurl: String,
collectiontitle: String,
itemurls: Array,
manifests: Array,
pagelabel: String,
status: Object,
},
};
......
......@@ -46,8 +46,9 @@
<Metadata v-if="manifests.length"
:collection="collection"
:itemurl="itemurl"
:language="language"
:manifests="manifests"
:pagelabel="pagelabel"
>
</Metadata>
</template>
......@@ -79,7 +80,9 @@ export default {
collection: Object,
imageurl: String,
itemurl: String,
language: String,
manifests: Array,
pagelabel: String,
request: Function,
tree: Array,
},
......
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