From 331e476807159d066603589d9ff8d9eb0f5000a3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ole=20Volds=C3=A6ter?= <ole.voldsater@uib.no>
Date: Mon, 9 Mar 2020 14:12:18 +0100
Subject: [PATCH] =?UTF-8?q?kolonner=20for=20bokm=C3=A5l=20og=20nynorsk=20i?=
 =?UTF-8?q?=20"alle=20s=C3=B8keresultater"?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/components/SearchResults.vue | 39 ++++++++++++++++++++------------
 1 file changed, 25 insertions(+), 14 deletions(-)

diff --git a/src/components/SearchResults.vue b/src/components/SearchResults.vue
index cf9c8aba..25150935 100644
--- a/src/components/SearchResults.vue
+++ b/src/components/SearchResults.vue
@@ -1,10 +1,18 @@
 <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>
-- 
GitLab