You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

activity.tmpl 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. {{template "base/head" .}}
  2. <div class="repository commits">
  3. {{template "repo/header" .}}
  4. <div class="ui container">
  5. <h2 class="ui header">{{.DateFrom}} - {{.DateUntil}}
  6. <div class="ui right">
  7. <!-- Period -->
  8. <div class="ui floating dropdown jump filter">
  9. <div class="ui basic compact button">
  10. <span class="text">
  11. {{.i18n.Tr "repo.activity.period.filter_label"}} <strong>{{.PeriodText}}</strong>
  12. <i class="dropdown icon"></i>
  13. </span>
  14. </div>
  15. <div class="menu">
  16. <a class="{{if eq .Period "daily"}}active {{end}}item" href="{{$.RepoLink}}/activity/daily">{{.i18n.Tr "repo.activity.period.daily"}}</a>
  17. <a class="{{if eq .Period "halfweekly"}}active {{end}}item" href="{{$.RepoLink}}/activity/halfweekly">{{.i18n.Tr "repo.activity.period.halfweekly"}}</a>
  18. <a class="{{if eq .Period "weekly"}}active {{end}}item" href="{{$.RepoLink}}/activity/weekly">{{.i18n.Tr "repo.activity.period.weekly"}}</a>
  19. <a class="{{if eq .Period "monthly"}}active {{end}}item" href="{{$.RepoLink}}/activity/monthly">{{.i18n.Tr "repo.activity.period.monthly"}}</a>
  20. <a class="{{if eq .Period "quarterly"}}active {{end}}item" href="{{$.RepoLink}}/activity/quarterly">{{.i18n.Tr "repo.activity.period.quarterly"}}</a>
  21. <a class="{{if eq .Period "semiyearly"}}active {{end}}item" href="{{$.RepoLink}}/activity/semiyearly">{{.i18n.Tr "repo.activity.period.semiyearly"}}</a>
  22. <a class="{{if eq .Period "yearly"}}active {{end}}item" href="{{$.RepoLink}}/activity/yearly">{{.i18n.Tr "repo.activity.period.yearly"}}</a>
  23. </div>
  24. </div>
  25. </div>
  26. </h2>
  27. <div class="ui divider"></div>
  28. {{if (or (.Permission.CanRead $.UnitTypeIssues) (.Permission.CanRead $.UnitTypePullRequests))}}
  29. <h4 class="ui top attached header">{{.i18n.Tr "repo.activity.overview"}}</h4>
  30. <div class="ui attached segment two column grid">
  31. {{if .Permission.CanRead $.UnitTypePullRequests}}
  32. <div class="column">
  33. {{if gt .Activity.ActivePRCount 0}}
  34. <div class="stats-table">
  35. <a href="#merged-pull-requests" class="table-cell tiny background purple" style="width: {{.Activity.MergedPRPerc}}{{if ne .Activity.MergedPRPerc 0}}%{{end}}"></a>
  36. <a href="#proposed-pull-requests" class="table-cell tiny background green"></a>
  37. </div>
  38. {{else}}
  39. <div class="stats-table">
  40. <a class="table-cell tiny background light grey"></a>
  41. </div>
  42. {{end}}
  43. {{.i18n.Tr (TrN .i18n.Lang .Activity.ActivePRCount "repo.activity.active_prs_count_1" "repo.activity.active_prs_count_n") .Activity.ActivePRCount | Safe }}
  44. </div>
  45. {{end}}
  46. {{if .Permission.CanRead $.UnitTypeIssues}}
  47. <div class="column">
  48. {{if gt .Activity.ActiveIssueCount 0}}
  49. <div class="stats-table">
  50. <a href="#closed-issues" class="table-cell tiny background red" style="width: {{.Activity.ClosedIssuePerc}}{{if ne .Activity.ClosedIssuePerc 0}}%{{end}}"></a>
  51. <a href="#new-issues" class="table-cell tiny background green"></a>
  52. </div>
  53. {{else}}
  54. <div class="stats-table">
  55. <a class="table-cell tiny background light grey"></a>
  56. </div>
  57. {{end}}
  58. {{.i18n.Tr (TrN .i18n.Lang .Activity.ActiveIssueCount "repo.activity.active_issues_count_1" "repo.activity.active_issues_count_n") .Activity.ActiveIssueCount | Safe }}
  59. </div>
  60. {{end}}
  61. </div>
  62. <div class="ui attached segment horizontal segments">
  63. {{if .Permission.CanRead $.UnitTypePullRequests}}
  64. <a href="#merged-pull-requests" class="ui attached segment text center">
  65. <i class="text purple octicon octicon-git-pull-request"></i> <strong>{{.Activity.MergedPRCount}}</strong><br>
  66. {{.i18n.Tr (TrN .i18n.Lang .Activity.MergedPRCount "repo.activity.merged_prs_count_1" "repo.activity.merged_prs_count_n") }}
  67. </a>
  68. <a href="#proposed-pull-requests" class="ui attached segment text center">
  69. <i class="text green octicon octicon-git-branch"></i> <strong>{{.Activity.OpenedPRCount}}</strong><br>
  70. {{.i18n.Tr (TrN .i18n.Lang .Activity.OpenedPRCount "repo.activity.opened_prs_count_1" "repo.activity.opened_prs_count_n") }}
  71. </a>
  72. {{end}}
  73. {{if .Permission.CanRead $.UnitTypeIssues}}
  74. <a href="#closed-issues" class="ui attached segment text center">
  75. <i class="text red octicon octicon-issue-closed"></i> <strong>{{.Activity.ClosedIssueCount}}</strong><br>
  76. {{.i18n.Tr (TrN .i18n.Lang .Activity.ClosedIssueCount "repo.activity.closed_issues_count_1" "repo.activity.closed_issues_count_n") }}
  77. </a>
  78. <a href="#new-issues" class="ui attached segment text center">
  79. <i class="text green octicon octicon-issue-opened"></i> <strong>{{.Activity.OpenedIssueCount}}</strong><br>
  80. {{.i18n.Tr (TrN .i18n.Lang .Activity.OpenedIssueCount "repo.activity.new_issues_count_1" "repo.activity.new_issues_count_n") }}
  81. </a>
  82. {{end}}
  83. </div>
  84. {{end}}
  85. {{if .Permission.CanRead $.UnitTypeCode}}
  86. {{if eq .Activity.Code.CommitCountInAllBranches 0}}
  87. <div class="ui center aligned segment">
  88. <h4 class="ui header">{{.i18n.Tr "repo.activity.no_git_activity" }}</h4>
  89. </div>
  90. {{end}}
  91. {{if gt .Activity.Code.CommitCountInAllBranches 0}}
  92. <div class="ui attached segment horizontal segments">
  93. <div class="ui attached segment text">
  94. {{.i18n.Tr "repo.activity.git_stats_exclude_merges" }}
  95. <strong>{{.i18n.Tr (TrN .i18n.Lang .Activity.Code.AuthorCount "repo.activity.git_stats_author_1" "repo.activity.git_stats_author_n") .Activity.Code.AuthorCount }}</strong>
  96. {{.i18n.Tr (TrN .i18n.Lang .Activity.Code.AuthorCount "repo.activity.git_stats_pushed_1" "repo.activity.git_stats_pushed_n") }}
  97. <strong>{{.i18n.Tr (TrN .i18n.Lang .Activity.Code.CommitCount "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n") .Activity.Code.CommitCount }}</strong>
  98. {{.i18n.Tr "repo.activity.git_stats_push_to_branch" .Repository.DefaultBranch }}
  99. <strong>{{.i18n.Tr (TrN .i18n.Lang .Activity.Code.CommitCountInAllBranches "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n") .Activity.Code.CommitCountInAllBranches }}</strong>
  100. {{.i18n.Tr "repo.activity.git_stats_push_to_all_branches" }}
  101. {{.i18n.Tr "repo.activity.git_stats_on_default_branch" .Repository.DefaultBranch }}
  102. <strong>{{.i18n.Tr (TrN .i18n.Lang .Activity.Code.ChangedFiles "repo.activity.git_stats_file_1" "repo.activity.git_stats_file_n") .Activity.Code.ChangedFiles }}</strong>
  103. {{.i18n.Tr (TrN .i18n.Lang .Activity.Code.ChangedFiles "repo.activity.git_stats_files_changed_1" "repo.activity.git_stats_files_changed_n") }}
  104. {{.i18n.Tr "repo.activity.git_stats_additions" }}
  105. <strong class="text green">{{.i18n.Tr (TrN .i18n.Lang .Activity.Code.Additions "repo.activity.git_stats_addition_1" "repo.activity.git_stats_addition_n") .Activity.Code.Additions }}</strong>
  106. {{.i18n.Tr "repo.activity.git_stats_and_deletions" }}
  107. <strong class="text red">{{.i18n.Tr (TrN .i18n.Lang .Activity.Code.Deletions "repo.activity.git_stats_deletion_1" "repo.activity.git_stats_deletion_n") .Activity.Code.Deletions }}</strong>.
  108. </div>
  109. </div>
  110. {{end}}
  111. {{end}}
  112. {{if gt .Activity.PublishedReleaseCount 0}}
  113. <h4 class="ui horizontal divider header" id="published-releases">
  114. <i class="text octicon octicon-tag"></i>
  115. {{.i18n.Tr "repo.activity.title.releases_published_by" (.i18n.Tr (TrN .i18n.Lang .Activity.PublishedReleaseCount "repo.activity.title.releases_1" "repo.activity.title.releases_n") .Activity.PublishedReleaseCount) (.i18n.Tr (TrN .i18n.Lang .Activity.PublishedReleaseAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n") .Activity.PublishedReleaseAuthorCount) }}
  116. </h4>
  117. <div class="list">
  118. {{range .Activity.PublishedReleases}}
  119. <p class="desc">
  120. <div class="ui green label">{{$.i18n.Tr "repo.activity.published_release_label"}}</div>
  121. {{.TagName}}
  122. {{if not .IsTag}}
  123. <a class="title has-emoji" href="{{$.Repository.HTMLURL}}/src/{{.TagName | EscapePound}}">{{.Title}}</a>
  124. {{end}}
  125. {{TimeSinceUnix .CreatedUnix $.Lang}}
  126. </p>
  127. {{end}}
  128. </div>
  129. {{end}}
  130. {{if gt .Activity.MergedPRCount 0}}
  131. <h4 class="ui horizontal divider header" id="merged-pull-requests">
  132. <i class="text octicon octicon-git-pull-request"></i>
  133. {{.i18n.Tr "repo.activity.title.prs_merged_by" (.i18n.Tr (TrN .i18n.Lang .Activity.MergedPRCount "repo.activity.title.prs_1" "repo.activity.title.prs_n") .Activity.MergedPRCount) (.i18n.Tr (TrN .i18n.Lang .Activity.MergedPRAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n") .Activity.MergedPRAuthorCount) }}
  134. </h4>
  135. <div class="list">
  136. {{range .Activity.MergedPRs}}
  137. <p class="desc">
  138. <div class="ui purple label">{{$.i18n.Tr "repo.activity.merged_prs_label"}}</div>
  139. #{{.Index}} <a class="title has-emoji" href="{{$.Repository.HTMLURL}}/pulls/{{.Index}}">{{.Issue.Title}}</a>
  140. {{TimeSinceUnix .MergedUnix $.Lang}}
  141. </p>
  142. {{end}}
  143. </div>
  144. {{end}}
  145. {{if gt .Activity.OpenedPRCount 0}}
  146. <h4 class="ui horizontal divider header" id="proposed-pull-requests">
  147. <i class="text octicon octicon-git-branch"></i>
  148. {{.i18n.Tr "repo.activity.title.prs_opened_by" (.i18n.Tr (TrN .i18n.Lang .Activity.OpenedPRCount "repo.activity.title.prs_1" "repo.activity.title.prs_n") .Activity.OpenedPRCount) (.i18n.Tr (TrN .i18n.Lang .Activity.OpenedPRAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n") .Activity.OpenedPRAuthorCount) }}
  149. </h4>
  150. <div class="list">
  151. {{range .Activity.OpenedPRs}}
  152. <p class="desc">
  153. <div class="ui green label">{{$.i18n.Tr "repo.activity.opened_prs_label"}}</div>
  154. #{{.Index}} <a class="title has-emoji" href="{{$.Repository.HTMLURL}}/pulls/{{.Index}}">{{.Issue.Title}}</a>
  155. {{TimeSinceUnix .Issue.CreatedUnix $.Lang}}
  156. </p>
  157. {{end}}
  158. </div>
  159. {{end}}
  160. {{if gt .Activity.ClosedIssueCount 0}}
  161. <h4 class="ui horizontal divider header" id="closed-issues">
  162. <i class="text octicon octicon-issue-closed"></i>
  163. {{.i18n.Tr "repo.activity.title.issues_closed_by" (.i18n.Tr (TrN .i18n.Lang .Activity.ClosedIssueCount "repo.activity.title.issues_1" "repo.activity.title.issues_n") .Activity.ClosedIssueCount) (.i18n.Tr (TrN .i18n.Lang .Activity.ClosedIssueAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n") .Activity.ClosedIssueAuthorCount) }}
  164. </h4>
  165. <div class="list">
  166. {{range .Activity.ClosedIssues}}
  167. <p class="desc">
  168. <div class="ui red label">{{$.i18n.Tr "repo.activity.closed_issue_label"}}</div>
  169. #{{.Index}} <a class="title has-emoji" href="{{$.Repository.HTMLURL}}/issues/{{.Index}}">{{.Title}}</a>
  170. {{TimeSinceUnix .ClosedUnix $.Lang}}
  171. </p>
  172. {{end}}
  173. </div>
  174. {{end}}
  175. {{if gt .Activity.OpenedIssueCount 0}}
  176. <h4 class="ui horizontal divider header" id="new-issues">
  177. <i class="text octicon octicon-issue-opened"></i>
  178. {{.i18n.Tr "repo.activity.title.issues_created_by" (.i18n.Tr (TrN .i18n.Lang .Activity.OpenedIssueCount "repo.activity.title.issues_1" "repo.activity.title.issues_n") .Activity.OpenedIssueCount) (.i18n.Tr (TrN .i18n.Lang .Activity.OpenedIssueAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n") .Activity.OpenedIssueAuthorCount) }}
  179. </h4>
  180. <div class="list">
  181. {{range .Activity.OpenedIssues}}
  182. <p class="desc">
  183. <div class="ui green label">{{$.i18n.Tr "repo.activity.new_issue_label"}}</div>
  184. #{{.Index}} <a class="title has-emoji" href="{{$.Repository.HTMLURL}}/issues/{{.Index}}">{{.Title}}</a>
  185. {{TimeSinceUnix .CreatedUnix $.Lang}}
  186. </p>
  187. {{end}}
  188. </div>
  189. {{end}}
  190. {{if gt .Activity.UnresolvedIssueCount 0}}
  191. <h4 class="ui horizontal divider header" id="unresolved-conversations">
  192. <i class="text octicon octicon-comment-discussion"></i>
  193. {{.i18n.Tr (TrN .i18n.Lang .Activity.UnresolvedIssueCount "repo.activity.title.unresolved_conv_1" "repo.activity.title.unresolved_conv_n") .Activity.UnresolvedIssueCount }}
  194. </h4>
  195. <div class="text center desc">
  196. {{.i18n.Tr "repo.activity.unresolved_conv_desc"}}
  197. </div>
  198. <div class="list">
  199. {{range .Activity.UnresolvedIssues}}
  200. <p class="desc">
  201. <div class="ui green label">{{$.i18n.Tr "repo.activity.unresolved_conv_label"}}</div>
  202. #{{.Index}}
  203. {{if .IsPull}}
  204. <a class="title has-emoji" href="{{$.Repository.HTMLURL}}/pulls/{{.Index}}">{{.Title}}</a>
  205. {{else}}
  206. <a class="title has-emoji" href="{{$.Repository.HTMLURL}}/issues/{{.Index}}">{{.Title}}</a>
  207. {{end}}
  208. {{TimeSinceUnix .UpdatedUnix $.Lang}}
  209. </p>
  210. {{end}}
  211. </div>
  212. {{end}}
  213. </div>
  214. </div>
  215. {{template "base/footer" .}}