feeds.tmpl 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. {{end}}
  41. </p>
  42. {{if eq .GetOpType 5}}
  43. <div class="content">
  44. <ul>
  45. {{ $push := ActionContent2Commits .}}
  46. {{ $repoLink := .GetRepoLink}}
  47. {{if $push.Commits}}
  48. {{range $push.Commits}}
  49. <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>
  50. {{end}}
  51. {{end}}
  52. {{if and (gt $push.Len 1) $push.CompareUrl}}<li><a href="{{AppSubUrl}}/{{$push.CompareUrl}}">{{$.i18n.Tr "action.compare_commits" $push.Len}} »</a></li>{{end}}
  53. </ul>
  54. </div>
  55. {{else if eq .GetOpType 6}}
  56. <span class="text truncate issue title has-emoji">{{index .GetIssueInfos 1}}</span>
  57. {{else if eq .GetOpType 7}}
  58. <p class="text light grey has-emoji">{{index .GetIssueInfos 1}}</p>
  59. {{else if eq .GetOpType 10}}
  60. <span class="text truncate issue title has-emoji">{{.GetIssueTitle}}</span>
  61. <p class="text light grey has-emoji">{{index .GetIssueInfos 1}}</p>
  62. {{else if eq .GetOpType 11}}
  63. <p class="text light grey has-emoji">{{index .GetIssueInfos 1}}</p>
  64. {{else if (or (eq .GetOpType 12) (eq .GetOpType 13))}}
  65. <span class="text truncate issue title has-emoji">{{.GetIssueTitle}}</span>
  66. {{end}}
  67. <p class="text italic light grey">{{TimeSince .GetCreate $.i18n.Lang}}</p>
  68. </div>
  69. </div>
  70. <div class="ui one wide column">
  71. <i class="text grey mega-octicon octicon-{{ActionIcon .GetOpType}}"></i>
  72. </div>
  73. </div>
  74. <div class="ui divider"></div>
  75. </div>
  76. {{end}}