fix search result
This commit is contained in:
parent
f94360ea3b
commit
47f65e7c52
|
@ -8,24 +8,15 @@
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- search result header -->
|
<!-- search result header -->
|
||||||
<li v-if="search && filteredNotes.length" class="search-result-header">
|
<AppNavigationCaption v-if="search && filteredNotes.length" :title="searchResultTitle" class="search-result-header" />
|
||||||
<a class="icon-search active">
|
|
||||||
<span v-if="category">
|
|
||||||
{{ t('notes', 'Search result for “{search}” in {category}', { search: search, category: category }) }}
|
|
||||||
</span>
|
|
||||||
<span v-else>
|
|
||||||
{{ t('notes', 'Search result for “{search}”', { search: search }) }}
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<!-- nothing found -->
|
<!-- nothing found -->
|
||||||
<li v-if="search && !filteredNotes.length">
|
<li v-if="search && !filteredNotes.length" class="no-search-result">
|
||||||
<span class="nav-entry">
|
<span class="nav-entry">
|
||||||
<div id="emptycontent" class="emptycontent-search">
|
<div id="emptycontent" class="emptycontent-search">
|
||||||
<div class="icon-search" />
|
<div class="icon-search" />
|
||||||
<h2 v-if="category">
|
<h2 v-if="category!==null">
|
||||||
{{ t('notes', 'No search result for “{search}” in {category}', { search: search, category: category }) }}
|
{{ t('notes', 'No search result for “{search}” in {category}', { search: search, category: categoryTitle(category) }) }}
|
||||||
</h2>
|
</h2>
|
||||||
<h2 v-else>
|
<h2 v-else>
|
||||||
{{ t('notes', 'No search result for “{search}”', { search: search }) }}
|
{{ t('notes', 'No search result for “{search}”', { search: search }) }}
|
||||||
|
@ -128,6 +119,14 @@ export default {
|
||||||
noteItems() {
|
noteItems() {
|
||||||
return this.groupedNotes
|
return this.groupedNotes
|
||||||
},
|
},
|
||||||
|
|
||||||
|
searchResultTitle() {
|
||||||
|
if (this.category !== null) {
|
||||||
|
return t('notes', 'Search result for “{search}” in {category}', { search: this.search, category: this.categoryTitle(this.category) })
|
||||||
|
} else {
|
||||||
|
return t('notes', 'Search result for “{search}”', { search: this.search })
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
|
@ -149,6 +148,10 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
categoryTitle(category) {
|
||||||
|
return NotesService.categoryLabel(category)
|
||||||
|
},
|
||||||
|
|
||||||
categoryToLabel(category) {
|
categoryToLabel(category) {
|
||||||
return NotesService.categoryLabel(category.substring(this.category.length + 1))
|
return NotesService.categoryLabel(category.substring(this.category.length + 1))
|
||||||
},
|
},
|
||||||
|
@ -171,10 +174,12 @@ export default {
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.search-result-header > a,
|
.search-result-header {
|
||||||
.search-result-header > a * {
|
color: inherit;
|
||||||
font-style: italic;
|
}
|
||||||
cursor: default;
|
|
||||||
|
li.no-search-result {
|
||||||
|
order: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
li .nav-entry .emptycontent-search {
|
li .nav-entry .emptycontent-search {
|
||||||
|
|
Loading…
Reference in New Issue