summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2022-10-23 03:18:15 +0200
committerGitHub <noreply@github.com>2022-10-23 09:18:15 +0800
commit876ee8c3cd956025aadda14175f80ce4cccfe1bb (patch)
treee3108620f171979e0b9606e993317190ec262b49 /templates
parent63ebb53fd526021666bd9fab1f9d092380f7a2f4 (diff)
downloadgitea-876ee8c3cd956025aadda14175f80ce4cccfe1bb.tar.gz
gitea-876ee8c3cd956025aadda14175f80ce4cccfe1bb.zip
Allow package version sorting (#21453)
Diffstat (limited to 'templates')
-rw-r--r--templates/admin/packages/list.tmpl12
-rw-r--r--templates/package/shared/versionlist.tmpl10
2 files changed, 14 insertions, 8 deletions
diff --git a/templates/admin/packages/list.tmpl b/templates/admin/packages/list.tmpl
index b62e788799..3aab2873c6 100644
--- a/templates/admin/packages/list.tmpl
+++ b/templates/admin/packages/list.tmpl
@@ -37,20 +37,20 @@
<th>ID</th>
<th>{{.locale.Tr "admin.packages.owner"}}</th>
<th>{{.locale.Tr "admin.packages.type"}}</th>
- <th data-sortt-asc="alphabetically" data-sortt-desc="reversealphabetically">
+ <th data-sortt-asc="name_asc" data-sortt-desc="name_desc">
{{.locale.Tr "admin.packages.name"}}
- {{SortArrow "alphabetically" "reversealphabetically" .SortType false}}
+ {{SortArrow "name_asc" "name_desc" .SortType false}}
</th>
- <th data-sortt-asc="highestversion" data-sortt-desc="lowestversion">
+ <th data-sortt-asc="version_desc" data-sortt-desc="version_asc">
{{.locale.Tr "admin.packages.version"}}
- {{SortArrow "highestversion" "lowestversion" .SortType false}}
+ {{SortArrow "version_desc" "version_asc" .SortType false}}
</th>
<th>{{.locale.Tr "admin.packages.creator"}}</th>
<th>{{.locale.Tr "admin.packages.repository"}}</th>
<th>{{.locale.Tr "admin.packages.size"}}</th>
- <th data-sortt-asc="oldest" data-sortt-desc="newest">
+ <th data-sortt-asc="created_asc" data-sortt-desc="created_desc">
{{.locale.Tr "admin.packages.published"}}
- {{SortArrow "oldest" "newest" .SortType true}}
+ {{SortArrow "created_asc" "created_desc" .SortType true}}
</th>
<th>{{.locale.Tr "admin.notices.op"}}</th>
</tr>
diff --git a/templates/package/shared/versionlist.tmpl b/templates/package/shared/versionlist.tmpl
index 02bda3fb8f..952634cfbe 100644
--- a/templates/package/shared/versionlist.tmpl
+++ b/templates/package/shared/versionlist.tmpl
@@ -3,11 +3,17 @@
<form class="ui form ignore-dirty">
<div class="ui fluid action input">
<input name="q" value="{{.Query}}" placeholder="{{.locale.Tr "explore.search"}}..." autofocus>
+ <select class="ui dropdown" name="sort">
+ <option value="version_asc"{{if eq .Sort "version_asc"}} selected="selected"{{end}}>{{.locale.Tr "filter.string.asc"}}</option>
+ <option value="version_desc"{{if eq .Sort "version_desc"}} selected="selected"{{end}}>{{.locale.Tr "filter.string.desc"}}</option>
+ <option value="created_asc"{{if eq .Sort "created_asc"}} selected="selected"{{end}}>{{.locale.Tr "repo.issues.filter_sort.oldest"}}</option>
+ <option value="created_desc"{{if or (eq .Sort "") (eq .Sort "created_desc")}} selected="selected"{{end}}>{{.locale.Tr "repo.issues.filter_sort.latest"}}</option>
+ </select>
{{if eq .PackageDescriptor.Package.Type "container"}}
<select class="ui dropdown" name="tagged">
{{$isTagged := or (eq .Tagged "") (eq .Tagged "tagged")}}
- <option value="tagged" {{if $isTagged}}selected="selected"{{end}}>{{.locale.Tr "packages.filter.container.tagged"}}</option>
- <option value="untagged" {{if not $isTagged}}selected="selected"{{end}}>{{.locale.Tr "packages.filter.container.untagged"}}</option>
+ <option value="tagged"{{if $isTagged}} selected="selected"{{end}}>{{.locale.Tr "packages.filter.container.tagged"}}</option>
+ <option value="untagged"{{if not $isTagged}} selected="selected"{{end}}>{{.locale.Tr "packages.filter.container.untagged"}}</option>
</select>
{{end}}
<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>