Refactor all templates to dictpress v5 (Rust/Tera templates).
This commit is contained in:
+9
-12
@@ -1,13 +1,10 @@
|
||||
{{ define "glossary-words" }}
|
||||
{{ $g := .Data.Glossary }}
|
||||
{{ if not $g.Words }}
|
||||
<h2>{{ $.L.T "public.noResultsTitle" }}</h2>
|
||||
<p>{{ $.L.T "public.noResults" }}</p>
|
||||
{{ else }}
|
||||
<ul class="noul words">
|
||||
{{ range $i, $w := $g.Words }}
|
||||
<li><a href="/dictionary/{{ UnicodeURL $g.FromLang }}/{{ UnicodeURL $g.ToLang }}/{{ UnicodeURL (index $w.Content 0) }}">{{ $w.Content | join ", " }}</a></li>
|
||||
{{ end }}
|
||||
{% if not glossary.words or glossary.words | length == 0 %}
|
||||
<h2>{{ t(key="public.noResultsTitle") }}</h2>
|
||||
<p>{{ t(key="public.noResults") }}</p>
|
||||
{% else %}
|
||||
<ul class="unstyled words">
|
||||
{% for w in glossary.words %}
|
||||
<li><a href="{{ consts.root_url }}/dictionary/{{ glossary.from_lang | urlencode }}/{{ glossary.to_lang | urlencode }}/{{ w.content.0 | urlencode }}">{{ w.content | join(sep=", ") }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user