Skip to content
Snippets Groups Projects
Commit 331e4768 authored by Ole Voldsæter's avatar Ole Voldsæter
Browse files

kolonner for bokmål og nynorsk i "alle søkeresultater"

parent b8ce2cd3
No related branches found
No related tags found
No related merge requests found
<template> <template>
<section> <section>
<h2 v-if="hits.length">Søkeresultater</h2> <h2 v-if="hits.length">Søkeresultater</h2>
<ul class="hits"> <div class="flex-container">
<Preview v-for="(result, index) in hits" :key="index" :searchHit="result" @click.native="article_link_click(result)"> <ul class="hits" v-if="results_nob.length">
</Preview> <li><h4>Bokmål</h4></li>
</ul> <Preview v-for="(result, index) in results_nob" :key="index" :searchHit="result" @click.native="article_link_click(result)">
</Preview>
</ul>
<ul class="hits" v-if="results_nno.length">
<li><h4>Nynorsk</h4></li>
<Preview v-for="(result, index) in results_nno" :key="index" :searchHit="result" @click.native="article_link_click(result)">
</Preview>
</ul>
</div>
</section> </section>
</template> </template>
...@@ -19,16 +27,11 @@ export default { ...@@ -19,16 +27,11 @@ export default {
lang: String lang: String
}, },
computed: { computed: {
extended_results: function(){ results_nob: function(){
return this.hits.map( return this.hits.filter(hit => hit._index == 'nob')
function(hit){ },
return { results_nno: function(){
id: hit._id, return this.hits.filter(hit => hit._index == 'nno')
label: hit._source.lemmas.map(x => x.lemma).join(', '),
classification: helpers.group_list(hit._source.lemmas),
article: hit._source
}
})
} }
}, },
methods: { methods: {
...@@ -58,4 +61,12 @@ export default { ...@@ -58,4 +61,12 @@ export default {
.hits { .hits {
margin-top: 20px; margin-top: 20px;
} }
.flex-container {
display: flex;
}
.flex-container > ul {
padding-left: 0px;
}
</style> </style>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment