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.

Fix 'View File' button in code search (#23478)

- Right-align 'View File' button
- Add 'role' attribute to button link

Before:
<img width="1148" alt="Screenshot 2023-03-14 at 22 02 16"
src="https://user-images.githubusercontent.com/115237/225135954-f06153ec-c222-441e-98ba-0177afff3a7a.png">

After:
<img width="1150" alt="Screenshot 2023-03-14 at 22 02 33"
src="https://user-images.githubusercontent.com/115237/225135966-323cb695-05ef-4b83-a8ef-05f2b1887090.png">

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>

authored by

silverwind
Lunny Xiao
and committed by
GitHub
bf730528 ea1b9262

+6 -6
+3 -3
templates/code/searchresults.tmpl
··· 11 11 {{range $result := .SearchResults}} 12 12 {{$repo := (index $.RepoMaps .RepoID)}} 13 13 <div class="diff-file-box diff-box file-content non-diff-file-content repo-search-result"> 14 - <h4 class="ui top attached normal header"> 15 - <span class="file"> 14 + <h4 class="ui top attached normal header gt-df gt-fw"> 15 + <span class="file gt-f1"> 16 16 <a rel="nofollow" href="{{$repo.Link}}">{{$repo.FullName}}</a> 17 17 {{if $repo.IsArchived}} 18 18 <span class="ui basic label">{{$.locale.Tr "repo.desc.archived"}}</span> 19 19 {{end}} 20 20 - {{.Filename}} 21 21 </span> 22 - <a class="ui basic tiny button" rel="nofollow" href="{{$repo.Link}}/src/commit/{{$result.CommitID | PathEscape}}/{{.Filename | PathEscapeSegments}}">{{$.locale.Tr "repo.diff.view_file"}}</a> 22 + <a role="button" class="ui basic tiny button" rel="nofollow" href="{{$repo.Link}}/src/commit/{{$result.CommitID | PathEscape}}/{{.Filename | PathEscapeSegments}}">{{$.locale.Tr "repo.diff.view_file"}}</a> 23 23 </h4> 24 24 <div class="ui attached table segment"> 25 25 <div class="file-body file-code code-view">
+3 -3
templates/repo/search.tmpl
··· 39 39 <div class="repository search"> 40 40 {{range $result := .SearchResults}} 41 41 <div class="diff-file-box diff-box file-content non-diff-file-content repo-search-result"> 42 - <h4 class="ui top attached normal header"> 43 - <span class="file">{{.Filename}}</span> 44 - <a class="ui basic tiny button" rel="nofollow" href="{{$.SourcePath}}/src/commit/{{PathEscape $result.CommitID}}/{{PathEscapeSegments .Filename}}">{{$.locale.Tr "repo.diff.view_file"}}</a> 42 + <h4 class="ui top attached normal header gt-df gt-fw"> 43 + <span class="file gt-f1">{{.Filename}}</span> 44 + <a role="button" class="ui basic tiny button" rel="nofollow" href="{{$.SourcePath}}/src/commit/{{PathEscape $result.CommitID}}/{{PathEscapeSegments .Filename}}">{{$.locale.Tr "repo.diff.view_file"}}</a> 45 45 </h4> 46 46 <div class="ui attached table segment"> 47 47 <div class="file-body file-code code-view">