-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Don't do a full page load when searching code #29138
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
75ac21e
enhancement: Don't do a full page load when searching in repo
zokkis 2b57f1c
enhancement: use same url
zokkis b61968e
enhancement: htmx for user/code
zokkis 8d514df
enhancement: htmx for explore/code
zokkis 491b66d
fix: don't replace complete searchcombo
zokkis 6fc98e6
fix: replace paginator with htmx
zokkis 8285bf3
fix: show empty page, when no keyword is given
zokkis 56461b9
enhancement: folding
zokkis 7ffd7e3
chore: linting
zokkis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<div id="search-body"> | ||
<div class="ui user list"> | ||
{{if .CodeIndexerUnavailable}} | ||
<div class="ui error message"> | ||
<p>{{ctx.Locale.Tr "explore.code_search_unavailable"}}</p> | ||
</div> | ||
{{else}} | ||
{{template "code/searchresults" .}} | ||
{{end}} | ||
</div> | ||
{{template "base/paginate" .}} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,3 @@ | ||
{{template "code/searchform" .}} | ||
<div class="divider"></div> | ||
<div class="ui user list"> | ||
{{if .CodeIndexerUnavailable}} | ||
<div class="ui error message"> | ||
<p>{{ctx.Locale.Tr "explore.code_search_unavailable"}}</p> | ||
</div> | ||
{{else if .SearchResults}} | ||
<h3> | ||
{{ctx.Locale.Tr "explore.code_search_results" (.Keyword|Escape) | Str2html}} | ||
</h3> | ||
{{template "code/searchresults" .}} | ||
{{else if .Keyword}} | ||
<div>{{ctx.Locale.Tr "explore.code_no_results"}}</div> | ||
{{end}} | ||
</div> | ||
{{template "base/paginate" .}} | ||
{{template "code/search_body" .}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{{if .Keyword}} | ||
<h3> | ||
{{ctx.Locale.Tr "repo.search.results" (.Keyword|Escape) (.RepoLink|Escape) (.RepoName|Escape) | Str2html}} | ||
</h3> | ||
{{if .SearchResults}} | ||
<div class="flex-text-block gt-fw"> | ||
{{range $term := .SearchResultLanguages}} | ||
<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}}"> | ||
<i class="color-icon gt-mr-3" style="background-color: {{$term.Color}}"></i> | ||
{{$term.Language}} | ||
<div class="detail">{{$term.Count}}</div> | ||
</a> | ||
{{end}} | ||
</div> | ||
<div class="repository search"> | ||
{{range $result := .SearchResults}} | ||
<div class="diff-file-box fold-container diff-box repo-search-result"> | ||
<h4 class="ui top attached normal header gt-df gt-fw"> | ||
<button class="fold-button btn interact-bg gt-mr-2 gt-p-2">{{svg "octicon-chevron-down" 18}}</button> | ||
<span class="file gt-f1">{{.Filename}}</span> | ||
<a role="button" class="ui basic tiny button" rel="nofollow" href="{{$.SourcePath}}/src/commit/{{PathEscape $result.CommitID}}/{{PathEscapeSegments .Filename}}">{{ctx.Locale.Tr "repo.diff.view_file"}}</a> | ||
</h4> | ||
<div class="fold-body"> | ||
<div class="ui attached table segment"> | ||
<div class="file-body file-code code-view"> | ||
<table> | ||
<tbody> | ||
<tr> | ||
<td class="lines-num"> | ||
{{range .LineNumbers}} | ||
<a href="{{$.SourcePath}}/src/commit/{{PathEscape $result.CommitID}}/{{PathEscapeSegments $result.Filename}}#L{{.}}"><span>{{.}}</span></a> | ||
{{end}} | ||
</td> | ||
<td class="lines-code chroma"><code class="code-inner">{{.FormattedLines}}</code></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
{{template "shared/searchbottom" dict "root" $ "result" .}} | ||
</div> | ||
</div> | ||
{{end}} | ||
</div> | ||
{{template "base/paginate" .}} | ||
{{else}} | ||
<div>{{ctx.Locale.Tr "repo.search.code_no_results"}}</div> | ||
{{end}} | ||
{{end}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.