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

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