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.

feeds.tmpl 8.5KB

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