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 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. {{range .Feeds}}
  2. <div class="news">
  3. <div class="ui left">
  4. <img class="ui avatar image" src="{{.GetActAvatar}}" alt="">
  5. </div>
  6. <div class="ui grid">
  7. <div class="ui fourteen wide column">
  8. <div class="{{if or (eq .GetOpType 5) (eq .GetOpType 18)}}push news{{end}}">
  9. <p>
  10. {{if gt .ActUser.ID 0}}
  11. <a href="{{AppSubUrl}}/{{.GetActUserName}}" title="{{.GetDisplayNameTitle}}">{{.GetDisplayName}}</a>
  12. {{else}}
  13. {{.ShortActUserName}}
  14. {{end}}
  15. {{if eq .GetOpType 1}}
  16. {{$.i18n.Tr "action.create_repo" .GetRepoLink .ShortRepoPath | Str2html}}
  17. {{else if eq .GetOpType 2}}
  18. {{$.i18n.Tr "action.rename_repo" .GetContent .GetRepoLink .ShortRepoPath | Str2html}}
  19. {{else if eq .GetOpType 5}}
  20. {{ $branchLink := .GetBranch | EscapePound | Escape}}
  21. {{$.i18n.Tr "action.commit_repo" .GetRepoLink $branchLink (Escape .GetBranch) .ShortRepoPath | Str2html}}
  22. {{else if eq .GetOpType 6}}
  23. {{ $index := index .GetIssueInfos 0}}
  24. {{$.i18n.Tr "action.create_issue" .GetRepoLink $index .ShortRepoPath | Str2html}}
  25. {{else if eq .GetOpType 7}}
  26. {{ $index := index .GetIssueInfos 0}}
  27. {{$.i18n.Tr "action.create_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}}
  28. {{else if eq .GetOpType 8}}
  29. {{$.i18n.Tr "action.transfer_repo" .GetContent .GetRepoLink .ShortRepoPath | Str2html}}
  30. {{else if eq .GetOpType 9}}
  31. {{ $branchLink := .GetBranch | EscapePound | Escape}}
  32. {{$.i18n.Tr "action.push_tag" .GetRepoLink $branchLink .ShortRepoPath | Str2html}}
  33. {{else if eq .GetOpType 10}}
  34. {{ $index := index .GetIssueInfos 0}}
  35. {{$.i18n.Tr "action.comment_issue" .GetRepoLink $index .ShortRepoPath | Str2html}}
  36. {{else if eq .GetOpType 11}}
  37. {{ $index := index .GetIssueInfos 0}}
  38. {{$.i18n.Tr "action.merge_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}}
  39. {{else if eq .GetOpType 12}}
  40. {{ $index := index .GetIssueInfos 0}}
  41. {{$.i18n.Tr "action.close_issue" .GetRepoLink $index .ShortRepoPath | Str2html}}
  42. {{else if eq .GetOpType 13}}
  43. {{ $index := index .GetIssueInfos 0}}
  44. {{$.i18n.Tr "action.reopen_issue" .GetRepoLink $index .ShortRepoPath | Str2html}}
  45. {{else if eq .GetOpType 14}}
  46. {{ $index := index .GetIssueInfos 0}}
  47. {{$.i18n.Tr "action.close_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}}
  48. {{else if eq .GetOpType 15}}
  49. {{ $index := index .GetIssueInfos 0}}
  50. {{$.i18n.Tr "action.reopen_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}}
  51. {{else if eq .GetOpType 16}}
  52. {{ $index := index .GetIssueInfos 0}}
  53. {{$.i18n.Tr "action.delete_tag" .GetRepoLink .GetBranch .ShortRepoPath | Str2html}}
  54. {{else if eq .GetOpType 17}}
  55. {{ $index := index .GetIssueInfos 0}}
  56. {{$.i18n.Tr "action.delete_branch" .GetRepoLink .GetBranch .ShortRepoPath | Str2html}}
  57. {{else if eq .GetOpType 18}}
  58. {{ $branchLink := .GetBranch | EscapePound}}
  59. {{$.i18n.Tr "action.mirror_sync_push" .GetRepoLink $branchLink .GetBranch .ShortRepoPath | Str2html}}
  60. {{else if eq .GetOpType 19}}
  61. {{$.i18n.Tr "action.mirror_sync_create" .GetRepoLink .GetBranch .ShortRepoPath | Str2html}}
  62. {{else if eq .GetOpType 20}}
  63. {{$.i18n.Tr "action.mirror_sync_delete" .GetRepoLink .GetBranch .ShortRepoPath | Str2html}}
  64. {{else if eq .GetOpType 21}}
  65. {{ $index := index .GetIssueInfos 0}}
  66. {{$.i18n.Tr "action.approve_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}}
  67. {{else if eq .GetOpType 22}}
  68. {{ $index := index .GetIssueInfos 0}}
  69. {{$.i18n.Tr "action.reject_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}}
  70. {{else if eq .GetOpType 23}}
  71. {{ $index := index .GetIssueInfos 0}}
  72. {{$.i18n.Tr "action.comment_pull" .GetRepoLink $index .ShortRepoPath | Str2html}}
  73. {{end}}
  74. </p>
  75. {{if or (eq .GetOpType 5) (eq .GetOpType 18)}}
  76. <div class="content">
  77. <ul>
  78. {{ $push := ActionContent2Commits .}}
  79. {{ $repoLink := .GetRepoLink}}
  80. {{if $push.Commits}}
  81. {{range $push.Commits}}
  82. <li><img class="img-8" src="{{$push.AvatarLink .AuthorEmail}}"> <a class="commit-id" href="{{$repoLink}}/commit/{{.Sha1}}">{{ShortSha .Sha1}}</a> <span class="text truncate light grey has-emoji">{{.Message}}</span></li>
  83. {{end}}
  84. {{end}}
  85. {{if and (gt $push.Len 1) $push.CompareURL}}<li><a href="{{AppSubUrl}}/{{$push.CompareURL}}">{{$.i18n.Tr "action.compare_commits" $push.Len}} »</a></li>{{end}}
  86. </ul>
  87. </div>
  88. {{else if eq .GetOpType 6}}
  89. <span class="text truncate issue title has-emoji">{{index .GetIssueInfos 1}}</span>
  90. {{else if eq .GetOpType 7}}
  91. <span class="text truncate issue title has-emoji">{{index .GetIssueInfos 1}}</span>
  92. {{else if or (eq .GetOpType 10) (eq .GetOpType 21) (eq .GetOpType 22) (eq .GetOpType 23)}}
  93. <a href="{{.GetCommentLink}}" class="text truncate issue title has-emoji">{{.GetIssueTitle}}</a>
  94. <p class="text light grey has-emoji">{{index .GetIssueInfos 1}}</p>
  95. {{else if eq .GetOpType 11}}
  96. <p class="text light grey has-emoji">{{index .GetIssueInfos 1}}</p>
  97. {{else if (or (or (eq .GetOpType 12) (eq .GetOpType 13)) (or (eq .GetOpType 14) (eq .GetOpType 15)))}}
  98. <span class="text truncate issue title has-emoji">{{.GetIssueTitle}}</span>
  99. {{end}}
  100. <p class="text italic light grey">{{TimeSince .GetCreate $.i18n.Lang}}</p>
  101. </div>
  102. </div>
  103. <div class="ui two wide right aligned column">
  104. <span class="text grey">{{svg (printf "octicon-%s" (ActionIcon .GetOpType)) 32}}</span>
  105. </div>
  106. </div>
  107. <div class="ui divider"></div>
  108. </div>
  109. {{end}}