Commit b9931557 authored by schneider210's avatar schneider210
Browse files

refactor: group the tools (language, sw-info, colors) into a single component

parent c62a3c7c
Pipeline #203445 passed with stages
in 4 minutes and 50 seconds
......@@ -223,8 +223,8 @@ As a rule of thumb, each key with a boolean value (e.g. *true* or *false*) defau
"secondary": "",
"accent": ""
},
"headers": {
"all": true,
"header_section": {
"show": true,
"info": true,
"navigation": true,
"panelheadings": true,
......@@ -320,7 +320,7 @@ As a rule of thumb, each key with a boolean value (e.g. *true* or *false*) defau
If any value is left blank (e.g. `"primary": "",`), a default color scheme will be used.
- **headers**
- **header_section**
- **show**
......
......@@ -5,7 +5,7 @@
view="hHh Lpr fFf"
>
<Header
v-if="config.headers.all"
v-if="config['header_section'].show"
:collectiontitle="collectiontitle"
:config="config"
:imageurl="imageurl"
......
<template>
<q-header :class="$q.dark.isActive ? 'bg-dark' : 'bg-secondary text-primary'">
<div class="header__wrap">
<q-toolbar v-if="config.headers.info">
<q-toolbar v-if="config['header_section'].info">
<Infobar
v-if="config.headers.info && manifests.length"
v-if="manifests.length"
class="col-xs-9"
:collectiontitle="collectiontitle"
:item="item"
:manifests="manifests"
/>
<div class="row no-wrap justify-end col-xs-3">
<!-- TODO: make component out of the following and re-use it to avoid duplication -->
<Language
v-if="standalone"
:config="config"
/>
<Color :projectcolors="projectcolors" />
<Softwareinfo />
</div>
<Tools
:config="config"
:projectcolors="projectcolors"
:standalone="standalone"
/>
</q-toolbar>
<div>
<q-toolbar class="q-pb-sm">
<Navbar
v-if="config.headers.navigation"
v-if="config['header_section'].navigation"
:itemurls="itemurls"
:labels="config.labels"
:manifests="manifests"
......@@ -32,21 +29,18 @@
<q-space />
<TogglePanels
v-if="config.headers.toggle"
v-if="config['header_section'].toggle"
:panels="panels"
/>
<div
v-if="!config.headers.info"
class="row no-wrap justify-end col-xs-3"
v-if="!config['header_section'].info"
>
<!-- TODO: make component out of the following and re-use it to avoid duplication -->
<Language
v-if="standalone"
<Tools
:config="config"
:projectcolors="projectcolors"
:standalone="standalone"
/>
<Color :projectcolors="projectcolors" />
<Softwareinfo />
</div>
</q-toolbar>
</div>
......@@ -55,22 +49,18 @@
</template>
<script>
import Color from '@/components/color.vue';
import Infobar from '@/components/infobar.vue';
import Language from '@/components/language.vue';
import Navbar from '@/components/navbar.vue';
import Softwareinfo from '@/components/softwareinfo.vue';
import TogglePanels from '@/components/togglebar/togglePanels.vue';
import Tools from '@/components/tools.vue';
export default {
name: 'Header',
components: {
Color,
Infobar,
Language,
Navbar,
Softwareinfo,
TogglePanels,
Tools,
},
props: {
collectiontitle: {
......
<template>
<div class="row no-wrap justify-end col-xs-3">
<Language
v-if="standalone"
:config="config"
/>
<Color :projectcolors="projectcolors" />
<Softwareinfo />
</div>
</template>
<script>
import Color from '@/components/color.vue';
import Language from '@/components/language.vue';
import Softwareinfo from '@/components/softwareinfo.vue';
export default {
name: 'Tools',
components: {
Color,
Language,
Softwareinfo,
},
props: {
config: {
type: Object,
default: () => {},
},
projectcolors: {
type: Object,
default: () => {},
},
standalone: Boolean,
},
};
</script>
......@@ -31,7 +31,7 @@
-->
<script id="tido-config" type="application/json">
{
"entrypoint": "",
"entrypoint": "https://ahikar-dev.sub.uni-goettingen.de/api/textapi/ahikar/syriac/collection.json",
"annotations": {
"show": true,
"types": [
......@@ -62,9 +62,9 @@
"secondary": "",
"accent": ""
},
"headers": {
"all": true,
"info": true,
"header_section": {
"show": true,
"info": false,
"navigation": true,
"panelheadings": true,
"toggle": true
......
......@@ -10,7 +10,7 @@
class="item"
>
<Toolbar
v-if="config.headers.panelheadings"
v-if="config['header_section'].panelheadings"
:heading="p.panel_label"
/>
......
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