Commit 4bd80a60 authored by dindigala's avatar dindigala
Browse files

Merge branch 'feature/#285-search-header' into 'develop'

feat: implementing of search in header and navigating to home or search page accordingly

See merge request !202
parents 4d41f8b1 7456a18f
Pipeline #215817 passed with stages
in 1 minute and 24 seconds
...@@ -202,7 +202,7 @@ export default { ...@@ -202,7 +202,7 @@ export default {
} }
if (this.manifests?.[0]?.sequence?.[0]?.id && !this.$route.query.itemurl) { if (this.manifests?.[0]?.sequence?.[0]?.id && !this.$route.query.itemurl) {
this.loaded = false; this.loaded = false;
this.$router.push({ query: { itemurl: this.manifests?.[0]?.sequence?.[0]?.id } }); this.$router.push({ query: { ...this.$route.query, itemurl: this.manifests?.[0]?.sequence?.[0]?.id } });
} }
}, },
/** /**
...@@ -307,7 +307,7 @@ export default { ...@@ -307,7 +307,7 @@ export default {
return; return;
} }
this.loaded = false; this.loaded = false;
this.$router.push({ query: { itemurl: node.label } }); this.$router.push({ query: { ...this.$route.query, itemurl: node.label } });
}, },
}, },
); );
......
...@@ -15,17 +15,35 @@ ...@@ -15,17 +15,35 @@
</template> </template>
<q-breadcrumbs-el <q-breadcrumbs-el
:class="$q.dark.isActive ? 'text-dark' : 'text-white'" :class="$q.dark.isActive ? 'text-dark' : 'text-white'"
:icon="fasHome"
> >
<a <a
:class="$q.dark.isActive ? 'text-dark' : 'text-white'" :class="$q.dark.isActive ? 'text-dark' : 'text-white'"
:href="`${config.breadcrumbNavigation.website}`" :href="`${config.breadcrumbNavigation.website}`"
class="header-links" class="header-links"
> >
<q-icon
:name="fasHome"
/>
{{ $t(`${config.breadcrumbNavigation.title_homepage_key}`) }} {{ $t(`${config.breadcrumbNavigation.title_homepage_key}`) }}
</a> </a>
</q-breadcrumbs-el> </q-breadcrumbs-el>
<q-breadcrumbs-el
v-if="!!searchTerm"
:class="$q.dark.isActive ? 'text-dark' : 'text-white'"
>
<a
:class="$q.dark.isActive ? 'text-dark' : 'text-white'"
:href="`${config.breadcrumbNavigation.website}search.html?searchTerm=${searchTerm}`"
class="header-links"
>
<q-icon
:name="fasSearch"
/>
{{ searchTerm }}
</a>
</q-breadcrumbs-el>
<q-breadcrumbs-el <q-breadcrumbs-el
:icon="fasFileAlt" :icon="fasFileAlt"
:label="$t(`${config.breadcrumbNavigation.title_viewer_key}`)" :label="$t(`${config.breadcrumbNavigation.title_viewer_key}`)"
...@@ -40,6 +58,7 @@ import { ...@@ -40,6 +58,7 @@ import {
fasHome, fasHome,
fasFileAlt, fasFileAlt,
fasChevronRight, fasChevronRight,
fasSearch,
} from '@quasar/extras/fontawesome-v5'; } from '@quasar/extras/fontawesome-v5';
export default { export default {
...@@ -50,10 +69,16 @@ export default { ...@@ -50,10 +69,16 @@ export default {
required: true, required: true,
}, },
}, },
computed: {
searchTerm() {
return this.$route.query.searchTerm;
},
},
created() { created() {
this.fasHome = fasHome; this.fasHome = fasHome;
this.fasFileAlt = fasFileAlt; this.fasFileAlt = fasFileAlt;
this.fasChevronRight = fasChevronRight; this.fasChevronRight = fasChevronRight;
this.fasSearch = fasSearch;
}, },
}; };
</script> </script>
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
:class="$q.dark.isActive ? 'bg-white' : 'bg-accent'" :class="$q.dark.isActive ? 'bg-white' : 'bg-accent'"
> >
<BreadCrumbNavigation <BreadCrumbNavigation
v-if="$route.query.source==='external'"
:config="config" :config="config"
/> />
</div> </div>
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
--> -->
<script id="tido-config" type="application/json"> <script id="tido-config" type="application/json">
{ {
"entrypoint": "", "entrypoint": "https://ahikar-dev.sub.uni-goettingen.de/api/textapi/ahikar/arabic-karshuni/collection.json",
"annotations": { "annotations": {
"show": true, "show": true,
"types": [ "types": [
......
...@@ -17,7 +17,7 @@ export default { ...@@ -17,7 +17,7 @@ export default {
const link = this.itemurls[itemIndex]; const link = this.itemurls[itemIndex];
this.defaultView(); this.defaultView();
this.$router.push({ query: { itemurl: link } }); this.$router.push({ query: { ...this.$route.query, itemurl: link } });
}, },
updateItem() { updateItem() {
......
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