Refactor all templates to dictpress v5 (Rust/Tera templates).

This commit is contained in:
2026-03-26 14:59:30 +05:30
parent c07b8331c3
commit b13a23bbc4
22 changed files with 1032 additions and 1585 deletions
+39 -41
View File
@@ -1,67 +1,67 @@
{{ define "submit-entry" }}
{{ template "header" . }}
{% extends "base.html" %}
<h2>{{ .L.T "public.submitEntryTitle" }}</h2>
{% block content %}
<h2>{{ t(key="public.submitEntry") }}</h2>
<hr />
<form method="post" action="" class="form-submit">
<div>
<div class="row">
<fieldset class="columns three">
<label for="entry-lang">{{ .L.T "public.suggestEntryLang" }}</label>
<select name="entry_lang" for="entry-lang">
{{ range $id, $l := .Langs }}
<option value="{{ $id }}">{{ $l.Name }}</option>
{{ end }}
<div class="col-3">
<label for="entry-lang">{{ t(key="public.suggestEntryLang") }}</label>
<select name="entry_lang" id="entry-lang">
{% for id, l in langs %}
<option value="{{ id }}">{{ l.name }}</option>
{% endfor %}
</select>
</fieldset>
<fieldset class="columns one"></fieldset>
<fieldset class="columns eight">
<label for="entry-content">{{ .L.T "public.suggestContent" }}</label>
</div>
<div class="col-1"></div>
<div class="col-8">
<label for="entry-content">{{ t(key="public.suggestContent") }}</label>
<textarea name="entry_content" id="entry-content" required minlength="3"></textarea>
</fieldset>
</div>
</div>
<fieldset>
<label>{{ .L.T "public.suggestPhones" }}</label>
<input type="text" name="phones" placeholder="{{ .L.T "public.suggestPhonesPlaceholder" }}" />
<label>{{ t(key="public.suggestPhones") }}</label>
<input type="text" name="phones" placeholder="{{ t(key="public.suggestPhonesPlaceholder") }}" />
</fieldset>
<br />
<h3>{{ .L.T "public.suggestDefsTitle" }}</h3>
<ol class="add-relations box">
<h3>{{ t(key="public.suggestDefsTitle") }}</h3>
<ol class="add-relations card">
<li class="row">
<fieldset class="columns three">
<label>{{ .L.T "public.suggestDefLang" }}</label>
<div class="col-3" data-relation-controls>
<label>{{ t(key="public.suggestDefLang") }}</label>
<select name="relation_lang">
{{ range $id, $l := .Langs }}
<option value="{{ $id }}">{{ $l.Name }}</option>
{{ end }}
{% for id, l in langs %}
<option value="{{ id }}">{{ l.name }}</option>
{% endfor %}
</select>
<select name="relation_type">
{{ range $lid, $l := .Langs }}
{{ range $tid, $t := $l.Types }}
<option data-lang="{{ $lid }}" value="{{ $tid }}">{{ $t }}</option>
{{ end }}
{{ end }}
<select name="relation_type" aria-label="Definition type">
{% for lid, l in langs %}
{% for tid, typ in l.types %}
<option data-lang="{{ lid }}" value="{{ tid }}">{{ typ }}</option>
{% endfor %}
{% endfor %}
</select>
<br />
<a href="#" class="btn-remove-relation">{{ .L.T "global.btnDelete" }}</a>
</fieldset>
<fieldset class="columns one"></fieldset>
<fieldset class="columns eight">
<label for="definition-content">{{ .L.T "public.suggestContent" }}</label>
<a href="#" class="btn-remove-relation">{{ t(key="global.btnDelete") }}</a>
</div>
<div class="col-1"></div>
<div class="col-8">
<label for="definition-content">{{ t(key="public.suggestContent") }}</label>
<textarea name="relation_content" required minlength="3"></textarea>
</fieldset>
</div>
</li>
</ol>
<p class="text-right">
<a href="#" class="btn-add-relation">+ {{ .L.T "public.suggestAddDefBtn" }}</a>
<p class="align-right">
<a href="#" class="btn-add-relation">+ {{ t(key="public.suggestAddDefBtn") }}</a>
</p>
<br />
<p>
<button type="submit">{{ .L.T "public.suggestSubmitBtn" }}</button>
<button type="submit">{{ t(key="public.suggestSubmitBtn") }}</button>
</p>
</div>
</form>
@@ -69,6 +69,4 @@
<script>
(() => { window.setTimeout(() => { document.querySelector('#entry-content').focus() }, 10); })();
</script>
{{ template "footer" . }}
{{ end }}
{% endblock %}