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
No related branches found
No related tags found
1 merge request!50hits per sheet optimisation
Pipeline #217864 passed
<template>
<div>
<SearchInput @search="onSearchInput" />
<!-- #TODO: add translation -->
<p
v-if="total > 0"
class="text-overline mb-0"
>{{total}} Results</p>
class=""
>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" />
<!-- #TODO: show pagination only if there is more than 1 page -->
<div class="text-center">
<v-pagination
v-if="items.length > 0"
......
......@@ -5,19 +5,24 @@
subheader
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>
<a :href="getItemUrl(item)" target="_blank">
<v-list-item-title>{{item.label}}</v-list-item-title>
<v-list-item-subtitle class="d-flex">
<span v-for="(matchItem, i) in item.matches" class="d-flex">
<span>"{{matchItem.match}}"</span>
<span>&nbsp;({{matchItem.occurrencesOnPage}})</span>
<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 mb-1">
<span v-for="(matchItem, i) in item.matches" class="d-flex mb-1">
<!--
#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>
<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>{{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>
</v-list-item-content>
</v-list-item>
......
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