feeds.tmpl 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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}}">{{.GetActUserName}}</a>
  11. {{if eq .GetOpType 1}}
  12. {{$.i18n.Tr "action.create_repo" .GetRepoLink .GetRepoPath | Str2html}}
  13. {{else if eq .GetOpType 2}}
  14. {{$.i18n.Tr "action.rename_repo" .GetContent .GetRepoLink .GetRepoPath | Str2html}}
  15. {{else if eq .GetOpType 5}}
  16. {{ $branchLink := .GetBranch | EscapePound}}
  17. {{$.i18n.Tr "action.commit_repo" .GetRepoLink $branchLink .GetBranch .GetRepoPath | Str2html}}
  18. {{else if eq .GetOpType 6}}
  19. {{ $index := index .GetIssueInfos 0}}
  20. {{$.i18n.Tr "action.create_issue" .GetRepoLink $index .GetRepoPath | Str2html}}
  21. {{else if eq .GetOpType 7}}
  22. {{ $index := index .GetIssueInfos 0}}
  23. {{$.i18n.Tr "action.create_pull_request" .GetRepoLink $index .GetRepoPath | Str2html}}
  24. {{else if eq .GetOpType 8}}
  25. {{$.i18n.Tr "action.transfer_repo" .GetContent .GetRepoLink .GetRepoPath | Str2html}}
  26. {{else if eq .GetOpType 9}}
  27. {{$.i18n.Tr "action.push_tag" .GetRepoLink .GetBranch .GetRepoPath | Str2html}}
  28. {{else if eq .GetOpType 10}}
  29. {{ $index := index .GetIssueInfos 0}}
  30. {{$.i18n.Tr "action.comment_issue" .GetRepoLink $index .GetRepoPath | Str2html}}
  31. {{else if eq .GetOpType 11}}
  32. {{ $index := index .GetIssueInfos 0}}
  33. {{$.i18n.Tr "action.merge_pull_request" .GetRepoLink $index .GetRepoPath | Str2html}}
  34. {{end}}
  35. </p>
  36. {{if eq .GetOpType 5}}
  37. <div class="content">
  38. <ul>
  39. {{ $push := ActionContent2Commits .}}
  40. {{ $repoLink := .GetRepoLink}}
  41. {{if $push.Commits}}
  42. {{range $push.Commits}}
  43. <li><img class="img-8" src="{{$push.AvatarLink .AuthorEmail}}"> <a href="{{$repoLink}}/commit/{{.Sha1}}">{{ShortSha .Sha1}}</a> <span class="text truncate light grey">{{.Message}}</span></li>
  44. {{end}}
  45. {{end}}
  46. {{if $push.CompareUrl}}<li><a href="{{AppSubUrl}}/{{$push.CompareUrl}}">{{$.i18n.Tr "action.compare_2_commits"}} »</a></li>{{end}}
  47. </ul>
  48. </div>
  49. {{else if eq .GetOpType 6}}
  50. <span class="text truncate issue title">{{index .GetIssueInfos 1}}</span>
  51. <p class="text light grey">{{.GetIssueContent}}</p>
  52. {{else if eq .GetOpType 7}}
  53. <p class="text light grey">{{index .GetIssueInfos 1}}</p>
  54. {{else if eq .GetOpType 10}}
  55. <span class="text truncate issue title">{{.GetIssueTitle}}</span>
  56. <p class="text light grey">{{index .GetIssueInfos 1}}</p>
  57. {{else if eq .GetOpType 11}}
  58. <p class="text light grey">{{index .GetIssueInfos 1}}</p>
  59. {{end}}
  60. <p class="text italic light grey">{{TimeSince .GetCreate $.i18n.Lang}}</p>
  61. </div>
  62. </div>
  63. <div class="ui one wide column">
  64. <i class="text grey mega-octicon octicon-{{ActionIcon .GetOpType}}"></i>
  65. </div>
  66. </div>
  67. <div class="ui divider"></div>
  68. </div>
  69. {{end}}