You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

feeds.tmpl 5.2 kB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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="{{.GetActFullName}}">{{.ShortActUserName}}</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. {{end}}
  65. </p>
  66. {{if or (eq .GetOpType 5) (eq .GetOpType 18)}}
  67. <div class="content">
  68. <ul>
  69. {{ $push := ActionContent2Commits .}}
  70. {{ $repoLink := .GetRepoLink}}
  71. {{if $push.Commits}}
  72. {{range $push.Commits}}
  73. <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>
  74. {{end}}
  75. {{end}}
  76. {{if and (gt $push.Len 1) $push.CompareURL}}<li><a href="{{AppSubUrl}}/{{$push.CompareURL}}">{{$.i18n.Tr "action.compare_commits" $push.Len}} »</a></li>{{end}}
  77. </ul>
  78. </div>
  79. {{else if eq .GetOpType 6}}
  80. <span class="text truncate issue title has-emoji">{{index .GetIssueInfos 1}}</span>
  81. {{else if eq .GetOpType 7}}
  82. <span class="text truncate issue title has-emoji">{{index .GetIssueInfos 1}}</span>
  83. {{else if eq .GetOpType 10}}
  84. <a href="{{.GetCommentLink}}" class="text truncate issue title has-emoji">{{.GetIssueTitle}}</a>
  85. <p class="text light grey has-emoji">{{index .GetIssueInfos 1}}</p>
  86. {{else if eq .GetOpType 11}}
  87. <p class="text light grey has-emoji">{{index .GetIssueInfos 1}}</p>
  88. {{else if (or (or (eq .GetOpType 12) (eq .GetOpType 13)) (or (eq .GetOpType 14) (eq .GetOpType 15)))}}
  89. <span class="text truncate issue title has-emoji">{{.GetIssueTitle}}</span>
  90. {{end}}
  91. <p class="text italic light grey">{{TimeSince .GetCreate $.i18n.Lang}}</p>
  92. </div>
  93. </div>
  94. <div class="ui two wide right aligned column">
  95. <i class="text grey mega-octicon octicon-{{ActionIcon .GetOpType}}"></i>
  96. </div>
  97. </div>
  98. <div class="ui divider"></div>
  99. </div>
  100. {{end}}