feeds.tmpl 5.1 KB

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