feeds.tmpl 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. {{if not .Feeds}}
  2. {{if not .ContextUser.IsOrganization}}
  3. {{if .PageIsDashboard}}
  4. <div class="ui segment dashboard prompt">
  5. <h3>Discover interesting projects and people to populate your personal news feed.</h3>
  6. <p>Your news feed helps you keep up with recent activity on repositories you <a href="{{AppURL}}{{.LoggedUser.Name}}">manage</a> and <a href="{{AppURL}}explore/repos">watch</a>.</p>
  7. <a class="ui button basic blue small" href="{{AppURL}}trending">Explore Gitote</a>
  8. </div>
  9. {{end}}
  10. {{end}}
  11. <div class="ui center dashboard no-activity">
  12. <img class="ui avatar small image" src="https://gitote-cdn.netlify.com/img/svg/no_activities.svg">
  13. <br/>
  14. <h3>No Activities</h3>
  15. </div>
  16. {{end}}
  17. <div class="statuscontact"></div>
  18. {{range .Feeds}}
  19. <div class="news">
  20. <div class="ui left">
  21. <img class="ui avatar image" src="{{.ActAvatar}}" alt="">
  22. </div>
  23. <div class="ui grid">
  24. <div class="ui fifteen wide column">
  25. <div class="{{if or (eq .GetOpType 5) (eq .GetOpType 20)}}push news{{end}}">
  26. <p>
  27. <a href="{{AppSubURL}}/{{.GetActUserName}}">{{.ShortActUserName}}</a>
  28. <!-- Reference types to models/action.go -->
  29. {{if eq .GetOpType 1}}
  30. {{$.i18n.Tr "action.create_repo" .GetRepoLink .ShortRepoPath | Str2HTML}}
  31. {{else if eq .GetOpType 2}}
  32. {{$.i18n.Tr "action.rename_repo" .GetContent .GetRepoLink .ShortRepoPath | Str2HTML}}
  33. {{else if eq .GetOpType 5}}
  34. {{ $branchLink := .GetBranch | EscapePound}}
  35. {{$.i18n.Tr "action.commit_repo" .GetRepoLink $branchLink .GetBranch .ShortRepoPath | Str2HTML}}
  36. {{else if eq .GetOpType 6}}
  37. {{ $index := index .GetIssueInfos 0}}
  38. {{$.i18n.Tr "action.create_issue" .GetRepoLink $index .ShortRepoPath | Str2HTML}}
  39. {{else if eq .GetOpType 7}}
  40. {{ $index := index .GetIssueInfos 0}}
  41. {{$.i18n.Tr "action.create_pull_request" .GetRepoLink $index .ShortRepoPath | Str2HTML}}
  42. {{else if eq .GetOpType 8}}
  43. {{$.i18n.Tr "action.transfer_repo" .GetContent .GetRepoLink .ShortRepoPath | Str2HTML}}
  44. {{else if eq .GetOpType 9}}
  45. {{$.i18n.Tr "action.push_tag" .GetRepoLink .GetBranch .ShortRepoPath | Str2HTML}}
  46. {{else if eq .GetOpType 10}}
  47. {{ $index := index .GetIssueInfos 0}}
  48. {{$.i18n.Tr "action.comment_issue" .GetRepoLink $index .ShortRepoPath | Str2HTML}}
  49. {{else if eq .GetOpType 11}}
  50. {{ $index := index .GetIssueInfos 0}}
  51. {{$.i18n.Tr "action.merge_pull_request" .GetRepoLink $index .ShortRepoPath | Str2HTML}}
  52. {{else if eq .GetOpType 12}}
  53. {{ $index := index .GetIssueInfos 0}}
  54. {{$.i18n.Tr "action.close_issue" .GetRepoLink $index .ShortRepoPath | Str2HTML}}
  55. {{else if eq .GetOpType 13}}
  56. {{ $index := index .GetIssueInfos 0}}
  57. {{$.i18n.Tr "action.reopen_issue" .GetRepoLink $index .ShortRepoPath | Str2HTML}}
  58. {{else if eq .GetOpType 14}}
  59. {{ $index := index .GetIssueInfos 0}}
  60. {{$.i18n.Tr "action.close_pull_request" .GetRepoLink $index .ShortRepoPath | Str2HTML}}
  61. {{else if eq .GetOpType 15}}
  62. {{ $index := index .GetIssueInfos 0}}
  63. {{$.i18n.Tr "action.reopen_pull_request" .GetRepoLink $index .ShortRepoPath | Str2HTML}}
  64. {{else if eq .GetOpType 16}}
  65. {{ $branchLink := .GetBranch | EscapePound}}
  66. {{$.i18n.Tr "action.create_branch" .GetRepoLink $branchLink .GetBranch .ShortRepoPath | Str2HTML}}
  67. {{else if eq .GetOpType 17}}
  68. {{$.i18n.Tr "action.delete_branch" .GetRepoLink .GetBranch .ShortRepoPath | Str2HTML}}
  69. {{else if eq .GetOpType 18}}
  70. {{$.i18n.Tr "action.delete_tag" .GetRepoLink .GetBranch .ShortRepoPath | Str2HTML}}
  71. {{else if eq .GetOpType 19}}
  72. {{$.i18n.Tr "action.fork_repo" .GetRepoLink .ShortRepoPath | Str2HTML}}
  73. {{else if eq .GetOpType 20}}
  74. {{ $branchLink := .GetBranch | EscapePound}}
  75. {{$.i18n.Tr "action.mirror_sync_push" .GetRepoLink $branchLink .GetBranch .ShortRepoPath | Str2HTML}}
  76. {{else if eq .GetOpType 21}}
  77. {{$.i18n.Tr "action.mirror_sync_create" .GetRepoLink .GetBranch .ShortRepoPath | Str2HTML}}
  78. {{else if eq .GetOpType 22}}
  79. {{$.i18n.Tr "action.mirror_sync_delete" .GetRepoLink .GetBranch .ShortRepoPath | Str2HTML}}
  80. {{end}}
  81. </p>
  82. {{if or (eq .GetOpType 5) (eq .GetOpType 20)}}
  83. <div class="content commits-card">
  84. <ul>
  85. {{ $push := ActionContent2Commits .}}
  86. {{ $repoLink := .GetRepoLink}}
  87. {{if $push.Commits}}
  88. {{range $push.Commits}}
  89. <li><img class="img-8" src="{{$push.AvatarLink .AuthorEmail}}"> <a class="sha" href="{{$repoLink}}/commit/{{.Sha1}}">{{ShortSHA1 .Sha1}}</a> <span class="text truncate light grey">{{.Message}}</span></li>
  90. {{end}}
  91. {{end}}
  92. {{if and (gt $push.Len 1) $push.CompareURL}}<li><a href="{{AppSubURL}}/{{$push.CompareURL}}">{{$.i18n.Tr "action.compare_commits" $push.Len}} ➡️</a></li>{{end}}
  93. </ul>
  94. </div>
  95. {{else if eq .GetOpType 6}}
  96. <span class="text truncate issue title has-emoji">{{index .GetIssueInfos 1}}</span>
  97. {{else if eq .GetOpType 7}}
  98. <span class="text truncate issue title has-emoji">{{index .GetIssueInfos 1}}</span>
  99. {{else if eq .GetOpType 10}}
  100. <div class="ui segment">
  101. <span class="text truncate title has-emoji">{{.GetIssueTitle}}</span>
  102. <p class="text light grey has-emoji feeds issue">{{index .GetIssueInfos 1}}</p>
  103. </div>
  104. {{else if eq .GetOpType 11}}
  105. <p class="text light grey has-emoji">{{index .GetIssueInfos 1}}</p>
  106. {{else if (or (or (eq .GetOpType 12) (eq .GetOpType 13)) (or (eq .GetOpType 14) (eq .GetOpType 15)))}}
  107. <span class="text truncate issue title has-emoji">{{.GetIssueTitle}}</span>
  108. {{end}}
  109. <p class="text light grey"><i style="font-size:11px" class="menu-icon octicon">🕒</i> {{TimeSince .GetCreate $.i18n.Lang}}</p>
  110. </div>
  111. </div>
  112. <div class="ui one wide column">
  113. <i class="text grey mega-octicon octicon-{{ActionIcon .GetOpType}} feeds icons"></i>
  114. </div>
  115. </div>
  116. <div class="ui divider"></div>
  117. </div>
  118. {{end}}