loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Unify search boxes (#29530)

Unify all but a few search boxes to use uniform style, uniform
translations and shared templates where possible.
Remove a few duplicated search templates, e. g. code search.

<details><summary>Example after screenshots:</summary>

![grafik](https://github.com/go-gitea/gitea/assets/47871822/e20e7d6b-c6be-4a47-b132-672766f41421)

![grafik](https://github.com/go-gitea/gitea/assets/47871822/d5b11b9c-c12f-4a29-8fb0-24e5aa511d18)

![grafik](https://github.com/go-gitea/gitea/assets/47871822/d86bb444-36c7-426d-9cf1-c634963dffb1)

![grafik](https://github.com/go-gitea/gitea/assets/47871822/a76c0319-0518-484a-a840-563d02b61198)

</details>

Also includes #29700

Co-authored-by: 6543 <6543@obermui.de>

---------

Co-authored-by: 6543 <m.huber@kithara.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
Conflicts:
routers/web/repo/search.go
templates/repo/home.tmpl
templates/repo/search.tmpl
templates/shared/repo_search.tmpl

authored by

Denys Konovalov
6543
6543
silverwind
Giteabot
and committed by
Shiny Nematoda
847f03b6 6d340bcf

+345 -395
+22 -33
options/locale/locale_en-US.ini
··· 156 156 filter.public = Public 157 157 filter.private = Private 158 158 159 + [search] 160 + search = Search... 161 + type_tooltip = Search type 162 + fuzzy = Fuzzy 163 + fuzzy_tooltip = Include results that also match the search term closely 164 + match = Match 165 + match_tooltip = Include only results that match the exact search term 166 + repo_kind = Search repos... 167 + user_kind = Search users... 168 + org_kind = Search orgs... 169 + team_kind = Search teams... 170 + code_kind = Search code... 171 + code_search_unavailable = Code search is currently not available. Please contact the site administrator. 172 + package_kind = Search packages... 173 + project_kind = Search projects... 174 + branch_kind = Search branches... 175 + commit_kind = Search commits... 176 + runner_kind = Search runners... 177 + no_results = No matching results found. 178 + keyword_search_unavailable = Searching by keyword is currently not available. Please contact the site administrator. 179 + 159 180 [aria] 160 181 navbar = Navigation Bar 161 182 footer = Footer ··· 336 357 show_more_repos = Show more repositories… 337 358 collaborative_repos = Collaborative Repositories 338 359 view_home = View %s 339 - search_repos = Find a repository… 340 360 filter = Other Filters 341 361 filter_by_team_repositories = Filter by team repositories 342 362 feed_of = Feed of "%s" ··· 361 381 forks_one = %d fork 362 382 forks_few = %d forks 363 383 organizations = Organizations 364 - search = Search 365 384 go_to = Go to 366 385 code = Code 367 - search.type.tooltip = Search type 368 - search.fuzzy = Fuzzy 369 - search.fuzzy.tooltip = Include results that also matches the search term closely 370 - search.match = Match 371 - search.match.tooltip = Include only results that matches the exact search term 372 - code_search_unavailable = Currently code search is not available. Please contact your site administrator. 373 - repo_no_results = No matching repositories found. 374 - user_no_results = No matching users found. 375 - org_no_results = No matching organizations found. 376 - code_no_results = No source code matching your search term found. 377 - code_search_results = Search results for "%s" 378 386 code_last_indexed_at = Last indexed %s 379 387 relevant_repositories_tooltip = Repositories that are forks or that have no topic, no icon, and no description are hidden. 380 388 relevant_repositories = Only relevant repositories are being shown, <a href="%s">show unfiltered results</a>. ··· 1343 1351 commits.commits = Commits 1344 1352 commits.no_commits = No commits in common. "%s" and "%s" have entirely different histories. 1345 1353 commits.nothing_to_compare = These branches are equal. 1346 - commits.search = Search commits… 1347 1354 commits.search.tooltip = You can prefix keywords with "author:", "committer:", "after:", or "before:", e.g. "revert author:Alice before:2019-01-13". 1348 - commits.find = Search 1355 + commits.search_branch = This Branch 1349 1356 commits.search_all = All Branches 1350 1357 commits.author = Author 1351 1358 commits.message = Message ··· 1521 1528 issues.filter_sort.feweststars = Fewest stars 1522 1529 issues.filter_sort.mostforks = Most forks 1523 1530 issues.filter_sort.fewestforks = Fewest forks 1524 - issues.keyword_search_unavailable = Searching by keyword is currently not available. Please contact your site administrator. 1525 1531 issues.action_open = Open 1526 1532 issues.action_close = Close 1527 1533 issues.action_label = Label ··· 2062 2068 contributors.contribution_type.additions = Additions 2063 2069 contributors.contribution_type.deletions = Deletions 2064 2070 2065 - search = Search 2066 - search.search_repo = Search repository 2067 - search.type.tooltip = Search type 2068 - search.fuzzy = Fuzzy 2069 - search.fuzzy.tooltip = Include results that also matches the search term closely 2070 - search.match = Match 2071 - search.match.tooltip = Include only results that matches the exact search term 2072 - search.results = Search results for "%s" in <a href="%s">%s</a> 2073 - search.code_no_results = No source code matching your search term found. 2074 - search.code_search_unavailable = Currently code search is not available. Please contact your site administrator. 2075 - 2076 2071 settings = Settings 2077 2072 settings.desc = Settings is where you can manage the settings for the repository 2078 2073 settings.options = Repository ··· 2241 2236 settings.collaborator_deletion = Remove Collaborator 2242 2237 settings.collaborator_deletion_desc = Removing a collaborator will revoke their access to this repository. Continue? 2243 2238 settings.remove_collaborator_success = The collaborator has been removed. 2244 - settings.search_user_placeholder = Search user… 2245 2239 settings.org_not_allowed_to_be_collaborator = Organizations cannot be added as a collaborator. 2246 2240 settings.change_team_access_not_allowed = Changing team access for repository has been restricted to organization owner 2247 2241 settings.team_not_in_organization = The team is not in the same organization as the repository ··· 2249 2243 settings.add_team = Add team 2250 2244 settings.add_team_duplicate = Team already has the repository 2251 2245 settings.add_team_success = The team now have access to the repository. 2252 - settings.search_team = Search team… 2253 2246 settings.change_team_permission_tip = Team's permission is set on the team setting page and can't be changed per repository 2254 2247 settings.delete_team_tip = This team has access to all repositories and can't be removed 2255 2248 settings.remove_team_success = The team's access to the repository has been removed. ··· 2403 2396 settings.protect_whitelist_committers_desc = Only whitelisted users or teams will be allowed to push to this branch (but not force push). 2404 2397 settings.protect_whitelist_deploy_keys = Whitelist deploy keys with write access to push. 2405 2398 settings.protect_whitelist_users = Whitelisted users for pushing: 2406 - settings.protect_whitelist_search_users = Search users… 2407 2399 settings.protect_whitelist_teams = Whitelisted teams for pushing: 2408 - settings.protect_whitelist_search_teams = Search teams… 2409 2400 settings.protect_merge_whitelist_committers = Enable merge whitelist 2410 2401 settings.protect_merge_whitelist_committers_desc = Allow only whitelisted users or teams to merge pull requests into this branch. 2411 2402 settings.protect_merge_whitelist_users = Whitelisted users for merging: ··· 2650 2641 branch.restore = Restore branch "%s" 2651 2642 branch.download = Download branch "%s" 2652 2643 branch.rename = Rename branch "%s" 2653 - branch.search = Search branch 2654 2644 branch.included_desc = This branch is part of the default branch 2655 2645 branch.included = Included 2656 2646 branch.create_new_branch = Create branch from branch: ··· 2797 2787 teams.admin_permission_desc = This team grants <strong>Admin</strong> access: members can read from, push to and add collaborators to team repositories. 2798 2788 teams.create_repo_permission_desc = Additionally, this team grants <strong>Create repository</strong> permission: members can create new repositories in organization. 2799 2789 teams.repositories = Team repositories 2800 - teams.search_repo_placeholder = Search repository… 2801 2790 teams.remove_all_repos_title = Remove all team repositories 2802 2791 teams.remove_all_repos_desc = This will remove all repositories from the team. 2803 2792 teams.add_all_repos_title = Add all repositories
+2 -3
routers/web/explore/code.go
··· 35 35 language := ctx.FormTrim("l") 36 36 keyword := ctx.FormTrim("q") 37 37 38 - queryType := ctx.FormTrim("t") 39 - isFuzzy := queryType != "match" 38 + isFuzzy := ctx.FormOptionalBool("fuzzy").ValueOrDefault(true) 40 39 41 40 ctx.Data["Keyword"] = keyword 42 41 ctx.Data["Language"] = language 43 - ctx.Data["queryType"] = queryType 42 + ctx.Data["IsFuzzy"] = isFuzzy 44 43 ctx.Data["PageIsViewCode"] = true 45 44 46 45 if keyword == "" {
+1 -1
routers/web/repo/commit.go
··· 203 203 204 204 ctx.Data["Keyword"] = query 205 205 if all { 206 - ctx.Data["All"] = "checked" 206 + ctx.Data["All"] = true 207 207 } 208 208 ctx.Data["Username"] = ctx.Repo.Owner.Name 209 209 ctx.Data["Reponame"] = ctx.Repo.Repository.Name
+3 -4
routers/web/repo/search.go
··· 21 21 language := ctx.FormTrim("l") 22 22 keyword := ctx.FormTrim("q") 23 23 24 - queryType := ctx.FormTrim("t") 25 - isFuzzy := queryType != "match" 24 + isFuzzy := ctx.FormOptionalBool("fuzzy").ValueOrDefault(true) 26 25 27 26 ctx.Data["Keyword"] = keyword 28 27 ctx.Data["Language"] = language 29 - ctx.Data["queryType"] = queryType 28 + ctx.Data["IsFuzzy"] = isFuzzy 30 29 ctx.Data["PageIsViewCode"] = true 31 30 32 31 if keyword == "" { ··· 34 33 return 35 34 } 36 35 37 - ctx.Data["SourcePath"] = ctx.Repo.Repository.Link() 36 + ctx.Data["Repo"] = ctx.Repo.Repository 38 37 39 38 page := ctx.FormInt("page") 40 39 if page <= 0 {
+2 -3
routers/web/user/code.go
··· 40 40 language := ctx.FormTrim("l") 41 41 keyword := ctx.FormTrim("q") 42 42 43 - queryType := ctx.FormTrim("t") 44 - isFuzzy := queryType != "match" 43 + isFuzzy := ctx.FormOptionalBool("fuzzy").ValueOrDefault(true) 45 44 46 45 ctx.Data["Keyword"] = keyword 47 46 ctx.Data["Language"] = language 48 - ctx.Data["queryType"] = queryType 47 + ctx.Data["IsFuzzy"] = isFuzzy 49 48 ctx.Data["IsCodePage"] = true 50 49 51 50 if keyword == "" {
+1 -1
services/context/pagination.go
··· 53 53 p.AddParam(ctx, "sort", "SortType") 54 54 p.AddParam(ctx, "q", "Keyword") 55 55 // do not add any more uncommon params here! 56 - p.AddParam(ctx, "t", "queryType") 56 + p.AddParam(ctx, "fuzzy", "IsFuzzy") 57 57 }
-23
templates/admin/base/search.tmpl
··· 1 - <div class="ui secondary filter menu gt-ac gt-mx-0"> 2 - <form class="ui form ignore-dirty gt-f1"> 3 - <div class="ui fluid action input"> 4 - {{template "shared/searchinput" dict "Value" .Keyword}} 5 - <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button> 6 - </div> 7 - </form> 8 - <!-- Sort --> 9 - <div class="ui dropdown type jump item gt-mr-0"> 10 - <span class="text"> 11 - {{ctx.Locale.Tr "repo.issues.filter_sort"}} 12 - </span> 13 - {{svg "octicon-triangle-down" 14 "dropdown icon"}} 14 - <div class="menu"> 15 - <a class="{{if or (eq .SortType "oldest") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=oldest&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a> 16 - <a class="{{if eq .SortType "newest"}}active {{end}}item" href="{{$.Link}}?sort=newest&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</a> 17 - <a class="{{if eq .SortType "alphabetically"}}active {{end}}item" href="{{$.Link}}?sort=alphabetically&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a> 18 - <a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="{{$.Link}}?sort=reversealphabetically&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a> 19 - <a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?sort=recentupdate&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a> 20 - <a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?sort=leastupdate&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a> 21 - </div> 22 - </div> 23 - </div>
+1 -4
templates/admin/emails/list.tmpl
··· 6 6 <div class="ui attached segment"> 7 7 <div class="ui secondary filter menu gt-ac gt-mx-0"> 8 8 <form class="ui form ignore-dirty gt-f1"> 9 - <div class="ui fluid action input"> 10 - {{template "shared/searchinput" dict "Value" .Keyword}} 11 - <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button> 12 - </div> 9 + {{template "shared/search/combo" dict "Value" .Keyword}} 13 10 </form> 14 11 <!-- Sort --> 15 12 <div class="ui dropdown type jump item gt-mr-0">
+20 -1
templates/admin/org/list.tmpl
··· 7 7 </div> 8 8 </h4> 9 9 <div class="ui attached segment"> 10 - {{template "admin/base/search" .}} 10 + <div class="ui secondary filter menu gt-ac gt-mx-0"> 11 + <form class="ui form ignore-dirty gt-f1"> 12 + {{template "shared/search/combo" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.org_kind")}} 13 + </form> 14 + <!-- Sort --> 15 + <div class="ui dropdown type jump item gt-mr-0"> 16 + <span class="text"> 17 + {{ctx.Locale.Tr "repo.issues.filter_sort"}} 18 + </span> 19 + {{svg "octicon-triangle-down" 14 "dropdown icon"}} 20 + <div class="menu"> 21 + <a class="{{if or (eq .SortType "oldest") (not .SortType)}}active {{end}}item" href="{{$.Link}}?sort=oldest&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a> 22 + <a class="{{if eq .SortType "newest"}}active {{end}}item" href="{{$.Link}}?sort=newest&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</a> 23 + <a class="{{if eq .SortType "alphabetically"}}active {{end}}item" href="{{$.Link}}?sort=alphabetically&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a> 24 + <a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="{{$.Link}}?sort=reversealphabetically&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a> 25 + <a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?sort=recentupdate&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a> 26 + <a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?sort=leastupdate&q={{$.Keyword}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a> 27 + </div> 28 + </div> 29 + </div> 11 30 </div> 12 31 <div class="ui attached table segment"> 13 32 <table class="ui very basic striped table unstackable">
+4 -4
templates/admin/packages/list.tmpl
··· 13 13 </h4> 14 14 <div class="ui attached segment"> 15 15 <form class="ui form ignore-dirty"> 16 - <div class="ui fluid action input"> 17 - {{template "shared/searchinput" dict "Value" .Query}} 18 - <select class="ui dropdown" name="type"> 16 + <div class="ui small fluid action input"> 17 + {{template "shared/search/input" dict "Value" .Query}} 18 + <select class="ui small dropdown" name="type"> 19 19 <option value="">{{ctx.Locale.Tr "packages.filter.type"}}</option> 20 20 <option value="all">{{ctx.Locale.Tr "packages.filter.type.all"}}</option> 21 21 {{range $type := .AvailableTypes}} 22 22 <option{{if eq $.PackageType $type}} selected="selected"{{end}} value="{{$type}}">{{$type.Name}}</option> 23 23 {{end}} 24 24 </select> 25 - <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button> 25 + {{template "shared/search/button"}} 26 26 </div> 27 27 </form> 28 28 </div>
+4 -4
templates/admin/repo/unadopted.tmpl
··· 8 8 </h4> 9 9 <div class="ui attached segment"> 10 10 <form class="ui form ignore-dirty"> 11 - <div class="ui fluid action input"> 12 - <input name="search" value="true" type="hidden"> 13 - <input name="q" value="{{.Keyword}}" placeholder="{{ctx.Locale.Tr "repo.adopt_search"}}" autofocus> 14 - <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button> 11 + <div class="ui small fluid action input"> 12 + <input name="search" value="true" type="hidden"> 13 + <input name="q" value="{{.Keyword}}" placeholder="{{ctx.Locale.Tr "repo.adopt_search"}}" autofocus> 14 + {{template "shared/search/button"}} 15 15 </div> 16 16 </form> 17 17 </div>
+1 -5
templates/admin/user/list.tmpl
··· 52 52 </div> 53 53 </div> 54 54 55 - <!-- Search Text --> 56 - <div class="ui fluid action input"> 57 - {{template "shared/searchinput" dict "Value" .Keyword}} 58 - <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button> 59 - </div> 55 + {{template "shared/search/combo" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.user_kind")}} 60 56 </form> 61 57 </div> 62 58 <div class="ui attached table segment">
-17
templates/code/searchcombo.tmpl
··· 1 - {{template "code/searchform" .}} 2 - <div class="divider"></div> 3 - <div class="ui user list"> 4 - {{if .CodeIndexerUnavailable}} 5 - <div class="ui error message"> 6 - <p>{{ctx.Locale.Tr "explore.code_search_unavailable"}}</p> 7 - </div> 8 - {{else if .SearchResults}} 9 - <h3> 10 - {{ctx.Locale.Tr "explore.code_search_results" .Keyword}} 11 - </h3> 12 - {{template "code/searchresults" .}} 13 - {{else if .Keyword}} 14 - <div>{{ctx.Locale.Tr "explore.code_no_results"}}</div> 15 - {{end}} 16 - </div> 17 - {{template "base/paginate" .}}
-14
templates/code/searchform.tmpl
··· 1 - <form class="ui form ignore-dirty"> 2 - <div class="ui fluid action input"> 3 - {{template "shared/searchinput" dict "Value" .Keyword "Disabled" .CodeIndexerUnavailable}} 4 - <div class="ui dropdown selection {{if .CodeIndexerUnavailable}} disabled{{end}}" data-tooltip-content="{{ctx.Locale.Tr "explore.search.type.tooltip"}}"> 5 - <input name="t" type="hidden" value="{{.queryType}}"{{if .CodeIndexerUnavailable}} disabled{{end}}>{{svg "octicon-triangle-down" 14 "dropdown icon"}} 6 - <div class="text">{{ctx.Locale.Tr (printf "explore.search.%s" (or .queryType "fuzzy"))}}</div> 7 - <div class="menu"> 8 - <div class="item" data-value="" data-tooltip-content="{{ctx.Locale.Tr "explore.search.fuzzy.tooltip"}}">{{ctx.Locale.Tr "explore.search.fuzzy"}}</div> 9 - <div class="item" data-value="match" data-tooltip-content="{{ctx.Locale.Tr "explore.search.match.tooltip"}}">{{ctx.Locale.Tr "explore.search.match"}}</div> 10 - </div> 11 - </div> 12 - <button class="ui primary button"{{if .CodeIndexerUnavailable}} disabled{{end}}>{{ctx.Locale.Tr "explore.search"}}</button> 13 - </div> 14 - </form>
+12 -6
templates/code/searchresults.tmpl templates/shared/search/code/results.tmpl
··· 1 1 <div class="flex-text-block gt-fw"> 2 2 {{range $term := .SearchResultLanguages}} 3 - <a class="ui {{if eq $.Language $term.Language}}primary{{end}} basic label gt-m-0" href="{{AppSubUrl}}{{if $.ContextUser}}/{{$.ContextUser.Name}}/-/code{{else}}/explore/code{{end}}?q={{$.Keyword}}{{if ne $.Language $term.Language}}&l={{$term.Language}}{{end}}{{if ne $.queryType ""}}&t={{$.queryType}}{{end}}"> 3 + <a class="ui {{if eq $.Language $term.Language}}primary{{end}} basic label gt-m-0" 4 + href="{{$.Link}}?q={{$.Keyword}}{{if ne $.Language $term.Language}}&l={{$term.Language}}{{end}}&fuzzy={{$.IsFuzzy}}"> 4 5 <i class="color-icon gt-mr-3" style="background-color: {{$term.Color}}"></i> 5 6 {{$term.Language}} 6 7 <div class="detail">{{$term.Count}}</div> ··· 9 10 </div> 10 11 <div class="repository search"> 11 12 {{range $result := .SearchResults}} 12 - {{$repo := (index $.RepoMaps .RepoID)}} 13 + {{$repo := or $.Repo (index $.RepoMaps .RepoID)}} 13 14 <div class="diff-file-box diff-box file-content non-diff-file-content repo-search-result"> 14 15 <h4 class="ui top attached normal header gt-df gt-fw"> 15 - <span class="file gt-f1"> 16 - <a rel="nofollow" href="{{$repo.Link}}">{{$repo.FullName}}</a> 16 + {{if not $.Repo}} 17 + <span class="file gt-f1"> 18 + <a rel="nofollow" href="{{$repo.Link}}">{{$repo.FullName}}</a> 17 19 {{if $repo.IsArchived}} 18 20 <span class="ui basic label">{{ctx.Locale.Tr "repo.desc.archived"}}</span> 19 21 {{end}} 20 - - {{.Filename}} 21 - </span> 22 + - {{.Filename}} 23 + </span> 24 + {{else}} 25 + <span class="file gt-f1">{{.Filename}}</span> 26 + {{end}} 22 27 <a role="button" class="ui basic tiny button" rel="nofollow" href="{{$repo.Link}}/src/commit/{{$result.CommitID | PathEscape}}/{{.Filename | PathEscapeSegments}}">{{ctx.Locale.Tr "repo.diff.view_file"}}</a> 23 28 </h4> 24 29 <div class="ui attached table segment"> ··· 28 33 </div> 29 34 {{end}} 30 35 </div> 36 + {{template "base/paginate" .}}
+1 -1
templates/explore/code.tmpl
··· 2 2 <div role="main" aria-label="{{.Title}}" class="page-content explore users"> 3 3 {{template "explore/navbar" .}} 4 4 <div class="ui container"> 5 - {{template "code/searchcombo" .}} 5 + {{template "shared/search/code/search" .}} 6 6 </div> 7 7 </div> 8 8 {{template "base/footer" .}}
+1 -1
templates/explore/repo_list.tmpl
··· 60 60 </div> 61 61 {{else}} 62 62 <div> 63 - {{ctx.Locale.Tr "explore.repo_no_results"}} 63 + {{ctx.Locale.Tr "search.no_results"}} 64 64 </div> 65 65 {{end}} 66 66 </div>
+7 -6
templates/explore/search.tmpl
··· 1 - <div class="ui secondary filter menu gt-ac gt-mx-0"> 1 + <div class="ui small secondary filter menu gt-ac gt-mx-0"> 2 2 <form class="ui form ignore-dirty gt-f1"> 3 - <div class="ui fluid action input"> 4 - {{template "shared/searchinput" dict "Value" .Keyword}} 5 - <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button> 6 - </div> 3 + {{if .PageIsExploreUsers}} 4 + {{template "shared/search/combo" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.user_kind")}} 5 + {{else}} 6 + {{template "shared/search/combo" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.org_kind")}} 7 + {{end}} 7 8 </form> 8 9 <!-- Sort --> 9 - <div class="ui dropdown type jump item gt-mr-0"> 10 + <div class="ui small dropdown type jump item gt-mr-0"> 10 11 <span class="text"> 11 12 {{ctx.Locale.Tr "repo.issues.filter_sort"}} 12 13 </span>
+3 -1
templates/explore/user_list.tmpl
··· 26 26 </div> 27 27 </div> 28 28 {{else}} 29 - <div class="flex-item">{{ctx.Locale.Tr "explore.user_no_results"}}</div> 29 + <div class="flex-item"> 30 + {{ctx.Locale.Tr "search.no_results"}} 31 + </div> 30 32 {{end}} 31 33 </div>
-2
templates/explore/users.tmpl
··· 3 3 {{template "explore/navbar" .}} 4 4 <div class="ui container"> 5 5 {{template "explore/search" .}} 6 - 7 6 {{template "explore/user_list" .}} 8 - 9 7 {{template "base/paginate" .}} 10 8 </div> 11 9 </div>
+1 -1
templates/org/team/members.tmpl
··· 14 14 <input type="hidden" name="uid" value="{{.SignedUser.ID}}"> 15 15 <div id="search-user-box" class="ui search gt-mr-3"{{if .IsEmailInviteEnabled}} data-allow-email="true" data-allow-email-description="{{ctx.Locale.Tr "org.teams.invite_team_member" $.Team.Name}}"{{end}}> 16 16 <div class="ui input"> 17 - <input class="prompt" name="uname" placeholder="{{ctx.Locale.Tr "repo.settings.search_user_placeholder"}}" autocomplete="off" required> 17 + <input class="prompt" name="uname" placeholder="{{ctx.Locale.Tr "search.user_kind"}}" autocomplete="off" required> 18 18 </div> 19 19 </div> 20 20 <button class="ui primary button">{{ctx.Locale.Tr "org.teams.add_team_member"}}</button>
+1 -1
templates/org/team/repositories.tmpl
··· 14 14 {{.CsrfTokenHtml}} 15 15 <div id="search-repo-box" data-uid="{{.Org.ID}}" class="ui search"> 16 16 <div class="ui input"> 17 - <input class="prompt" name="repo_name" placeholder="{{ctx.Locale.Tr "org.teams.search_repo_placeholder"}}" autocomplete="off" required> 17 + <input class="prompt" name="repo_name" placeholder="{{ctx.Locale.Tr "search.repo_kind"}}" autocomplete="off" required> 18 18 </div> 19 19 </div> 20 20 <button class="ui primary button gt-ml-3">{{ctx.Locale.Tr "add"}}</button>
+4 -4
templates/package/shared/list.tmpl
··· 1 1 {{template "base/alert" .}} 2 2 {{if .HasPackages}} 3 3 <form class="ui form ignore-dirty"> 4 - <div class="ui fluid action input"> 5 - {{template "shared/searchinput" dict "Value" .Query}} 6 - <select class="ui dropdown" name="type"> 4 + <div class="ui small fluid action input"> 5 + {{template "shared/search/input" dict "Value" .Query "Placeholder" (ctx.Locale.Tr "search.package_kind")}} 6 + <select class="ui small dropdown" name="type"> 7 7 <option value="">{{ctx.Locale.Tr "packages.filter.type"}}</option> 8 8 <option value="all">{{ctx.Locale.Tr "packages.filter.type.all"}}</option> 9 9 {{range $type := .AvailableTypes}} 10 10 <option{{if eq $.PackageType $type}} selected="selected"{{end}} value="{{$type}}">{{$type.Name}}</option> 11 11 {{end}} 12 12 </select> 13 - <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button> 13 + {{template "shared/search/button"}} 14 14 </div> 15 15 </form> 16 16 {{end}}
+5 -5
templates/package/shared/versionlist.tmpl
··· 1 1 <p><a href="{{.PackageDescriptor.PackageWebLink}}">{{.PackageDescriptor.Package.Name}}</a> / <strong>{{ctx.Locale.Tr "packages.versions"}}</strong></p> 2 2 <form class="ui form ignore-dirty"> 3 - <div class="ui fluid action input"> 4 - {{template "shared/searchinput" dict "Value" .Query}} 5 - <select class="ui dropdown" name="sort"> 3 + <div class="ui small fluid action input"> 4 + {{template "shared/search/input" dict "Value" .Query "Placeholder" (ctx.Locale.Tr "search.package_kind")}} 5 + <select class="ui small dropdown" name="sort"> 6 6 <option value="version_asc"{{if eq .Sort "version_asc"}} selected="selected"{{end}}>{{ctx.Locale.Tr "filter.string.asc"}}</option> 7 7 <option value="version_desc"{{if eq .Sort "version_desc"}} selected="selected"{{end}}>{{ctx.Locale.Tr "filter.string.desc"}}</option> 8 8 <option value="created_asc"{{if eq .Sort "created_asc"}} selected="selected"{{end}}>{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</option> 9 9 <option value="created_desc"{{if or (eq .Sort "") (eq .Sort "created_desc")}} selected="selected"{{end}}>{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</option> 10 10 </select> 11 11 {{if eq .PackageDescriptor.Package.Type "container"}} 12 - <select class="ui dropdown" name="tagged"> 12 + <select class="ui small dropdown" name="tagged"> 13 13 {{$isTagged := or (eq .Tagged "") (eq .Tagged "tagged")}} 14 14 <option value="tagged"{{if $isTagged}} selected="selected"{{end}}>{{ctx.Locale.Tr "packages.filter.container.tagged"}}</option> 15 15 <option value="untagged"{{if not $isTagged}} selected="selected"{{end}}>{{ctx.Locale.Tr "packages.filter.container.untagged"}}</option> 16 16 </select> 17 17 {{end}} 18 - <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button> 18 + {{template "shared/search/button"}} 19 19 </div> 20 20 </form> 21 21 <div>
+2 -7
templates/projects/list.tmpl
··· 21 21 <div class="list-header"> 22 22 <!-- Search --> 23 23 <form class="list-header-search ui form ignore-dirty"> 24 - <div class="ui small search fluid action input"> 25 - <input type="hidden" name="state" value="{{$.State}}"> 26 - {{template "shared/searchinput" dict "Value" .Keyword}} 27 - <button class="ui small icon button" type="submit" aria-label="{{ctx.Locale.Tr "explore.search"}}"> 28 - {{svg "octicon-search"}} 29 - </button> 30 - </div> 24 + <input type="hidden" name="state" value="{{$.State}}"> 25 + {{template "shared/search/combo" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.project_kind")}} 31 26 </form> 32 27 <!-- Sort --> 33 28 <div class="list-header-sort ui small dropdown type jump item">
+120 -124
templates/repo/branch/list.tmpl
··· 67 67 </div> 68 68 {{end}} 69 69 70 - {{if .Branches}} 71 - <h4 class="ui top attached header gt-df gt-ac gt-sb"> 72 - <div class="gt-df gt-ac"> 73 - {{ctx.Locale.Tr "repo.branches"}} 74 - </div> 75 - <div class="tw-whitespace-nowrap"> 76 - <form class="ignore-dirty" method="get"> 77 - <div class="ui tiny search input"> 78 - <input name="q" placeholder="{{ctx.Locale.Tr "repo.branch.search"}}" value="{{.Keyword}}" autofocus> 79 - </div> 80 - <button class="ui primary tiny button gt-mr-0" data-tooltip-content={{ctx.Locale.Tr "repo.commits.search.tooltip"}}>{{ctx.Locale.Tr "repo.commits.find"}}</button> 81 - </form> 82 - </div> 83 - </h4> 70 + <h4 class="ui top attached header gt-df gt-ac gt-sb"> 71 + <div class="gt-df gt-ac"> 72 + {{ctx.Locale.Tr "repo.branches"}} 73 + </div> 74 + </h4> 75 + 76 + <div class="ui attached segment"> 77 + <form class="ignore-dirty" method="get"> 78 + {{template "shared/search/combo" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.branch_kind")}} 79 + </form> 80 + </div> 84 81 85 - <div class="ui attached table segment"> 86 - <table class="ui very basic striped fixed table single line"> 87 - <tbody> 88 - {{range .Branches}} 89 - <tr> 90 - <td class="eight wide"> 91 - {{if .DBBranch.IsDeleted}} 92 - <div class="flex-text-block"> 93 - <a class="gt-ellipsis" href="{{$.RepoLink}}/src/branch/{{PathEscapeSegments .DBBranch.Name}}">{{.DBBranch.Name}}</a> 94 - <button class="btn interact-fg gt-px-2" data-clipboard-text="{{.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button> 82 + <div class="ui attached table segment"> 83 + <table class="ui very basic striped fixed table single line"> 84 + <tbody> 85 + {{range .Branches}} 86 + <tr> 87 + <td class="eight wide"> 88 + {{if .DBBranch.IsDeleted}} 89 + <div class="flex-text-block"> 90 + <a class="gt-ellipsis" href="{{$.RepoLink}}/src/branch/{{PathEscapeSegments .DBBranch.Name}}">{{.DBBranch.Name}}</a> 91 + <button class="btn interact-fg gt-px-2" data-clipboard-text="{{.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button> 92 + </div> 93 + <p class="info">{{ctx.Locale.Tr "repo.branch.deleted_by" .DBBranch.DeletedBy.Name}} {{TimeSinceUnix .DBBranch.DeletedUnix ctx.Locale}}</p> 94 + {{else}} 95 + <div class="flex-text-block"> 96 + {{if .IsProtected}}{{svg "octicon-shield-lock"}}{{end}} 97 + <a class="gt-ellipsis" href="{{$.RepoLink}}/src/branch/{{PathEscapeSegments .DBBranch.Name}}">{{.DBBranch.Name}}</a> 98 + <button class="btn interact-fg gt-px-2" data-clipboard-text="{{.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button> 99 + {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DBBranch.CommitID)}} 100 + </div> 101 + <p class="info gt-df gt-ac gt-my-2">{{svg "octicon-git-commit" 16 "gt-mr-2"}}<a href="{{$.RepoLink}}/commit/{{PathEscape .DBBranch.CommitID}}">{{ShortSha .DBBranch.CommitID}}</a> · <span class="commit-message">{{RenderCommitMessage $.Context .DBBranch.CommitMessage ($.Repository.ComposeMetas ctx)}}</span> · {{ctx.Locale.Tr "org.repo_updated"}} {{TimeSince .DBBranch.CommitTime.AsTime ctx.Locale}}{{if .DBBranch.Pusher}} &nbsp;{{template "shared/user/avatarlink" dict "user" .DBBranch.Pusher}} &nbsp;{{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}</p> 102 + {{end}} 103 + </td> 104 + <td class="two wide ui"> 105 + {{if and (not .DBBranch.IsDeleted) $.DefaultBranchBranch}} 106 + <div class="commit-divergence"> 107 + <div class="bar-group"> 108 + <div class="count count-behind">{{.CommitsBehind}}</div> 109 + {{/* old code bears 0/0.0 = NaN output, so it might output invalid "width: NaNpx", it just works and doesn't caues any problem. */}} 110 + <div class="bar bar-behind" style="width: {{Eval 100 "*" .CommitsBehind "/" "(" .CommitsBehind "+" .CommitsAhead "+" 0.0 ")"}}%"></div> 95 111 </div> 96 - <p class="info">{{ctx.Locale.Tr "repo.branch.deleted_by" .DBBranch.DeletedBy.Name}} {{TimeSinceUnix .DBBranch.DeletedUnix ctx.Locale}}</p> 97 - {{else}} 98 - <div class="flex-text-block"> 99 - {{if .IsProtected}}{{svg "octicon-shield-lock"}}{{end}} 100 - <a class="gt-ellipsis" href="{{$.RepoLink}}/src/branch/{{PathEscapeSegments .DBBranch.Name}}">{{.DBBranch.Name}}</a> 101 - <button class="btn interact-fg gt-px-2" data-clipboard-text="{{.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button> 102 - {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DBBranch.CommitID)}} 112 + <div class="bar-group"> 113 + <div class="count count-ahead">{{.CommitsAhead}}</div> 114 + <div class="bar bar-ahead" style="width: {{Eval 100 "*" .CommitsAhead "/" "(" .CommitsBehind "+" .CommitsAhead "+" 0.0 ")"}}%"></div> 103 115 </div> 104 - <p class="info gt-df gt-ac gt-my-2">{{svg "octicon-git-commit" 16 "gt-mr-2"}}<a href="{{$.RepoLink}}/commit/{{PathEscape .DBBranch.CommitID}}">{{ShortSha .DBBranch.CommitID}}</a> · <span class="commit-message">{{RenderCommitMessage $.Context .DBBranch.CommitMessage ($.Repository.ComposeMetas ctx)}}</span> · {{ctx.Locale.Tr "org.repo_updated"}} {{TimeSince .DBBranch.CommitTime.AsTime ctx.Locale}}{{if .DBBranch.Pusher}} &nbsp;{{template "shared/user/avatarlink" dict "user" .DBBranch.Pusher}} &nbsp;{{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}</p> 116 + </div> 105 117 {{end}} 106 - </td> 107 - <td class="two wide ui"> 108 - {{if and (not .DBBranch.IsDeleted) $.DefaultBranchBranch}} 109 - <div class="commit-divergence"> 110 - <div class="bar-group"> 111 - <div class="count count-behind">{{.CommitsBehind}}</div> 112 - {{/* old code bears 0/0.0 = NaN output, so it might output invalid "width: NaNpx", it just works and doesn't caues any problem. */}} 113 - <div class="bar bar-behind" style="width: {{Eval 100 "*" .CommitsBehind "/" "(" .CommitsBehind "+" .CommitsAhead "+" 0.0 ")"}}%"></div> 114 - </div> 115 - <div class="bar-group"> 116 - <div class="count count-ahead">{{.CommitsAhead}}</div> 117 - <div class="bar bar-ahead" style="width: {{Eval 100 "*" .CommitsAhead "/" "(" .CommitsBehind "+" .CommitsAhead "+" 0.0 ")"}}%"></div> 118 - </div> 119 - </div> 120 - {{end}} 121 - </td> 122 - <td class="two wide right aligned"> 123 - {{if not .LatestPullRequest}} 124 - {{if .IsIncluded}} 125 - <span class="ui orange large label" data-tooltip-content="{{ctx.Locale.Tr "repo.branch.included_desc"}}"> 126 - {{svg "octicon-git-pull-request"}} {{ctx.Locale.Tr "repo.branch.included"}} 127 - </span> 128 - {{else if and (not .DBBranch.IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}} 129 - <a href="{{$.RepoLink}}/compare/{{PathEscapeSegments $.DefaultBranchBranch.DBBranch.Name}}...{{if ne $.Repository.Owner.Name $.Owner.Name}}{{PathEscape $.Owner.Name}}:{{end}}{{PathEscapeSegments .DBBranch.Name}}"> 130 - <button id="new-pull-request" class="ui compact basic button gt-mr-0">{{if $.CanPull}}{{ctx.Locale.Tr "repo.pulls.compare_changes"}}{{else}}{{ctx.Locale.Tr "action.compare_branch"}}{{end}}</button> 131 - </a> 132 - {{end}} 133 - {{else if and .LatestPullRequest.HasMerged .MergeMovedOn}} 134 - {{if and (not .DBBranch.IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}} 135 - <a href="{{$.RepoLink}}/compare/{{PathEscapeSegments $.DefaultBranchBranch.DBBranch.Name}}...{{if ne $.Repository.Owner.Name $.Owner.Name}}{{PathEscape $.Owner.Name}}:{{end}}{{PathEscapeSegments .DBBranch.Name}}"> 136 - <button id="new-pull-request" class="ui compact basic button gt-mr-0">{{if $.CanPull}}{{ctx.Locale.Tr "repo.pulls.compare_changes"}}{{else}}{{ctx.Locale.Tr "action.compare_branch"}}{{end}}</button> 137 - </a> 138 - {{end}} 139 - {{else}} 140 - <a href="{{.LatestPullRequest.Issue.Link}}" class="gt-vm ref-issue">{{if not .LatestPullRequest.IsSameRepo}}{{.LatestPullRequest.BaseRepo.FullName}}{{end}}#{{.LatestPullRequest.Issue.Index}}</a> 141 - {{if .LatestPullRequest.HasMerged}} 142 - <a href="{{.LatestPullRequest.Issue.Link}}" class="ui purple large label">{{svg "octicon-git-merge" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.pulls.merged"}}</a> 143 - {{else if .LatestPullRequest.Issue.IsClosed}} 144 - <a href="{{.LatestPullRequest.Issue.Link}}" class="ui red large label">{{svg "octicon-git-pull-request" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.issues.closed_title"}}</a> 145 - {{else}} 146 - <a href="{{.LatestPullRequest.Issue.Link}}" class="ui green large label">{{svg "octicon-git-pull-request" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.issues.open_title"}}</a> 147 - {{end}} 118 + </td> 119 + <td class="two wide right aligned"> 120 + {{if not .LatestPullRequest}} 121 + {{if .IsIncluded}} 122 + <span class="ui orange large label" data-tooltip-content="{{ctx.Locale.Tr "repo.branch.included_desc"}}"> 123 + {{svg "octicon-git-pull-request"}} {{ctx.Locale.Tr "repo.branch.included"}} 124 + </span> 125 + {{else if and (not .DBBranch.IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}} 126 + <a href="{{$.RepoLink}}/compare/{{PathEscapeSegments $.DefaultBranchBranch.DBBranch.Name}}...{{if ne $.Repository.Owner.Name $.Owner.Name}}{{PathEscape $.Owner.Name}}:{{end}}{{PathEscapeSegments .DBBranch.Name}}"> 127 + <button id="new-pull-request" class="ui compact basic button gt-mr-0">{{if $.CanPull}}{{ctx.Locale.Tr "repo.pulls.compare_changes"}}{{else}}{{ctx.Locale.Tr "action.compare_branch"}}{{end}}</button> 128 + </a> 148 129 {{end}} 149 - </td> 150 - <td class="three wide right aligned overflow-visible"> 151 - {{if and $.IsWriter (not $.Repository.IsArchived) (not .DBBranch.IsDeleted)}} 152 - <button class="btn interact-bg gt-p-3 show-modal show-create-branch-modal" 153 - data-branch-from="{{.DBBranch.Name}}" 154 - data-branch-from-urlcomponent="{{PathEscapeSegments .DBBranch.Name}}" 155 - data-tooltip-content="{{ctx.Locale.Tr "repo.branch.new_branch_from" .DBBranch.Name}}" 156 - data-modal="#create-branch-modal" data-name="{{.DBBranch.Name}}" 157 - > 158 - {{svg "octicon-git-branch"}} 159 - </button> 130 + {{else if and .LatestPullRequest.HasMerged .MergeMovedOn}} 131 + {{if and (not .DBBranch.IsDeleted) $.AllowsPulls (gt .CommitsAhead 0)}} 132 + <a href="{{$.RepoLink}}/compare/{{PathEscapeSegments $.DefaultBranchBranch.DBBranch.Name}}...{{if ne $.Repository.Owner.Name $.Owner.Name}}{{PathEscape $.Owner.Name}}:{{end}}{{PathEscapeSegments .DBBranch.Name}}"> 133 + <button id="new-pull-request" class="ui compact basic button gt-mr-0">{{if $.CanPull}}{{ctx.Locale.Tr "repo.pulls.compare_changes"}}{{else}}{{ctx.Locale.Tr "action.compare_branch"}}{{end}}</button> 134 + </a> 160 135 {{end}} 161 - {{if $.EnableFeed}} 162 - <a role="button" class="btn interact-bg gt-p-3" href="{{$.FeedURL}}/rss/branch/{{PathEscapeSegments .DBBranch.Name}}">{{svg "octicon-rss"}}</a> 136 + {{else}} 137 + <a href="{{.LatestPullRequest.Issue.Link}}" class="gt-vm ref-issue">{{if not .LatestPullRequest.IsSameRepo}}{{.LatestPullRequest.BaseRepo.FullName}}{{end}}#{{.LatestPullRequest.Issue.Index}}</a> 138 + {{if .LatestPullRequest.HasMerged}} 139 + <a href="{{.LatestPullRequest.Issue.Link}}" class="ui purple large label">{{svg "octicon-git-merge" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.pulls.merged"}}</a> 140 + {{else if .LatestPullRequest.Issue.IsClosed}} 141 + <a href="{{.LatestPullRequest.Issue.Link}}" class="ui red large label">{{svg "octicon-git-pull-request" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.issues.closed_title"}}</a> 142 + {{else}} 143 + <a href="{{.LatestPullRequest.Issue.Link}}" class="ui green large label">{{svg "octicon-git-pull-request" 16 "gt-mr-2"}}{{ctx.Locale.Tr "repo.issues.open_title"}}</a> 163 144 {{end}} 164 - {{if and (not .DBBranch.IsDeleted) (not $.DisableDownloadSourceArchives)}} 165 - <div class="ui dropdown btn interact-bg gt-p-3" data-tooltip-content="{{ctx.Locale.Tr "repo.branch.download" (.DBBranch.Name)}}"> 166 - {{svg "octicon-download"}} 167 - <div class="menu"> 168 - <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments .DBBranch.Name}}.zip" rel="nofollow">{{svg "octicon-file-zip"}}&nbsp;ZIP</a> 169 - <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments .DBBranch.Name}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip"}}&nbsp;TAR.GZ</a> 170 - </div> 145 + {{end}} 146 + </td> 147 + <td class="three wide right aligned overflow-visible"> 148 + {{if and $.IsWriter (not $.Repository.IsArchived) (not .DBBranch.IsDeleted)}} 149 + <button class="btn interact-bg gt-p-3 show-modal show-create-branch-modal" 150 + data-branch-from="{{.DBBranch.Name}}" 151 + data-branch-from-urlcomponent="{{PathEscapeSegments .DBBranch.Name}}" 152 + data-tooltip-content="{{ctx.Locale.Tr "repo.branch.new_branch_from" .DBBranch.Name}}" 153 + data-modal="#create-branch-modal" data-name="{{.DBBranch.Name}}" 154 + > 155 + {{svg "octicon-git-branch"}} 156 + </button> 157 + {{end}} 158 + {{if $.EnableFeed}} 159 + <a role="button" class="btn interact-bg gt-p-3" href="{{$.FeedURL}}/rss/branch/{{PathEscapeSegments .DBBranch.Name}}">{{svg "octicon-rss"}}</a> 160 + {{end}} 161 + {{if and (not .DBBranch.IsDeleted) (not $.DisableDownloadSourceArchives)}} 162 + <div class="ui dropdown btn interact-bg gt-p-3" data-tooltip-content="{{ctx.Locale.Tr "repo.branch.download" (.DBBranch.Name)}}"> 163 + {{svg "octicon-download"}} 164 + <div class="menu"> 165 + <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments .DBBranch.Name}}.zip" rel="nofollow">{{svg "octicon-file-zip"}}&nbsp;ZIP</a> 166 + <a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments .DBBranch.Name}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip"}}&nbsp;TAR.GZ</a> 171 167 </div> 172 - {{end}} 173 - {{if and $.IsWriter (not $.Repository.IsArchived) (not .DBBranch.IsDeleted) (not $.IsMirror)}} 174 - <button class="btn interact-bg gt-p-3 show-modal show-rename-branch-modal" 175 - data-is-default-branch="false" 176 - data-old-branch-name="{{.DBBranch.Name}}" 177 - data-modal="#rename-branch-modal" 178 - data-tooltip-content="{{ctx.Locale.Tr "repo.branch.rename" (.DBBranch.Name)}}" 179 - > 180 - {{svg "octicon-pencil"}} 168 + </div> 169 + {{end}} 170 + {{if and $.IsWriter (not $.Repository.IsArchived) (not .DBBranch.IsDeleted) (not $.IsMirror)}} 171 + <button class="btn interact-bg gt-p-3 show-modal show-rename-branch-modal" 172 + data-is-default-branch="false" 173 + data-old-branch-name="{{.DBBranch.Name}}" 174 + data-modal="#rename-branch-modal" 175 + data-tooltip-content="{{ctx.Locale.Tr "repo.branch.rename" (.DBBranch.Name)}}" 176 + > 177 + {{svg "octicon-pencil"}} 178 + </button> 179 + {{end}} 180 + {{if and $.IsWriter (not $.IsMirror) (not $.Repository.IsArchived) (not .IsProtected)}} 181 + {{if .DBBranch.IsDeleted}} 182 + <button class="btn interact-bg gt-p-3 link-action restore-branch-button" data-url="{{$.Link}}/restore?branch_id={{.DBBranch.ID}}&name={{.DBBranch.Name}}&page={{$.Page.Paginater.Current}}" data-tooltip-content="{{ctx.Locale.Tr "repo.branch.restore" (.DBBranch.Name)}}"> 183 + <span class="text blue"> 184 + {{svg "octicon-reply"}} 185 + </span> 186 + </button> 187 + {{else}} 188 + <button class="btn interact-bg gt-p-3 delete-button delete-branch-button" data-url="{{$.Link}}/delete?name={{.DBBranch.Name}}&page={{$.Page.Paginater.Current}}" data-tooltip-content="{{ctx.Locale.Tr "repo.branch.delete" (.DBBranch.Name)}}" data-name="{{.DBBranch.Name}}"> 189 + {{svg "octicon-trash"}} 181 190 </button> 182 191 {{end}} 183 - {{if and $.IsWriter (not $.IsMirror) (not $.Repository.IsArchived) (not .IsProtected)}} 184 - {{if .DBBranch.IsDeleted}} 185 - <button class="btn interact-bg gt-p-3 link-action restore-branch-button" data-url="{{$.Link}}/restore?branch_id={{.DBBranch.ID}}&name={{.DBBranch.Name}}&page={{$.Page.Paginater.Current}}" data-tooltip-content="{{ctx.Locale.Tr "repo.branch.restore" (.DBBranch.Name)}}"> 186 - <span class="text blue"> 187 - {{svg "octicon-reply"}} 188 - </span> 189 - </button> 190 - {{else}} 191 - <button class="btn interact-bg gt-p-3 delete-button delete-branch-button" data-url="{{$.Link}}/delete?name={{.DBBranch.Name}}&page={{$.Page.Paginater.Current}}" data-tooltip-content="{{ctx.Locale.Tr "repo.branch.delete" (.DBBranch.Name)}}" data-name="{{.DBBranch.Name}}"> 192 - {{svg "octicon-trash"}} 193 - </button> 194 - {{end}} 195 - {{end}} 196 - </td> 197 - </tr> 198 - {{end}} 199 - </tbody> 200 - </table> 201 - </div> 202 - {{template "base/paginate" .}} 203 - {{end}} 192 + {{end}} 193 + </td> 194 + </tr> 195 + {{end}} 196 + </tbody> 197 + </table> 198 + </div> 199 + {{template "base/paginate" .}} 204 200 </div> 205 201 </div> 206 202
+8
templates/repo/commits_search_dropdown.tmpl
··· 1 + <div class="ui small dropdown selection"> 2 + <input name="all" type="hidden" value="{{.All}}">{{svg "octicon-triangle-down" 14 "dropdown icon"}} 3 + <div class="text">{{if .All}}{{ctx.Locale.Tr "repo.commits.search_all"}}{{else}}{{ctx.Locale.Tr "repo.commits.search_branch"}}{{end}}</div> 4 + <div class="menu"> 5 + <div class="item" data-value="false">{{ctx.Locale.Tr "repo.commits.search_branch"}}</div> 6 + <div class="item" data-value="true">{{ctx.Locale.Tr "repo.commits.search_all"}}</div> 7 + </div> 8 + </div>
+16 -16
templates/repo/commits_table.tmpl
··· 8 8 {{ctx.Locale.Tr "repo.commits.no_commits" $.BaseBranch $.HeadBranch}} 9 9 {{end}} 10 10 </div> 11 - <div class="commits-table-right tw-whitespace-nowrap"> 12 - {{if .PageIsCommits}} 13 - <form class="ignore-dirty" action="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/search"> 14 - <div class="ui tiny search input"> 15 - <input name="q" placeholder="{{ctx.Locale.Tr "repo.commits.search"}}" value="{{.Keyword}}" autofocus> 16 - </div> 17 - 18 - <div class="ui tiny checkbox"> 19 - <input type="checkbox" name="all" value="true" {{.All}}> 20 - <label>{{ctx.Locale.Tr "repo.commits.search_all"}}</label> 21 - </div> 22 - <button class="ui primary tiny button gt-mr-0" data-panel="#add-deploy-key-panel" data-tooltip-content={{ctx.Locale.Tr "repo.commits.search.tooltip"}}>{{ctx.Locale.Tr "repo.commits.find"}}</button> 23 - </form> 24 - {{else if .IsDiffCompare}} 11 + {{if .IsDiffCompare}} 12 + <div class="commits-table-right tw-whitespace-nowrap"> 25 13 <a href="{{$.CommitRepoLink}}/commit/{{.BeforeCommitID | PathEscape}}" class="ui green sha label gt-mx-0">{{if not .BaseIsCommit}}{{if .BaseIsBranch}}{{svg "octicon-git-branch"}}{{else if .BaseIsTag}}{{svg "octicon-tag"}}{{end}}{{.BaseBranch}}{{else}}{{ShortSha .BaseBranch}}{{end}}</a> 26 14 ... 27 15 <a href="{{$.CommitRepoLink}}/commit/{{.AfterCommitID | PathEscape}}" class="ui green sha label gt-mx-0">{{if not .HeadIsCommit}}{{if .HeadIsBranch}}{{svg "octicon-git-branch"}}{{else if .HeadIsTag}}{{svg "octicon-tag"}}{{end}}{{.HeadBranch}}{{else}}{{ShortSha .HeadBranch}}{{end}}</a> 28 - {{end}} 29 - </div> 16 + </div> 17 + {{end}} 30 18 </h4> 19 + 20 + {{if .PageIsCommits}} 21 + <div class="ui attached segment"> 22 + <form class="ignore-dirty" action="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/search"> 23 + <div class="ui small fluid action input"> 24 + {{template "shared/search/input" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.commit_kind")}} 25 + {{template "repo/commits_search_dropdown" .}} 26 + {{template "shared/search/button" dict "Tooltip" (ctx.Locale.Tr "repo.commits.search.tooltip")}} 27 + </div> 28 + </form> 29 + </div> 30 + {{end}} 31 31 32 32 {{if and .Commits (gt .CommitCount 0)}} 33 33 {{template "repo/commits_list" .}}
+2 -2
templates/repo/home.tmpl
··· 14 14 <div class="ui repo-search"> 15 15 <form class="ui form ignore-dirty" action="{{.RepoLink}}/search" method="get"> 16 16 <div class="field"> 17 - <div class="ui small action input{{if .CodeIndexerUnavailable}} disabled left icon{{end}}"{{if .CodeIndexerUnavailable}} data-tooltip-content="{{ctx.Locale.Tr "repo.search.code_search_unavailable"}}"{{end}}> 18 - <input name="q" value="{{.Keyword}}"{{if .CodeIndexerUnavailable}} disabled{{end}} placeholder="{{ctx.Locale.Tr "repo.search.search_repo"}}"> 17 + <div class="ui small action input{{if .CodeIndexerUnavailable}} disabled left icon{{end}}"{{if .CodeIndexerUnavailable}} data-tooltip-content="{{ctx.Locale.Tr "search.code_search_unavailable"}}"{{end}}> 18 + <input name="q" value="{{.Keyword}}"{{if .CodeIndexerUnavailable}} disabled{{end}} placeholder="{{ctx.Locale.Tr "search.code_kind"}}"> 19 19 {{if .CodeIndexerUnavailable}} 20 20 <i class="icon">{{svg "octicon-alert"}}</i> 21 21 {{end}}
+2 -2
templates/repo/issue/search.tmpl
··· 9 9 <input type="hidden" name="assignee" value="{{$.AssigneeID}}"> 10 10 <input type="hidden" name="poster" value="{{$.PosterID}}"> 11 11 {{end}} 12 - {{template "shared/searchinput" dict "Value" .Keyword}} 12 + {{template "shared/search/input" dict "Value" .Keyword}} 13 13 {{if .PageIsIssueList}} 14 14 <button id="issue-list-quick-goto" class="ui small icon button gt-hidden" data-tooltip-content="{{ctx.Locale.Tr "explore.go_to"}}" data-repo-link="{{.RepoLink}}">{{svg "octicon-hash"}}</button> 15 15 {{end}} 16 - <button class="ui small icon button" aria-label="{{ctx.Locale.Tr "explore.search"}}">{{svg "octicon-search"}}</button> 16 + {{template "shared/search/button"}} 17 17 </div> 18 18 </form>
+1 -55
templates/repo/search.tmpl
··· 2 2 <div role="main" aria-label="{{.Title}}" class="page-content repository file list"> 3 3 {{template "repo/header" .}} 4 4 <div class="ui container"> 5 - <div class="ui repo-search"> 6 - <form class="ui form ignore-dirty" method="get"> 7 - <div class="ui fluid action input"> 8 - <input name="q" value="{{.Keyword}}"{{if .CodeIndexerUnavailable}} disabled{{end}} placeholder="{{ctx.Locale.Tr "repo.search.search_repo"}}"> 9 - {{if .CodeIndexerEnabled}} 10 - <div class="ui dropdown selection {{if .CodeIndexerUnavailable}} disabled{{end}}" data-tooltip-content="{{ctx.Locale.Tr "repo.search.type.tooltip"}}"> 11 - <input name="t" type="hidden"{{if .CodeIndexerUnavailable}} disabled{{end}} value="{{.queryType}}">{{svg "octicon-triangle-down" 14 "dropdown icon"}} 12 - <div class="text">{{ctx.Locale.Tr (printf "repo.search.%s" (or .queryType "fuzzy"))}}</div> 13 - <div class="menu"> 14 - <div class="item" data-value="" data-tooltip-content="{{ctx.Locale.Tr "repo.search.fuzzy.tooltip"}}">{{ctx.Locale.Tr "repo.search.fuzzy"}}</div> 15 - <div class="item" data-value="match" data-tooltip-content="{{ctx.Locale.Tr "repo.search.match.tooltip"}}">{{ctx.Locale.Tr "repo.search.match"}}</div> 16 - </div> 17 - </div> 18 - {{end}} 19 - <button class="ui icon button"{{if .CodeIndexerUnavailable}} disabled{{end}} type="submit">{{svg "octicon-search" 16}}</button> 20 - </div> 21 - </form> 22 - </div> 23 - {{if .CodeIndexerUnavailable}} 24 - <div class="ui error message"> 25 - <p>{{ctx.Locale.Tr "repo.search.code_search_unavailable"}}</p> 26 - </div> 27 - {{else if .Keyword}} 28 - <h3> 29 - {{ctx.Locale.Tr "repo.search.results" .Keyword .RepoLink .RepoName}} 30 - </h3> 31 - {{if .SearchResults}} 32 - <div class="flex-text-block gt-fw"> 33 - {{range $term := .SearchResultLanguages}} 34 - <a class="ui {{if eq $.Language $term.Language}}primary{{end}} basic label gt-m-0" href="{{$.SourcePath}}/search?q={{$.Keyword}}{{if ne $.Language $term.Language}}&l={{$term.Language}}{{end}}{{if ne $.queryType ""}}&t={{$.queryType}}{{end}}"> 35 - <i class="color-icon gt-mr-3" style="background-color: {{$term.Color}}"></i> 36 - {{$term.Language}} 37 - <div class="detail">{{$term.Count}}</div> 38 - </a> 39 - {{end}} 40 - </div> 41 - <div class="repository search"> 42 - {{range $result := .SearchResults}} 43 - <div class="diff-file-box diff-box file-content non-diff-file-content repo-search-result"> 44 - <h4 class="ui top attached normal header gt-df gt-fw"> 45 - <span class="file gt-f1">{{.Filename}}</span> 46 - <a role="button" class="ui basic tiny button" rel="nofollow" href="{{$.SourcePath}}/src/{{if $.CodeIndexerEnabled}}commit{{else}}branch{{end}}/{{PathEscape $result.CommitID}}/{{PathEscapeSegments .Filename}}">{{ctx.Locale.Tr "repo.diff.view_file"}}</a> 47 - </h4> 48 - <div class="ui attached table segment"> 49 - {{template "shared/searchfile" dict "RepoLink" $.SourcePath "IsIndexer" $.CodeIndexerEnabled "SearchResult" .}} 50 - </div> 51 - {{template "shared/searchbottom" dict "root" $ "result" .}} 52 - </div> 53 - {{end}} 54 - </div> 55 - {{template "base/paginate" .}} 56 - {{else}} 57 - <div>{{ctx.Locale.Tr "repo.search.code_no_results"}}</div> 58 - {{end}} 59 - {{end}} 5 + {{template "shared/search/code/search" .}} 60 6 </div> 61 7 </div> 62 8 {{template "base/footer" .}}
+2 -2
templates/repo/settings/collaboration.tmpl
··· 42 42 <form class="ui form" id="repo-collab-form" action="{{.Link}}" method="post"> 43 43 {{.CsrfTokenHtml}} 44 44 <div id="search-user-box" class="ui search input gt-vm"> 45 - <input class="prompt" name="collaborator" placeholder="{{ctx.Locale.Tr "repo.settings.search_user_placeholder"}}" autocomplete="off" autofocus required> 45 + <input class="prompt" name="collaborator" placeholder="{{ctx.Locale.Tr "search.team_kind"}}" autocomplete="off" autofocus required> 46 46 </div> 47 47 <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.add_collaborator"}}</button> 48 48 </form> ··· 90 90 <form class="ui form" id="repo-collab-team-form" action="{{.Link}}/team" method="post"> 91 91 {{.CsrfTokenHtml}} 92 92 <div id="search-team-box" class="ui search input gt-vm" data-org-name="{{.OrgName}}"> 93 - <input class="prompt" name="team" placeholder="{{ctx.Locale.Tr "repo.settings.search_team"}}" autocomplete="off" autofocus required> 93 + <input class="prompt" name="team" placeholder="{{ctx.Locale.Tr "search.team_kind"}}" autocomplete="off" autofocus required> 94 94 </div> 95 95 <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.add_team"}}</button> 96 96 </form>
+6 -6
templates/repo/settings/protected_branch.tmpl
··· 52 52 <label>{{ctx.Locale.Tr "repo.settings.protect_whitelist_users"}}</label> 53 53 <div class="ui multiple search selection dropdown"> 54 54 <input type="hidden" name="whitelist_users" value="{{.whitelist_users}}"> 55 - <div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_users"}}</div> 55 + <div class="default text">{{ctx.Locale.Tr "search.user_kind"}}</div> 56 56 <div class="menu"> 57 57 {{range .Users}} 58 58 <div class="item" data-value="{{.ID}}"> ··· 67 67 <label>{{ctx.Locale.Tr "repo.settings.protect_whitelist_teams"}}</label> 68 68 <div class="ui multiple search selection dropdown"> 69 69 <input type="hidden" name="whitelist_teams" value="{{.whitelist_teams}}"> 70 - <div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div> 70 + <div class="default text">{{ctx.Locale.Tr "search.team_kind"}}</div> 71 71 <div class="menu"> 72 72 {{range .Teams}} 73 73 <div class="item" data-value="{{.ID}}"> ··· 113 113 <label>{{ctx.Locale.Tr "repo.settings.protect_approvals_whitelist_users"}}</label> 114 114 <div class="ui multiple search selection dropdown"> 115 115 <input type="hidden" name="approvals_whitelist_users" value="{{.approvals_whitelist_users}}"> 116 - <div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_users"}}</div> 116 + <div class="default text">{{ctx.Locale.Tr "search.user_kind"}}</div> 117 117 <div class="menu"> 118 118 {{range .Users}} 119 119 <div class="item" data-value="{{.ID}}"> ··· 128 128 <label>{{ctx.Locale.Tr "repo.settings.protect_approvals_whitelist_teams"}}</label> 129 129 <div class="ui multiple search selection dropdown"> 130 130 <input type="hidden" name="approvals_whitelist_teams" value="{{.approvals_whitelist_teams}}"> 131 - <div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div> 131 + <div class="default text">{{ctx.Locale.Tr "search.team_kind"}}</div> 132 132 <div class="menu"> 133 133 {{range .Teams}} 134 134 <div class="item" data-value="{{.ID}}"> ··· 210 210 <label>{{ctx.Locale.Tr "repo.settings.protect_merge_whitelist_users"}}</label> 211 211 <div class="ui multiple search selection dropdown"> 212 212 <input type="hidden" name="merge_whitelist_users" value="{{.merge_whitelist_users}}"> 213 - <div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_users"}}</div> 213 + <div class="default text">{{ctx.Locale.Tr "search.user_kind"}}</div> 214 214 <div class="menu"> 215 215 {{range .Users}} 216 216 <div class="item" data-value="{{.ID}}"> ··· 225 225 <label>{{ctx.Locale.Tr "repo.settings.protect_merge_whitelist_teams"}}</label> 226 226 <div class="ui multiple search selection dropdown"> 227 227 <input type="hidden" name="merge_whitelist_teams" value="{{.merge_whitelist_teams}}"> 228 - <div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div> 228 + <div class="default text">{{ctx.Locale.Tr "search.team_kind"}}</div> 229 229 <div class="menu"> 230 230 {{range .Teams}} 231 231 <div class="item" data-value="{{.ID}}">
+2 -2
templates/repo/settings/tags.tmpl
··· 28 28 <label>{{ctx.Locale.Tr "repo.settings.tags.protection.allowed.users"}}</label> 29 29 <div class="ui multiple search selection dropdown"> 30 30 <input type="hidden" name="allowlist_users" value="{{.allowlist_users}}"> 31 - <div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_users"}}</div> 31 + <div class="default text">{{ctx.Locale.Tr "search.user_kind"}}</div> 32 32 <div class="menu"> 33 33 {{range .Users}} 34 34 <div class="item" data-value="{{.ID}}"> ··· 43 43 <label>{{ctx.Locale.Tr "repo.settings.tags.protection.allowed.teams"}}</label> 44 44 <div class="ui multiple search selection dropdown"> 45 45 <input type="hidden" name="allowlist_teams" value="{{.allowlist_teams}}"> 46 - <div class="default text">{{ctx.Locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div> 46 + <div class="default text">{{ctx.Locale.Tr "search.team_kind"}}</div> 47 47 <div class="menu"> 48 48 {{range .Teams}} 49 49 <div class="item" data-value="{{.ID}}">
+1 -5
templates/shared/actions/runner_list.tmpl
··· 33 33 </h4> 34 34 <div class="ui attached segment"> 35 35 <form class="ui form ignore-dirty" id="user-list-search-form" action="{{$.Link}}"> 36 - <!-- Search Text --> 37 - <div class="ui fluid action input"> 38 - {{template "shared/searchinput" dict "Value" .Keyword}} 39 - <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button> 40 - </div> 36 + {{template "shared/search/combo" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.runner_kind")}} 41 37 </form> 42 38 </div> 43 39 <div class="ui attached table segment">
+1 -1
templates/shared/issuelist.tmpl
··· 153 153 {{end}} 154 154 {{if .IssueIndexerUnavailable}} 155 155 <div class="ui error message"> 156 - <p>{{ctx.Locale.Tr "repo.issues.keyword_search_unavailable"}}</p> 156 + <p>{{ctx.Locale.Tr "search.keyword_search_unavailable"}}</p> 157 157 </div> 158 158 {{end}} 159 159 </div>
+8 -7
templates/shared/repo_search.tmpl
··· 1 - <div class="ui secondary filter menu"> 2 - <form id="repo-search-form" class="ui form ignore-dirty tw-flex-1 tw-flex tw-flex-row tw-gap-x-2"> 1 + <div class="ui small secondary filter menu"> 2 + <form id="repo-search-form" class="ui form ignore-dirty tw-flex-1 tw-flex tw-flex-row tw-gap-x-2 gt-ac"> 3 3 {{if .Language}}<input hidden name="language" value="{{.Language}}">{{end}} 4 4 {{if .TopicOnly}}<input hidden name="topic" value="{{.TopicOnly}}">{{end}} 5 - <div class="ui fluid action input tw-flex-1"> 6 - {{template "shared/searchinput" dict "Value" .Keyword}} 5 + <div class="ui small fluid action input tw-flex-1"> 6 + {{template "shared/search/input" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.repo_kind")}} 7 7 {{if .PageIsExploreRepositories}} 8 8 <input type="hidden" name="only_show_relevant" value="{{.OnlyShowRelevant}}"> 9 9 {{else if .TabName}} 10 10 <input type="hidden" name="tab" value="{{.TabName}}"> 11 11 {{end}} 12 - <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button> 12 + {{template "shared/search/button"}} 13 13 </div> 14 14 <!-- Filter --> 15 - <div class="ui dropdown type jump item tw-mr-0"> 15 + <div class="ui small dropdown type jump item tw-mr-0"> 16 16 <span class="text"> 17 17 {{ctx.Locale.Tr "filter"}} 18 18 </span> ··· 37 37 </div> 38 38 </div> 39 39 <!-- Sort --> 40 - <div class="ui dropdown type jump item gt-mr-0"> 40 + <div class="ui small dropdown type jump item gt-mr-0"> 41 41 <span class="text"> 42 42 {{ctx.Locale.Tr "repo.issues.filter_sort"}} 43 43 </span> ··· 66 66 <span data-tooltip-content="{{ctx.Locale.Tr "explore.relevant_repositories_tooltip"}}">{{ctx.Locale.Tr "explore.relevant_repositories" (printf "?only_show_relevant=0&sort=%s&q=%s&language=%s" $.SortType (QueryEscape $.Keyword) (QueryEscape $.Language))}}</span> 67 67 </div> 68 68 {{end}} 69 + <div class="divider"></div>
+3
templates/shared/search/button.tmpl
··· 1 + {{/* Disable (optional) - if search button has to be disabled */}} 2 + {{/* Tooltip (optional) - a tooltip to be displayed on hover */}} 3 + <button class="ui small icon button" aria-label="{{ctx.Locale.Tr "search.search"}}" {{with .Tooltip}}data-tooltip-content="{{.}}"{{end}}{{if .Disabled}} disabled{{end}}>{{svg "octicon-search"}}</button>
+15
templates/shared/search/code/search.tmpl
··· 1 + <form class="ui form ignore-dirty"> 2 + {{template "shared/search/combo_fuzzy" dict "Value" .Keyword "Disabled" .CodeIndexerUnavailable "IsFuzzy" .IsFuzzy "Placeholder" (ctx.Locale.Tr "search.code_kind")}} 3 + </form> 4 + <div class="divider"></div> 5 + <div class="ui user list"> 6 + {{if .CodeIndexerUnavailable}} 7 + <div class="ui error message"> 8 + <p>{{ctx.Locale.Tr "search.code_search_unavailable"}}</p> 9 + </div> 10 + {{else if .SearchResults}} 11 + {{template "shared/search/code/results" .}} 12 + {{else if .Keyword}} 13 + <div>{{ctx.Locale.Tr "search.no_results"}}</div> 14 + {{end}} 15 + </div>
+8
templates/shared/search/combo.tmpl
··· 1 + {{/* Value - value of the search field (for search results page) */}} 2 + {{/* Disabled (optional) - if search field/button has to be disabled */}} 3 + {{/* Placeholder (optional) - placeholder text to be used */}} 4 + {{/* Tooltip (optional) - a tooltip to be displayed on button hover */}} 5 + <div class="ui small fluid action input"> 6 + {{template "shared/search/input" dict "Value" .Value "Disabled" .Disabled "Placeholder" .Placeholder}} 7 + {{template "shared/search/button" dict "Disabled" .Disabled "Tooltip" .Tooltip}} 8 + </div>
+10
templates/shared/search/combo_fuzzy.tmpl
··· 1 + {{/* Value - value of the search field (for search results page) */}} 2 + {{/* Disabled (optional) - if search field/button has to be disabled */}} 3 + {{/* Placeholder (optional) - placeholder text to be used */}} 4 + {{/* IsFuzzy - state of the fuzzy search toggle */}} 5 + {{/* Tooltip (optional) - a tooltip to be displayed on button hover */}} 6 + <div class="ui small fluid action input"> 7 + {{template "shared/search/input" dict "Value" .Value "Disabled" .Disabled "Placeholder" .Placeholder}} 8 + {{template "shared/search/fuzzy" dict "Disabled" .Disabled "IsFuzzy" .IsFuzzy}} 9 + {{template "shared/search/button" dict "Disabled" .Disabled "Tooltip" .Tooltip}} 10 + </div>
+10
templates/shared/search/fuzzy.tmpl
··· 1 + {{/* Disabled (optional) - if dropdown has to be disabled */}} 2 + {{/* IsFuzzy - state of the fuzzy search toggle */}} 3 + <div class="ui small dropdown selection {{if .Disabled}} disabled{{end}}" data-tooltip-content="{{ctx.Locale.Tr "search.type_tooltip"}}"> 4 + <input name="fuzzy" type="hidden"{{if .Disabled}} disabled{{end}} value="{{.IsFuzzy}}">{{svg "octicon-triangle-down" 14 "dropdown icon"}} 5 + <div class="text">{{if .IsFuzzy}}{{ctx.Locale.Tr "search.fuzzy"}}{{else}}{{ctx.Locale.Tr "search.match"}}{{end}}</div> 6 + <div class="menu"> 7 + <div class="item" data-value="true" data-tooltip-content="{{ctx.Locale.Tr "search.fuzzy_tooltip"}}">{{ctx.Locale.Tr "search.fuzzy"}}</div> 8 + <div class="item" data-value="false" data-tooltip-content="{{ctx.Locale.Tr "search.match_tooltip"}}">{{ctx.Locale.Tr "search.match"}}</div> 9 + </div> 10 + </div>
+4
templates/shared/search/input.tmpl
··· 1 + {{/* Value - value of the search field (for search results page) */}} 2 + {{/* Disabled (optional) - if search field has to be disabled */}} 3 + {{/* Placeholder (optional) - placeholder text to be used */}} 4 + <input type="search" spellcheck="false" name="q" maxlength="255" placeholder="{{with .Placeholder}}{{.}}{{else}}{{ctx.Locale.Tr "search.search"}}{{end}}"{{with .Value}} value="{{.}}"{{end}}{{if .Disabled}} disabled{{end}}>
-1
templates/shared/searchinput.tmpl
··· 1 - <input type="search" spellcheck="false" name="q" maxlength="255" placeholder="{{ctx.Locale.Tr "explore.search"}}…"{{if .Value}} value="{{.Value}}"{{end}}{{if .Disabled}} disabled{{end}}>
+2 -2
templates/user/code.tmpl
··· 3 3 <div role="main" aria-label="{{.Title}}" class="page-content organization code"> 4 4 {{template "org/header" .}} 5 5 <div class="ui container"> 6 - {{template "code/searchcombo" .}} 6 + {{template "shared/search/code/search" .}} 7 7 </div> 8 8 </div> 9 9 {{else}} ··· 15 15 </div> 16 16 <div class="ui twelve wide column"> 17 17 {{template "user/overview/header" .}} 18 - {{template "code/searchcombo" .}} 18 + {{template "shared/search/code/search" .}} 19 19 </div> 20 20 </div> 21 21 </div>
+2 -2
templates/user/dashboard/issues.tmpl
··· 50 50 <input type="hidden" name="type" value="{{$.ViewType}}"> 51 51 <input type="hidden" name="sort" value="{{$.SortType}}"> 52 52 <input type="hidden" name="state" value="{{$.State}}"> 53 - {{template "shared/searchinput" dict "Value" $.Keyword}} 53 + {{template "shared/search/input" dict "Value" $.Keyword}} 54 54 <button id="issue-list-quick-goto" class="ui small icon button gt-hidden" data-tooltip-content="{{ctx.Locale.Tr "explore.go_to"}}">{{svg "octicon-hash"}}</button> 55 - <button class="ui small icon button" aria-label="{{ctx.Locale.Tr "explore.search"}}">{{svg "octicon-search"}}</button> 55 + {{template "shared/search/button"}} 56 56 </div> 57 57 </form> 58 58 <!-- Sort -->
+2 -5
templates/user/dashboard/milestones.tmpl
··· 46 46 </a> 47 47 </div> 48 48 <form class="list-header-search ui form ignore-dirty"> 49 - <div class="ui small search fluid action input"> 50 - <input type="hidden" name="type" value="{{$.ViewType}}"> 49 + <input type="hidden" name="type" value="{{$.ViewType}}"> 51 50 <input type="hidden" name="repos" value="[{{range $.RepoIDs}}{{.}},{{end}}]"> 52 51 <input type="hidden" name="sort" value="{{$.SortType}}"> 53 52 <input type="hidden" name="state" value="{{$.State}}"> 54 - {{template "shared/searchinput" dict "Value" $.Keyword}} 55 - <button class="ui small icon button" type="submit" aria-label="{{ctx.Locale.Tr "explore.search"}}">{{svg "octicon-search"}}</button> 56 - </div> 53 + {{template "shared/search/combo" dict "Value" $.Keyword}} 57 54 </form> 58 55 <!-- Sort --> 59 56 <div class="list-header-sort ui dropdown type jump item">
+1 -1
templates/user/dashboard/repolist.tmpl
··· 6 6 isStarsEnabled: {{not .IsDisableStars}}, 7 7 8 8 textMyRepos: {{ctx.Locale.Tr "home.my_repos"}}, 9 - textSearchRepos: {{ctx.Locale.Tr "home.search_repos"}}, 9 + textSearchRepos: {{ctx.Locale.Tr "search.repo_kind"}}, 10 10 textFilter: {{ctx.Locale.Tr "home.filter"}}, 11 11 textShowArchived: {{ctx.Locale.Tr "home.show_archived"}}, 12 12 textShowPrivate: {{ctx.Locale.Tr "home.show_private"}},
+16 -10
web_src/css/base.css
··· 277 277 .ui.action.input:not([class*="left action"]) > .ui.dropdown.selection { 278 278 min-width: 10em; 279 279 } 280 - 281 - .ui.action.input:not([class*="left action"]) > .ui.dropdown.selection:not(:focus,:hover) { 282 - border-right-color: transparent; 280 + .ui.action.input:not([class*="left action"]) > .ui.dropdown.selection:not(:focus) { 281 + border-right: none; 282 + } 283 + .ui.action.input:not([class*="left action"]) > .ui.dropdown.selection:not(.active):hover { 284 + border-color: var(--color-input-border); 283 285 } 284 - 286 + .ui.action.input:not([class*="left action"]) .ui.dropdown.selection.upward.visible { 287 + border-bottom-left-radius: 0 !important; 288 + border-bottom-right-radius: 0 !important; 289 + } 285 290 .ui.action.input:not([class*="left action"]) > input, 286 291 .ui.action.input:not([class*="left action"]) > input:hover { 287 - border-right: 1px solid transparent; 292 + border-right: none; 293 + } 294 + .ui.action.input:not([class*="left action"]) > input:focus + .ui.dropdown.selection, 295 + .ui.action.input:not([class*="left action"]) > input:focus + .ui.dropdown.selection:hover, 296 + .ui.action.input:not([class*="left action"]) > input:focus + .button, 297 + .ui.action.input:not([class*="left action"]) > input:focus + .button:hover { 298 + border-left-color: var(--color-primary); 288 299 } 289 - 290 300 .ui.action.input:not([class*="left action"]) > input:focus { 291 301 border-right-color: var(--color-primary); 292 302 } ··· 536 546 .ui.selection.active.dropdown .menu, 537 547 .ui.selection.active.dropdown:hover .menu { 538 548 border-color: var(--color-primary); 539 - } 540 - 541 - .ui.selection.dropdown .menu { 542 - margin: 0 -1.25px; 543 549 } 544 550 545 551 .ui.pointing.dropdown > .menu:not(.hidden)::after {
+5
web_src/css/form.css
··· 41 41 color: var(--color-input-text); 42 42 } 43 43 44 + /* fix fomantic small dropdown having inconsistent padding with input */ 45 + .ui.small.selection.dropdown { 46 + padding: .67857143em 3.2em .67857143em 1em; 47 + } 48 + 44 49 input:hover, 45 50 textarea:hover, 46 51 .ui.input input:hover,