Skip to content

Allow package version sorting #21453

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Oct 23, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ never = Never

rss_feed = RSS Feed

filter.string.asc = A - Z
filter.string.desc = Z - A
filter.created.asc = Oldest
filter.created.desc = Newest

[error]
occurred = An error occurred
report_message = If you are sure this is a Gitea bug, please search for issues on <a href="https://github.com/go-gitea/gitea/issues" target="_blank">GitHub</a> or open a new issue if necessary.
Expand Down Expand Up @@ -3085,10 +3090,6 @@ empty.repo = Did you upload a package, but it's not shown here? Go to <a href="%
filter.type = Type
filter.type.all = All
filter.no_result = Your filter produced no results.
filter.version.asc = A - Z
filter.version.desc = Z - A
filter.created.asc = Oldest
filter.created.desc = Newest
filter.container.tagged = Tagged
filter.container.untagged = Untagged
published_by = Published %[1]s by <a href="%[2]s">%[3]s</a>
Expand Down
8 changes: 4 additions & 4 deletions templates/package/shared/versionlist.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<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 "packages.filter.version.asc"}}</option>
<option value="version_desc" {{if eq .Sort "version_desc"}}selected="selected"{{end}}>{{.locale.Tr "packages.filter.version.desc"}}</option>
<option value="created_asc" {{if eq .Sort "created_asc"}}selected="selected"{{end}}>{{.locale.Tr "packages.filter.created.asc"}}</option>
<option value="created_desc" {{if or (eq .Sort "") (eq .Sort "created_desc")}}selected="selected"{{end}}>{{.locale.Tr "packages.filter.created.desc"}}</option>
<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 "filter.created.asc"}}</option>
<option value="created_desc" {{if or (eq .Sort "") (eq .Sort "created_desc")}}selected="selected"{{end}}>{{.locale.Tr "filter.created.desc"}}</option>
</select>
{{if eq .PackageDescriptor.Package.Type "container"}}
<select class="ui dropdown" name="tagged">
Expand Down