feeds.tmpl 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 class="commit-id" href="{{$repoLink}}/commit/{{.Sha1}}">{{ShortSha .Sha1}}</a> <span class="text truncate light grey">{{.Message}}</span></li>
  44. {{end}}
  45. {{end}}
  46. {{if and (gt $push.Len 1) $push.CompareUrl}}<li><a href="{{AppSubUrl}}/{{$push.CompareUrl}}">{{$.i18n.Tr "action.compare_commits" $push.Len}} »</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. {{else if eq .GetOpType 7}}
  52. <p class="text light grey">{{index .GetIssueInfos 1}}</p>
  53. {{else if eq .GetOpType 10}}
  54. <span class="text truncate issue title">{{.GetIssueTitle}}</span>
  55. <p class="text light grey">{{index .GetIssueInfos 1}}</p>
  56. {{else if eq .GetOpType 11}}
  57. <p class="text light grey">{{index .GetIssueInfos 1}}</p>
  58. {{end}}
  59. <p class="text italic light grey">{{TimeSince .GetCreate $.i18n.Lang}}</p>
  60. </div>
  61. </div>
  62. <div class="ui one wide column">
  63. <i class="text grey mega-octicon octicon-{{ActionIcon .GetOpType}}"></i>
  64. </div>
  65. </div>
  66. <div class="ui divider"></div>
  67. </div>
  68. {{end}}