Skip to content
Snippets Groups Projects
Commit 846dd295 authored by Nils Windisch's avatar Nils Windisch :coffee:
Browse files

feat: hits per sheet optimisation

parent 1630b81d
Branches
Tags
1 merge request!50hits per sheet optimisation
Pipeline #217864 passed
<template> <template>
<div> <div>
<SearchInput @search="onSearchInput" /> <SearchInput @search="onSearchInput" />
<!-- #TODO: add translation -->
<p <p
v-if="total > 0" v-if="total > 0"
class="text-overline mb-0" class=""
>{{total}} Results</p> >Found a total of <code class="font-weight-black">{{total}}</code> Hits for <code class="font-weight-black">[search string]</code> in <code class="font-weight-black">[Count distinct Sheets]</code> Sheets and <code class="font-weight-black">[Count distinct Manifests]</code> Manifests.</p>
<SearchResultList :items="items" /> <SearchResultList :items="items" />
<!-- #TODO: show pagination only if there is more than 1 page -->
<div class="text-center"> <div class="text-center">
<v-pagination <v-pagination
v-if="items.length > 0" v-if="items.length > 0"
......
...@@ -5,19 +5,24 @@ ...@@ -5,19 +5,24 @@
subheader subheader
v-if="items.length > 0" v-if="items.length > 0"
> >
<v-list-item v-for="item in items" :key="item.item" class="pl-0"> <v-list-item v-for="item in items" :key="item.item" class="pl-0 mb-1">
<v-list-item-content> <v-list-item-content>
<a :href="getItemUrl(item)" target="_blank"> <a :href="getItemUrl(item)" target="_blank">
<v-list-item-title>{{item.label}}</v-list-item-title> <v-list-item-title class="mb-2"><span class="font-weight-regular">Sheet {{item.n}}</span> <span class="font-weight-light">in</span> <span class="font-weight-regular">{{item.label}}</span></v-list-item-title>
<v-list-item-subtitle class="d-flex"> <v-list-item-subtitle class="d-flex mb-1">
<span v-for="(matchItem, i) in item.matches" class="d-flex"> <span v-for="(matchItem, i) in item.matches" class="d-flex mb-1">
<span>"{{matchItem.match}}"</span> <!--
<span>&nbsp;({{matchItem.occurrencesOnPage}})</span> #TODO: adjust "Hit" to be singular or plural according to count of hits
-->
<span>{{matchItem.occurrencesOnPage}} Hits for <code>{{matchItem.match}}</code></span>
<span v-if="i < item.matches.length - 1">, </span> <span v-if="i < item.matches.length - 1">, </span>
</span> </span>
<span class="ml-1">in Sheet {{item.n}}</span> <!-- #TODO: add translation -->
<!--<span class="ml-1">in Sheet {{item.n}}</span>-->
</v-list-item-subtitle> </v-list-item-subtitle>
<v-list-item-subtitle>{{getLanguage(item.lang)}}</v-list-item-subtitle> <!-- #TODO: add translation -->
<!--<v-list-item-subtitle>Manifest: {{item.label}}</v-list-item-subtitle>-->
<v-list-item-subtitle>{{getLanguage(item.lang)}} Edition</v-list-item-subtitle>
</a> </a>
</v-list-item-content> </v-list-item-content>
</v-list-item> </v-list-item>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment