From e538c723318a20fd871949bfe56d8bcbbe89d949 Mon Sep 17 00:00:00 2001 From: Jorrit Klein Bramel Date: Mon, 1 May 2017 17:37:07 +0200 Subject: [PATCH 1/2] fix #1653 sort on repo size --- options/locale/locale_en-US.ini | 2 ++ routers/home.go | 4 ++++ templates/admin/base/search.tmpl | 2 ++ 3 files changed, 8 insertions(+) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 4ffed1ddaef1a..a912a8e68f720 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -666,6 +666,8 @@ issues.label_deletion_desc = Deleting this label will remove its information in issues.label_deletion_success = This label has been deleted successfully! issues.label.filter_sort.alphabetically = Alphabetically issues.label.filter_sort.reverse_alphabetically = Reverse alphabetically +issues.label.filter_sort.by_size = Size +issues.label.filter_sort.reverse_by_size = Reverse Size issues.num_participants = %d Participants issues.attachment.open_tab = `Click to see "%s" in a new tab` issues.attachment.download = `Click to download "%s"` diff --git a/routers/home.go b/routers/home.go index 9fa565b217ee3..c02bd813fa8ee 100644 --- a/routers/home.go +++ b/routers/home.go @@ -94,6 +94,10 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) { orderBy = "name DESC" case "alphabetically": orderBy = "name ASC" + case "reversesize": + orderBy = "size DESC" + case "size": + orderBy = "size ASC" default: orderBy = "created_unix DESC" } diff --git a/templates/admin/base/search.tmpl b/templates/admin/base/search.tmpl index 9e450ee367c5d..5491d6b94a28d 100644 --- a/templates/admin/base/search.tmpl +++ b/templates/admin/base/search.tmpl @@ -12,6 +12,8 @@ {{.i18n.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}} {{.i18n.Tr "repo.issues.filter_sort.recentupdate"}} {{.i18n.Tr "repo.issues.filter_sort.leastupdate"}} + {{.i18n.Tr "repo.issues.label.filter_sort.by_size"}} + {{.i18n.Tr "repo.issues.label.filter_sort.reverse_by_size"}} From 798871028ab7e57f0c85b99c0277045a1bf1e9a4 Mon Sep 17 00:00:00 2001 From: Jorrit Klein Bramel Date: Tue, 2 May 2017 09:57:58 +0200 Subject: [PATCH 2/2] fix minor mistake in en-us locale --- options/locale/locale_en-US.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index a912a8e68f720..c1e42c7e24a9c 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -667,7 +667,7 @@ issues.label_deletion_success = This label has been deleted successfully! issues.label.filter_sort.alphabetically = Alphabetically issues.label.filter_sort.reverse_alphabetically = Reverse alphabetically issues.label.filter_sort.by_size = Size -issues.label.filter_sort.reverse_by_size = Reverse Size +issues.label.filter_sort.reverse_by_size = Reverse size issues.num_participants = %d Participants issues.attachment.open_tab = `Click to see "%s" in a new tab` issues.attachment.download = `Click to download "%s"`