1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2025-06-25 14:42:51 +00:00

Title search: Fix a bug and show No results instead of empty list when no results

This commit is contained in:
Timur Ismagilov 2022-04-24 11:15:25 +03:00
parent 59deabd0d1
commit 4f50bd54fe

View File

@ -3,13 +3,17 @@
{{define "body"}} {{define "body"}}
<main class="main-width title-search"> <main class="main-width title-search">
<h1>{{block "search results for" .Query}}Search results for {{.}}{{end}}</h1> <h1>{{block "search results for" .Query}}Search results for {{.}}{{end}}</h1>
<p>{{block "search desc" .}}Every hypha name has been compared with the query. Hyphae that have matched the query are listed below.{{end}}</p> {{if len .Results}}
<ul class="title-search__results"> <p>{{block "search desc" .}}Every hypha name has been compared with the query. Hyphae that have matched the query are listed below.{{end}}</p>
{{range .Results}} <ul class="title-search__results">
<li class="title-search__entry"> {{range .Results}}
<a class="title-search__link wikilink" href="/hypha/{%s hyphaName %}">{{beautifulName .}}</a> <li class="title-search__entry">
</li> <a class="title-search__link wikilink" href="/hypha/{{.}}">{{beautifulName .}}</a>
{{end}} </li>
</ul> {{end}}
</ul>
{{else}}
<p>{{block "search no results" .}}No results{{end}}</p>
{{end}}
</main> </main>
{{end}} {{end}}