選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

feeds.tmpl 8.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <div id="activity-feed" class="flex-list">
  2. {{range .Feeds}}
  3. <div class="flex-item">
  4. <div class="flex-item-leading">
  5. {{ctx.AvatarUtils.AvatarByAction .}}
  6. </div>
  7. <div class="flex-item-main tw-gap-2">
  8. {{if .IsPrivateView}}
  9. <div>
  10. {{if gt .ActUser.ID 0}}
  11. <a href="{{AppSubUrl}}/{{(.GetActUserName ctx) | PathEscape}}" title="{{.GetActDisplayNameTitle ctx}}">{{.GetActDisplayName ctx}}</a>
  12. {{else}}
  13. {{.ShortActUserName ctx}}
  14. {{end}}
  15. {{$pushLength := 1}}
  16. {{if .GetOpType.InActions "commit_repo" "mirror_sync_push"}}
  17. {{$commitLength := (ActionContent2Commits .).Len}}
  18. {{if gt $commitLength $pushLength}}
  19. {{$pushLength = $commitLength}}
  20. {{end}}
  21. {{end}}
  22. {{ctx.Locale.TrN $pushLength "action.performed_1" "action.performed_n" $pushLength}}
  23. {{TimeSince .GetCreate ctx.Locale}}
  24. </div>
  25. {{else}}
  26. <div>
  27. {{if gt .ActUser.ID 0}}
  28. <a href="{{AppSubUrl}}/{{(.GetActUserName ctx) | PathEscape}}" title="{{.GetActDisplayNameTitle ctx}}">{{.GetActDisplayName ctx}}</a>
  29. {{else}}
  30. {{.ShortActUserName ctx}}
  31. {{end}}
  32. {{if .GetOpType.InActions "create_repo"}}
  33. {{ctx.Locale.Tr "action.create_repo" (.GetRepoLink ctx) (.ShortRepoPath ctx)}}
  34. {{else if .GetOpType.InActions "rename_repo"}}
  35. {{ctx.Locale.Tr "action.rename_repo" .GetContent (.GetRepoLink ctx) (.ShortRepoPath ctx)}}
  36. {{else if .GetOpType.InActions "commit_repo"}}
  37. {{if .Content}}
  38. {{ctx.Locale.Tr "action.commit_repo" (.GetRepoLink ctx) (.GetRefLink ctx) .GetBranch (.ShortRepoPath ctx)}}
  39. {{else}}
  40. {{ctx.Locale.Tr "action.create_branch" (.GetRepoLink ctx) (.GetRefLink ctx) .GetBranch (.ShortRepoPath ctx)}}
  41. {{end}}
  42. {{else if .GetOpType.InActions "create_issue"}}
  43. {{$index := index .GetIssueInfos 0}}
  44. {{ctx.Locale.Tr "action.create_issue" (printf "%s/issues/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
  45. {{else if .GetOpType.InActions "create_pull_request"}}
  46. {{$index := index .GetIssueInfos 0}}
  47. {{ctx.Locale.Tr "action.create_pull_request" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
  48. {{else if .GetOpType.InActions "transfer_repo"}}
  49. {{ctx.Locale.Tr "action.transfer_repo" .GetContent (.GetRepoLink ctx) (.ShortRepoPath ctx)}}
  50. {{else if .GetOpType.InActions "push_tag"}}
  51. {{ctx.Locale.Tr "action.push_tag" (.GetRepoLink ctx) (.GetRefLink ctx) .GetTag (.ShortRepoPath ctx)}}
  52. {{else if .GetOpType.InActions "comment_issue"}}
  53. {{$index := index .GetIssueInfos 0}}
  54. {{ctx.Locale.Tr "action.comment_issue" (printf "%s/issues/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
  55. {{else if .GetOpType.InActions "merge_pull_request"}}
  56. {{$index := index .GetIssueInfos 0}}
  57. {{ctx.Locale.Tr "action.merge_pull_request" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
  58. {{else if .GetOpType.InActions "close_issue"}}
  59. {{$index := index .GetIssueInfos 0}}
  60. {{ctx.Locale.Tr "action.close_issue" (printf "%s/issues/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
  61. {{else if .GetOpType.InActions "reopen_issue"}}
  62. {{$index := index .GetIssueInfos 0}}
  63. {{ctx.Locale.Tr "action.reopen_issue" (printf "%s/issues/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
  64. {{else if .GetOpType.InActions "close_pull_request"}}
  65. {{$index := index .GetIssueInfos 0}}
  66. {{ctx.Locale.Tr "action.close_pull_request" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
  67. {{else if .GetOpType.InActions "reopen_pull_request"}}
  68. {{$index := index .GetIssueInfos 0}}
  69. {{ctx.Locale.Tr "action.reopen_pull_request" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
  70. {{else if .GetOpType.InActions "delete_tag"}}
  71. {{$index := index .GetIssueInfos 0}}
  72. {{ctx.Locale.Tr "action.delete_tag" (.GetRepoLink ctx) .GetTag (.ShortRepoPath ctx)}}
  73. {{else if .GetOpType.InActions "delete_branch"}}
  74. {{$index := index .GetIssueInfos 0}}
  75. {{ctx.Locale.Tr "action.delete_branch" (.GetRepoLink ctx) .GetBranch (.ShortRepoPath ctx)}}
  76. {{else if .GetOpType.InActions "mirror_sync_push"}}
  77. {{ctx.Locale.Tr "action.mirror_sync_push" (.GetRepoLink ctx) (.GetRefLink ctx) .GetBranch (.ShortRepoPath ctx)}}
  78. {{else if .GetOpType.InActions "mirror_sync_create"}}
  79. {{ctx.Locale.Tr "action.mirror_sync_create" (.GetRepoLink ctx) (.GetRefLink ctx) .GetBranch (.ShortRepoPath ctx)}}
  80. {{else if .GetOpType.InActions "mirror_sync_delete"}}
  81. {{ctx.Locale.Tr "action.mirror_sync_delete" (.GetRepoLink ctx) .GetBranch (.ShortRepoPath ctx)}}
  82. {{else if .GetOpType.InActions "approve_pull_request"}}
  83. {{$index := index .GetIssueInfos 0}}
  84. {{ctx.Locale.Tr "action.approve_pull_request" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
  85. {{else if .GetOpType.InActions "reject_pull_request"}}
  86. {{$index := index .GetIssueInfos 0}}
  87. {{ctx.Locale.Tr "action.reject_pull_request" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
  88. {{else if .GetOpType.InActions "comment_pull"}}
  89. {{$index := index .GetIssueInfos 0}}
  90. {{ctx.Locale.Tr "action.comment_pull" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx)}}
  91. {{else if .GetOpType.InActions "publish_release"}}
  92. {{$linkText := .Content | RenderEmoji $.Context}}
  93. {{ctx.Locale.Tr "action.publish_release" (.GetRepoLink ctx) (printf "%s/releases/tag/%s" (.GetRepoLink ctx) .GetTag) (.ShortRepoPath ctx) $linkText}}
  94. {{else if .GetOpType.InActions "review_dismissed"}}
  95. {{$index := index .GetIssueInfos 0}}
  96. {{$reviewer := index .GetIssueInfos 1}}
  97. {{ctx.Locale.Tr "action.review_dismissed" (printf "%s/pulls/%s" (.GetRepoLink ctx) $index) $index (.ShortRepoPath ctx) $reviewer}}
  98. {{end}}
  99. {{TimeSince .GetCreate ctx.Locale}}
  100. </div>
  101. {{if .GetOpType.InActions "commit_repo" "mirror_sync_push"}}
  102. {{$push := ActionContent2Commits .}}
  103. {{$repoLink := (.GetRepoLink ctx)}}
  104. {{$repo := .Repo}}
  105. <div class="tw-flex tw-flex-col tw-gap-1">
  106. {{range $push.Commits}}
  107. {{$commitLink := printf "%s/commit/%s" $repoLink .Sha1}}
  108. <div class="flex-text-block">
  109. <img class="ui avatar" src="{{$push.AvatarLink $.Context .AuthorEmail}}" title="{{.AuthorName}}" width="16" height="16">
  110. <a class="ui sha label" href="{{$commitLink}}">{{ShortSha .Sha1}}</a>
  111. <span class="text truncate">
  112. {{RenderCommitMessage $.Context .Message ($repo.ComposeMetas ctx)}}
  113. </span>
  114. </div>
  115. {{end}}
  116. </div>
  117. {{if and (gt $push.Len 1) $push.CompareURL}}
  118. <a href="{{AppSubUrl}}/{{$push.CompareURL}}">{{ctx.Locale.Tr "action.compare_commits" $push.Len}} »</a>
  119. {{end}}
  120. {{else if .GetOpType.InActions "create_issue"}}
  121. <span class="text truncate issue title">{{index .GetIssueInfos 1 | RenderEmoji $.Context | RenderCodeBlock}}</span>
  122. {{else if .GetOpType.InActions "create_pull_request"}}
  123. <span class="text truncate issue title">{{index .GetIssueInfos 1 | RenderEmoji $.Context | RenderCodeBlock}}</span>
  124. {{else if .GetOpType.InActions "comment_issue" "approve_pull_request" "reject_pull_request" "comment_pull"}}
  125. <a href="{{.GetCommentLink ctx}}" class="text truncate issue title">{{(.GetIssueTitle ctx) | RenderEmoji $.Context | RenderCodeBlock}}</a>
  126. {{$comment := index .GetIssueInfos 1}}
  127. {{if $comment}}
  128. <div class="markup tw-text-14">{{RenderMarkdownToHtml ctx $comment}}</div>
  129. {{end}}
  130. {{else if .GetOpType.InActions "merge_pull_request"}}
  131. <div class="flex-item-body text black">{{index .GetIssueInfos 1}}</div>
  132. {{else if .GetOpType.InActions "close_issue" "reopen_issue" "close_pull_request" "reopen_pull_request"}}
  133. <span class="text truncate issue title">{{(.GetIssueTitle ctx) | RenderEmoji $.Context | RenderCodeBlock}}</span>
  134. {{else if .GetOpType.InActions "pull_review_dismissed"}}
  135. <div class="flex-item-body text black">{{ctx.Locale.Tr "action.review_dismissed_reason"}}</div>
  136. <div class="flex-item-body text black">{{index .GetIssueInfos 2 | RenderEmoji $.Context}}</div>
  137. {{end}}
  138. {{end}}
  139. </div>
  140. <div class="flex-item-trailing">
  141. {{if .IsPrivateView}}
  142. {{svg "octicon-lock" 32 "text grey tw-mr-1"}}
  143. {{else}}
  144. {{svg (printf "octicon-%s" (ActionIcon .GetOpType)) 32 "text grey tw-mr-1"}}
  145. {{end}}
  146. </div>
  147. </div>
  148. {{end}}
  149. {{template "base/paginate" .}}
  150. </div>