]> source.dussan.org Git - gitea.git/commitdiff
Add archived label for code search results in archived repo's (#17817)
authorJimmy Praet <jimmy.praet@telenet.be>
Fri, 26 Nov 2021 08:49:31 +0000 (09:49 +0100)
committerGitHub <noreply@github.com>
Fri, 26 Nov 2021 08:49:31 +0000 (16:49 +0800)
* Add archived label for code search results in archived repo's

* Remove trailing whitespace

Co-authored-by: Lauris BH <lauris@nix.lv>
templates/explore/code.tmpl

index 29d4075cce3d1f6227dd51087c54bd17739801e3..573c096f83f0ee9899aa614ea8b7c297289e8e2d 100644 (file)
                                                {{$repo := (index $.RepoMaps .RepoID)}}
                                                <div class="diff-file-box diff-box file-content non-diff-file-content repo-search-result">
                                                        <h4 class="ui top attached normal header">
-                                                               <span class="file"><a rel="nofollow" href="{{$repo.HTMLURL}}">{{$repo.FullName}}</a> - {{.Filename}}</span>
+                                                               <span class="file">
+                                                                       <a rel="nofollow" href="{{$repo.HTMLURL}}">{{$repo.FullName}}</a>
+                                                                               {{if $repo.IsArchived}}
+                                                                                       <span class="ui basic label">{{$.i18n.Tr "repo.desc.archived"}}</span>
+                                                                               {{end}}
+                                                                       - {{.Filename}}
+                                                               </span>
                                                                <a class="ui basic tiny button" rel="nofollow" href="{{$repo.HTMLURL}}/src/commit/{{$result.CommitID | PathEscape}}/{{.Filename | PathEscapeSegments}}">{{$.i18n.Tr "repo.diff.view_file"}}</a>
                                                        </h4>
                                                        <div class="ui attached table segment">