Improved companies view

This commit is contained in:
2018-03-01 22:44:14 +01:00
parent 95a5b08453
commit 08b7a0e75c
4 changed files with 15 additions and 9 deletions

View File

@ -3,6 +3,7 @@ package companies
import (
"sort"
"strings"
"unicode"
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
@ -30,6 +31,10 @@ func All(ctx *aero.Context) string {
for _, company := range companies {
firstLetter := strings.ToLower(company.Name.English[:1])
if !unicode.IsLetter([]rune(firstLetter)[0]) {
continue
}
if firstLetter != previousFirstLetter {
groups = append(groups, []*arn.Company{})
currentGroupIndex++