feeds.tmpl 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. <!-- 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. {{end}}
  57. </p>
  58. {{if eq .GetOpType 5}}
  59. <div class="content">
  60. <ul>
  61. {{ $push := ActionContent2Commits .}}
  62. {{ $repoLink := .GetRepoLink}}
  63. {{if $push.Commits}}
  64. {{range $push.Commits}}
  65. <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>
  66. {{end}}
  67. {{end}}
  68. {{if and (gt $push.Len 1) $push.CompareURL}}<li><a href="{{AppSubURL}}/{{$push.CompareURL}}">{{$.i18n.Tr "action.compare_commits" $push.Len}} »</a></li>{{end}}
  69. </ul>
  70. </div>
  71. {{else if eq .GetOpType 6}}
  72. <span class="text truncate issue title has-emoji">{{index .GetIssueInfos 1}}</span>
  73. {{else if eq .GetOpType 7}}
  74. <span class="text truncate issue title has-emoji">{{index .GetIssueInfos 1}}</span>
  75. {{else if eq .GetOpType 10}}
  76. <span class="text truncate issue title has-emoji">{{.GetIssueTitle}}</span>
  77. <p class="text light grey has-emoji">{{index .GetIssueInfos 1}}</p>
  78. {{else if eq .GetOpType 11}}
  79. <p class="text light grey has-emoji">{{index .GetIssueInfos 1}}</p>
  80. {{else if (or (or (eq .GetOpType 12) (eq .GetOpType 13)) (or (eq .GetOpType 14) (eq .GetOpType 15)))}}
  81. <span class="text truncate issue title has-emoji">{{.GetIssueTitle}}</span>
  82. {{end}}
  83. <p class="text italic light grey">{{TimeSince .GetCreate $.i18n.Lang}}</p>
  84. </div>
  85. </div>
  86. <div class="ui one wide column">
  87. <i class="text grey mega-octicon octicon-{{ActionIcon .GetOpType}}"></i>
  88. </div>
  89. </div>
  90. <div class="ui divider"></div>
  91. </div>
  92. {{end}}