44 lines
1.6 KiB
Go Template
44 lines
1.6 KiB
Go Template
{{define "content" -}}
|
|
<h1>Dictionary</h1>
|
|
{{with .Data}}
|
|
<section class="panel"><h2>Resident versions</h2>
|
|
<table class="list">
|
|
<thead><tr><th>Variant</th><th>Latest</th><th>Resident</th></tr></thead>
|
|
<tbody>
|
|
{{range .Variants}}
|
|
<tr><td>{{.Variant}}</td><td>{{.Latest}}</td><td>{{range .Versions}}<span class="pill">{{.}}</span> {{end}}</td></tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
<section class="panel"><h2>Hot-reload a version</h2>
|
|
<p class="note">Drop the rebuilt DAWG set into BACKEND_DICT_DIR/<version>/ first, then load it here.</p>
|
|
<form class="form" method="post" action="/_gm/dictionary/reload">
|
|
<label>Version <input type="text" name="version" placeholder="v2" required></label>
|
|
<div><button type="submit">Reload</button></div>
|
|
</form>
|
|
</section>
|
|
<section class="panel"><h2>Pending dictionary changes</h2>
|
|
<table class="list">
|
|
<thead><tr><th>Variant</th><th>Action</th><th>Word</th><th>Resolved</th></tr></thead>
|
|
<tbody>
|
|
{{range .Changes}}
|
|
<tr><td>{{.Variant}}</td><td>{{.Action}}</td><td><code>{{.Word}}</code></td><td>{{.ResolvedAt}}</td></tr>
|
|
{{else}}<tr><td colspan="4"><span class="note">no pending changes</span></td></tr>{{end}}
|
|
</tbody>
|
|
</table>
|
|
<form class="form" method="post" action="/_gm/dictionary/changes/apply">
|
|
<label>Mark applied for variant
|
|
<select name="variant">
|
|
<option value="english">english</option>
|
|
<option value="russian_scrabble">russian_scrabble</option>
|
|
<option value="erudit">erudit</option>
|
|
</select>
|
|
</label>
|
|
<label>In version <input type="text" name="version" placeholder="v2" required></label>
|
|
<div><button type="submit">Mark applied</button></div>
|
|
</form>
|
|
</section>
|
|
{{end}}
|
|
{{- end}}
|