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 13KB

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