feeds.tmpl 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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="{{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. <p class="text light grey">{{index .GetIssueInfos 1}}</p>
  50. {{else if eq .GetOpType 7}}
  51. <p class="text light grey">{{index .GetIssueInfos 1}}</p>
  52. {{else if eq .GetOpType 10}}
  53. <span class="text truncate issue title">{{.GetIssueTitle}}</span>
  54. <p class="text light grey">{{index .GetIssueInfos 1}}</p>
  55. {{else if eq .GetOpType 11}}
  56. <p class="text light grey">{{index .GetIssueInfos 1}}</p>
  57. {{end}}
  58. <p class="text italic light grey">{{TimeSince .GetCreate $.i18n.Lang}}</p>
  59. </div>
  60. </div>
  61. <div class="ui one wide column">
  62. <i class="text grey mega-octicon octicon-{{ActionIcon .GetOpType}}"></i>
  63. </div>
  64. </div>
  65. <div class="ui divider"></div>
  66. </div>
  67. {{end}}