Add sort option "Name" for title

This commit is contained in:
Leeingnyo 2021-12-24 16:29:55 +09:00
parent d7afd0969a
commit 57683d1cfb
2 changed files with 3 additions and 0 deletions

View File

@ -98,6 +98,8 @@ def sort_titles(titles : Array(Title), opt : SortOptions, username : String)
(a.load_percentage(username) <=> b.load_percentage(username)).or \
compare_numerically a.title, b.title
end
when .title?
ary.sort! { |a, b| compare_numerically a.title, b.title }
else
unless opt.method.auto?
Logger.warn "Unknown sorting method #{opt.not_nil!.method}. Using " \

View File

@ -10,6 +10,7 @@
<div class="uk-margin-bottom uk-width-1-4@s">
<% hash = {
"auto" => "Auto",
"title" => "Name",
"time_modified" => "Date Modified",
"progress" => "Progress"
} %>