generated from ElnuDev/go-project
dict: MVP
This commit is contained in:
parent
f8ccf62570
commit
01204ffc81
9 changed files with 191 additions and 4 deletions
21
dict/templates/search.html
Normal file
21
dict/templates/search.html
Normal file
|
@ -0,0 +1,21 @@
|
|||
<p><i>{{ $count := (len .) }}{{ if eq $count 0 }}No results{{ else }}{{ $count }} result{{ if ne $count 1}}s{{ end }}{{ end }}.</i></p>
|
||||
{{- range . -}}
|
||||
<div class="box">
|
||||
<h3>
|
||||
{{- if .Kanji -}}
|
||||
<ruby>{{- .Kanji -}}<rp>(</rp><rt>{{- .Reading -}}</rt><rp>)</rp></ruby>
|
||||
{{- else -}}
|
||||
{{- .Reading -}}
|
||||
{{- end -}}
|
||||
</h3>
|
||||
{{ if le (len .Definitions) 2 -}}
|
||||
<p>{{- index .Definitions 0 -}}</p>
|
||||
{{- else -}}
|
||||
<ol>
|
||||
{{- range .Definitions }}
|
||||
<li>{{- . -}}</li>
|
||||
{{- end }}
|
||||
</ol>
|
||||
{{- end }}
|
||||
</div>
|
||||
{{ end -}}
|
Reference in a new issue