1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2025-03-04 02:28:19 +00:00

Merge pull request #102 from pyelias/sort-stuff

Sort hypha and user lists
This commit is contained in:
Timur Ismagilov 2021-10-02 00:04:40 +03:00 committed by GitHub
commit 8091638181
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 945 additions and 909 deletions

View File

@ -1,6 +1,6 @@
// Code generated by go-localize; DO NOT EDIT. // Code generated by go-localize; DO NOT EDIT.
// This file was generated by robots at // This file was generated by robots at
// 2021-10-01 12:35:00.027192 +0300 MSK m=+0.003424668 // 2021-10-01 01:05:27.197649651 -0400 EDT m=+0.002749572
package l18n package l18n

View File

@ -1,4 +1,5 @@
{% import "path/filepath" %} {% import "path/filepath" %}
{% import "sort" %}
{% import "github.com/bouncepaw/mycorrhiza/cfg" %} {% import "github.com/bouncepaw/mycorrhiza/cfg" %}
{% import "github.com/bouncepaw/mycorrhiza/hyphae" %} {% import "github.com/bouncepaw/mycorrhiza/hyphae" %}
{% import "github.com/bouncepaw/mycorrhiza/user" %} {% import "github.com/bouncepaw/mycorrhiza/user" %}
@ -213,6 +214,9 @@ for u := range user.YieldUsers() {
editors = append(editors, u.Name) editors = append(editors, u.Name)
} }
} }
sort.Strings(admins)
sort.Strings(moderators)
sort.Strings(editors)
%} %}
<section> <section>
<h2>{%s lc.Get("ui.users_admins") %}</h2> <h2>{%s lc.Get("ui.users_admins") %}</h2>
@ -242,11 +246,20 @@ for u := range user.YieldUsers() {
<h1>{%s lc.Get("ui.list_heading") %}</h1> <h1>{%s lc.Get("ui.list_heading") %}</h1>
<p>{%s lc.GetPlural("ui.list_desc", hyphae.Count()) %}</p> <p>{%s lc.GetPlural("ui.list_desc", hyphae.Count()) %}</p>
<ul class="hypha-list"> <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"> <li class="hypha-list__entry">
<a class="hypha-list__link" href="/hypha/{%s h.Name %}">{%s util.BeautifulName(h.Name) %}</a> <a class="hypha-list__link" href="/hypha/{%s hypha.Name %}">{%s util.BeautifulName(hypha.Name) %}</a>
{% if h.BinaryPath != "" %} {% if hypha.BinaryPath != "" %}
<span class="hypha-list__amnt-type">{%s filepath.Ext(h.BinaryPath)[1:] %}</span> <span class="hypha-list__amnt-type">{%s filepath.Ext(hypha.BinaryPath)[1:] %}</span>
{% endif %} {% endif %}
</li> </li>
{% endfor %} {% endfor %}

File diff suppressed because it is too large Load Diff