my-gitea-templates/templates/repo/ view_list.tmpl
79 lines
3.3 KiB

  1. {{/*
  2. {{if .LatestCommit.Author}}{{TimeSince .LatestCommit.Author.When $.Lang}}{{end}}
  3. <td class="message collapsing has-emoji">
  4. {{RenderCommitMessageLink $commit.Summary $.RepoLink (print $.RepoLink "/commit/" $commit.ID) $.Repository.ComposeMetas}}
  5. </td>
  6. */}}
  7. <h4 class="ui top attached header">
  8. {{ $n := len .TreeNames}}
  9. {{ $l := Subtract $n 1}}
  10. <span class="ui breadcrumb repo-path"><a class="section" href="{{.RepoLink}}/src/{{EscapePound .BranchNameSubURL}}">{{EllipsisString .Repository.Name 30}}</a>{{range $i, $v := .TreeNames}}<span class="divider">/</span>{{if eq $i $l}}<span class="active section">{{EllipsisString $v 30}}</span>{{else}}{{ $p := index $.Paths $i}}<span class="section"><a href="{{EscapePound $.BranchLink}}/{{EscapePound $p}}">{{EllipsisString $v 30}}</a></span>{{end}}{{end}}</span>
  11. <div class="ui right sub header">
  12. Latest commit:
  13. <a rel="nofollow" href="{{.RepoLink}}/commit/{{.LatestCommit.ID}}">
  14. <span class="grey has-emoji">
  15. {{RenderCommitMessage .LatestCommit.Summary .RepoLink $.Repository.ComposeMetas}}
  16. {{if IsMultilineCommitMessage .LatestCommit.Message}}
  17. <button class="basic compact mini ui icon button commit-button"><i class="ellipsis horizontal icon"></i></button>
  18. <pre class="commit-body" style="display: none;">{{RenderCommitBody .LatestCommit.Message $.RepoLink $.Repository.ComposeMetas}}</pre>
  19. {{end}}
  20. {{template "repo/commit_status" .LatestCommitStatus}}
  21. </span>
  22. </a>
  23. <span style="margin-left: 1em;">
  24. {{if .LatestCommit.Author}}{{TimeSince .LatestCommit.Author.When $.Lang}}{{end}}
  25. </span>
  26. </div>
  27. </h4>
  28. <table id="repo-files-table" class="ui fixed single line attached table">
  29. <tbody>
  30. {{if .HasParentPath}}
  31. <tr class="has-parent">
  32. <td colspan="2"><a href="{{EscapePound .BranchLink}}{{.ParentPath}}"><i class="octicon octicon-mail-reply"></i> ..</a></td>
  33. </tr>
  34. {{end}}
  35. {{range $item := .Files}}
  36. {{$entry := index $item 0}}
  37. {{$commit := index $item 1}}
  38. <tr>
  39. {{if $entry.IsSubModule}}
  40. <td>
  41. <span class="octicon octicon-file-submodule"></span>
  42. {{$refURL := $commit.RefURL AppUrl $.BranchLink}}
  43. {{if $refURL}}
  44. <a href="{{$refURL}}">{{$entry.Name}}</a> @ <a href="{{$refURL}}/commit/{{$commit.RefID}}">{{ShortSha $commit.RefID}}</a>
  45. {{else}}
  46. {{$entry.Name}} @ {{ShortSha $commit.RefID}}
  47. {{end}}
  48. </td>
  49. {{else}}
  50. <td class="name">
  51. {{if $entry.IsDir}}
  52. {{$subJumpablePathName := $entry.GetSubJumpablePathName}}
  53. {{$subJumpablePath := SubJumpablePath $subJumpablePathName}}
  54. <span class="octicon octicon-file-directory"></span>
  55. <a href="{{EscapePound $.TreeLink}}/{{EscapePound $subJumpablePathName}}">
  56. {{if eq (len $subJumpablePath) 2}}
  57. <span class="jumpable-path">{{index $subJumpablePath 0}}</span>{{index $subJumpablePath 1}}
  58. {{else}}
  59. {{index $subJumpablePath 0}}
  60. {{end}}
  61. </a>
  62. {{else}}
  63. <span class="octicon octicon-{{EntryIcon $entry}}"></span>
  64. <a href="{{EscapePound $.TreeLink}}/{{EscapePound $entry.Name}}">{{$entry.Name}}</a>
  65. {{end}}
  66. </td>
  67. {{end}}
  68. <td class="text grey right age">{{TimeSince $commit.Committer.When $.Lang}}</td>
  69. </tr>
  70. {{end}}
  71. </tbody>
  72. </table>
  73. {{if .ReadmeExist}}
  74. {{template "repo/view_file" .}}
  75. {{end}}