You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

searchresults.tmpl 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <div class="gt-df gt-ac gt-fw">
  2. {{range $term := .SearchResultLanguages}}
  3. <a class="ui text-label gt-df gt-ac gt-mr-1 gt-my-1 {{if eq $.Language $term.Language}}primary {{end}}basic label" 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}}">
  4. <i class="color-icon gt-mr-3" style="background-color: {{$term.Color}}"></i>
  5. {{$term.Language}}
  6. <div class="detail">{{$term.Count}}</div>
  7. </a>
  8. {{end}}
  9. </div>
  10. <div class="repository search">
  11. {{range $result := .SearchResults}}
  12. {{$repo := (index $.RepoMaps .RepoID)}}
  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 gt-df gt-fw">
  15. <span class="file gt-f1">
  16. <a rel="nofollow" href="{{$repo.Link}}">{{$repo.FullName}}</a>
  17. {{if $repo.IsArchived}}
  18. <span class="ui basic label">{{$.locale.Tr "repo.desc.archived"}}</span>
  19. {{end}}
  20. - {{.Filename}}
  21. </span>
  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. </h4>
  24. <div class="ui attached table segment">
  25. <div class="file-body file-code code-view">
  26. <table>
  27. <tbody>
  28. <tr>
  29. <td class="lines-num">
  30. {{range .LineNumbers}}
  31. <a href="{{$repo.Link}}/src/commit/{{$result.CommitID | PathEscape}}/{{$result.Filename | PathEscapeSegments}}#L{{.}}"><span>{{.}}</span></a>
  32. {{end}}
  33. </td>
  34. <td class="lines-code chroma"><code class="code-inner">{{.FormattedLines | Safe}}</code></td>
  35. </tr>
  36. </tbody>
  37. </table>
  38. </div>
  39. </div>
  40. {{template "shared/searchbottom" dict "root" $ "result" .}}
  41. </div>
  42. {{end}}
  43. </div>