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>
<section>
<h2 v-if="hits.length">Søkeresultater</h2>
<ul class="hits">
<Preview v-for="(result, index) in hits" :key="index" :searchHit="result" @click.native="article_link_click(result)">
</Preview>
</ul>
<div class="flex-container">
<ul class="hits" v-if="results_nob.length">
<li><h4>Bokmål</h4></li>
<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>
</template>
......@@ -19,16 +27,11 @@ export default {
lang: String
},
computed: {
extended_results: function(){
return this.hits.map(
function(hit){
return {
id: hit._id,
label: hit._source.lemmas.map(x => x.lemma).join(', '),
classification: helpers.group_list(hit._source.lemmas),
article: hit._source
}
})
results_nob: function(){
return this.hits.filter(hit => hit._index == 'nob')
},
results_nno: function(){
return this.hits.filter(hit => hit._index == 'nno')
}
},
methods: {
......@@ -58,4 +61,12 @@ export default {
.hits {
margin-top: 20px;
}
.flex-container {
display: flex;
}
.flex-container > ul {
padding-left: 0px;
}
</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