1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-12-12 05:20:26 +00:00

Make /list return sorted results

This commit is contained in:
Elias Bomberger 2021-10-01 00:56:49 -04:00
parent b9ce4d6cf6
commit 039fcd2b3a

View File

@ -242,11 +242,20 @@ for u := range user.YieldUsers() {
<h1>{%s lc.Get("ui.list_heading") %}</h1>
<p>{%s lc.GetPlural("ui.list_desc", hyphae.Count()) %}</p>
<ul class="hypha-list">
{% for h := range hyphae.YieldExistingHyphae() %}
{% code
hyphaNames := make(chan string)
sortedHypha := hyphae.PathographicSort(hyphaNames)
for hypha := range hyphae.YieldExistingHyphae() {
hyphaNames <- hypha.Name
}
close(hyphaNames)
%}
{% for hyphaName := range sortedHypha %}
{% code hypha := hyphae.ByName(hyphaName) %}
<li class="hypha-list__entry">
<a class="hypha-list__link" href="/hypha/{%s h.Name %}">{%s util.BeautifulName(h.Name) %}</a>
{% if h.BinaryPath != "" %}
<span class="hypha-list__amnt-type">{%s filepath.Ext(h.BinaryPath)[1:] %}</span>
<a class="hypha-list__link" href="/hypha/{%s hypha.Name %}">{%s util.BeautifulName(hypha.Name) %}</a>
{% if hypha.BinaryPath != "" %}
<span class="hypha-list__amnt-type">{%s filepath.Ext(hypha.BinaryPath)[1:] %}</span>
{% endif %}
</li>
{% endfor %}