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 4.5 kB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 thirteen 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. {{else if eq .GetOpType 16}}
  47. {{ $index := index .GetIssueInfos 0}}
  48. {{$.i18n.Tr "action.delete_tag" .GetRepoLink .GetBranch .ShortRepoPath | Str2html}}
  49. {{else if eq .GetOpType 17}}
  50. {{ $index := index .GetIssueInfos 0}}
  51. {{$.i18n.Tr "action.delete_branch" .GetRepoLink .GetBranch .ShortRepoPath | Str2html}}
  52. {{end}}
  53. </p>
  54. {{if eq .GetOpType 5}}
  55. <div class="content">
  56. <ul>
  57. {{ $push := ActionContent2Commits .}}
  58. {{ $repoLink := .GetRepoLink}}
  59. {{if $push.Commits}}
  60. {{range $push.Commits}}
  61. <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>
  62. {{end}}
  63. {{end}}
  64. {{if and (gt $push.Len 1) $push.CompareURL}}<li><a href="{{AppSubUrl}}/{{$push.CompareURL}}">{{$.i18n.Tr "action.compare_commits" $push.Len}} »</a></li>{{end}}
  65. </ul>
  66. </div>
  67. {{else if eq .GetOpType 6}}
  68. <span class="text truncate issue title has-emoji">{{index .GetIssueInfos 1}}</span>
  69. {{else if eq .GetOpType 7}}
  70. <span class="text truncate issue title has-emoji">{{index .GetIssueInfos 1}}</span>
  71. {{else if eq .GetOpType 10}}
  72. <a href="{{.GetCommentLink}}" class="text truncate issue title has-emoji">{{.GetIssueTitle}}</a>
  73. <p class="text light grey has-emoji">{{index .GetIssueInfos 1}}</p>
  74. {{else if eq .GetOpType 11}}
  75. <p class="text light grey has-emoji">{{index .GetIssueInfos 1}}</p>
  76. {{else if (or (or (eq .GetOpType 12) (eq .GetOpType 13)) (or (eq .GetOpType 14) (eq .GetOpType 15)))}}
  77. <span class="text truncate issue title has-emoji">{{.GetIssueTitle}}</span>
  78. {{end}}
  79. <p class="text italic light grey">{{TimeSince .GetCreate $.i18n.Lang}}</p>
  80. </div>
  81. </div>
  82. <div class="ui three wide right aligned column">
  83. <i class="text grey mega-octicon octicon-{{ActionIcon .GetOpType}}"></i>
  84. </div>
  85. </div>
  86. <div class="ui divider"></div>
  87. </div>
  88. {{end}}