forgejo/templates/explore/search.tmpl
0ko 2b4754c1d7 feat(ui): JSfree sorting on /explore/{users,organizations} (#9556)
This PR replaces the sort dropdowns on Users and Organizations pages of Explore with the one we've got earlier in two other areas. Previous such replacement happened in #8572.

This implies a few positive changes such as:
* larger font size
* larger clickable area for coarse cursor
* it is possible to use while scripts are still loading
* it is possible to use w/o JS

Some refactors were made to support this change and as general improvements.

Desktop, closed
B: https://codeberg.org/attachments/354f7194-b247-4ecd-8875-2e95dadc7445
A: https://codeberg.org/attachments/0fa49cf5-e8e5-4c15-b2b0-7d13e8505945

Desktop, open
B: https://codeberg.org/attachments/b01b75d1-dbe4-458c-abd5-64cd8c121bc1
A: https://codeberg.org/attachments/94baccc4-fe36-4ae1-ace0-9b4d5fbd9f42

Mobile, open
B: https://codeberg.org/attachments/f868720a-ec71-4829-87f7-a1cfab860e37
A: https://codeberg.org/attachments/bbe72710-6824-4107-8086-d2bd50897038

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9556
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2025-10-09 14:33:33 +02:00

33 lines
1.4 KiB
Go HTML Template

<div class="list-header">
<form class="ui form ignore-dirty list-header-search">
{{if .PageIsExploreUsers}}
{{template "shared/search/combo" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.user_kind")}}
{{else}}
{{template "shared/search/combo" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.org_kind")}}
{{end}}
</form>
<div class="button-row">
<!-- Sort -->
<details class="dropdown dir-rtl">
<summary class="options">
{{ctx.Locale.Tr "repo.issues.filter_sort"}}
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
</summary>
<ul>
<li>
<a class="{{if eq .SortType "newest"}}active{{end}}" href="?sort=newest&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</a>
</li>
<li>
<a class="{{if eq .SortType "oldest"}}active{{end}}" href="?sort=oldest&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a>
</li>
<li>
<a class="{{if eq .SortType "alphabetically"}}active{{end}}" href="?sort=alphabetically&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a>
</li>
<li>
<a class="{{if eq .SortType "reversealphabetically"}}active{{end}}" href="?sort=reversealphabetically&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a>
</li>
</ul>
</details>
</div>
</div>
<div class="divider"></div>