feeds.tmpl 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 eq .GetOpType 5}}push news{{end}}">
  9. <p>
  10. <a href="{{AppSubUrl}}/{{.GetActUserName}}">{{.ShortActUserName}}</a>
  11. {{if eq .GetOpType 1}}
  12. {{$.i18n.Tr "action.create_repo" .GetRepoLink .ShortRepoPath | Str2html}}
  13. {{else if eq .GetOpType 2}}
  14. {{$.i18n.Tr "action.rename_repo" .GetContent .GetRepoLink .ShortRepoPath | Str2html}}
  15. {{else if eq .GetOpType 5}}
  16. {{ $branchLink := .GetBranch | EscapePound}}
  17. {{$.i18n.Tr "action.commit_repo" .GetRepoLink $branchLink .GetBranch .ShortRepoPath | Str2html}}
  18. {{else if eq .GetOpType 6}}
  19. {{ $index := index .GetIssueInfos 0}}
  20. {{$.i18n.Tr "action.create_issue" .GetRepoLink $index .ShortRepoPath | Str2html}}
  21. {{else if eq .GetOpType 7}}
  22. {{ $index := index .GetIssueInfos 0}}
  23. {{$.i18n.Tr "action.create_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}}
  24. {{else if eq .GetOpType 8}}
  25. {{$.i18n.Tr "action.transfer_repo" .GetContent .GetRepoLink .ShortRepoPath | Str2html}}
  26. {{else if eq .GetOpType 9}}
  27. {{$.i18n.Tr "action.push_tag" .GetRepoLink .GetBranch .ShortRepoPath | Str2html}}
  28. {{else if eq .GetOpType 10}}
  29. {{ $index := index .GetIssueInfos 0}}
  30. {{$.i18n.Tr "action.comment_issue" .GetRepoLink $index .ShortRepoPath | Str2html}}
  31. {{else if eq .GetOpType 11}}
  32. {{ $index := index .GetIssueInfos 0}}
  33. {{$.i18n.Tr "action.merge_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}}
  34. {{else if eq .GetOpType 12}}
  35. {{ $index := index .GetIssueInfos 0}}
  36. {{$.i18n.Tr "action.close_issue" .GetRepoLink $index .ShortRepoPath | Str2html}}
  37. {{else if eq .GetOpType 13}}
  38. {{ $index := index .GetIssueInfos 0}}
  39. {{$.i18n.Tr "action.reopen_issue" .GetRepoLink $index .ShortRepoPath | Str2html}}
  40. {{else if eq .GetOpType 14}}
  41. {{ $index := index .GetIssueInfos 0}}
  42. {{$.i18n.Tr "action.close_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}}
  43. {{else if eq .GetOpType 15}}
  44. {{ $index := index .GetIssueInfos 0}}
  45. {{$.i18n.Tr "action.reopen_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}}
  46. {{end}}
  47. </p>
  48. {{if eq .GetOpType 5}}
  49. <div class="content">
  50. <ul>
  51. {{ $push := ActionContent2Commits .}}
  52. {{ $repoLink := .GetRepoLink}}
  53. {{if $push.Commits}}
  54. {{range $push.Commits}}
  55. <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>
  56. {{end}}
  57. {{end}}
  58. {{if and (gt $push.Len 1) $push.CompareUrl}}<li><a href="{{AppSubUrl}}/{{$push.CompareUrl}}">{{$.i18n.Tr "action.compare_commits" $push.Len}} »</a></li>{{end}}
  59. </ul>
  60. </div>
  61. {{else if eq .GetOpType 6}}
  62. <span class="text truncate issue title has-emoji">{{index .GetIssueInfos 1}}</span>
  63. {{else if eq .GetOpType 7}}
  64. <span class="text truncate issue title has-emoji">{{index .GetIssueInfos 1}}</span>
  65. {{else if eq .GetOpType 10}}
  66. <span class="text truncate issue title has-emoji">{{.GetIssueTitle}}</span>
  67. <p class="text light grey has-emoji">{{index .GetIssueInfos 1}}</p>
  68. {{else if eq .GetOpType 11}}
  69. <p class="text light grey has-emoji">{{index .GetIssueInfos 1}}</p>
  70. {{else if (or (or (eq .GetOpType 12) (eq .GetOpType 13)) (or (eq .GetOpType 14) (eq .GetOpType 15)))}}
  71. <span class="text truncate issue title has-emoji">{{.GetIssueTitle}}</span>
  72. {{end}}
  73. <p class="text italic light grey">{{TimeSince .GetCreate $.i18n.Lang}}</p>
  74. </div>
  75. </div>
  76. <div class="ui one wide column">
  77. <i class="text grey mega-octicon octicon-{{ActionIcon .GetOpType}}"></i>
  78. </div>
  79. </div>
  80. <div class="ui divider"></div>
  81. </div>
  82. {{end}}