feeds.tmpl 3.2 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. {{$.i18n.Tr "action.commit_repo" .GetRepoLink .GetBranch .GetRepoPath | Str2html}}
  17. {{else if eq .GetOpType 6}}
  18. {{ $index := index .GetIssueInfos 0}}
  19. {{$.i18n.Tr "action.create_issue" .GetRepoLink $index .GetRepoPath | Str2html}}
  20. {{else if eq .GetOpType 7}}
  21. {{ $index := index .GetIssueInfos 0}}
  22. {{$.i18n.Tr "action.create_pull_request" .GetRepoLink $index .GetRepoPath | Str2html}}
  23. {{else if eq .GetOpType 8}}
  24. {{$.i18n.Tr "action.transfer_repo" .GetContent .GetRepoLink .GetRepoPath | Str2html}}
  25. {{else if eq .GetOpType 9}}
  26. {{$.i18n.Tr "action.push_tag" .GetRepoLink .GetBranch .GetRepoPath | Str2html}}
  27. {{else if eq .GetOpType 10}}
  28. {{ $index := index .GetIssueInfos 0}}
  29. {{$.i18n.Tr "action.comment_issue" .GetRepoLink $index .GetRepoPath | Str2html}}
  30. {{else if eq .GetOpType 11}}
  31. {{ $index := index .GetIssueInfos 0}}
  32. {{$.i18n.Tr "action.merge_pull_request" .GetRepoLink $index .GetRepoPath | Str2html}}
  33. {{end}}
  34. </p>
  35. {{if eq .GetOpType 5}}
  36. <div class="content">
  37. <ul>
  38. {{ $push := ActionContent2Commits .}}
  39. {{ $repoLink := .GetRepoLink}}
  40. {{if $push.Commits}}
  41. {{range $push.Commits}}
  42. <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>
  43. {{end}}
  44. {{end}}
  45. {{if $push.CompareUrl}}<li><a href="{{AppSubUrl}}/{{$push.CompareUrl}}">{{$.i18n.Tr "action.compare_2_commits"}} »</a></li>{{end}}
  46. </ul>
  47. </div>
  48. {{else if eq .GetOpType 6}}
  49. <span class="text truncate issue title">{{index .GetIssueInfos 1}}</span>
  50. <p class="text light grey">{{.GetIssueContent}}</p>
  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}}