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.

229 lines
13 KiB

  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. <span class="text purple">{{svg "octicon-git-pull-request"}}</span> <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. <span class="text green">{{svg "octicon-git-branch"}}</span> <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. <span class="text red">{{svg "octicon-issue-closed"}}</span> <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. <span class="text green">{{svg "octicon-issue-opened"}}</span> <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 class="ui attached segment" id="app">
  110. <script type="text/javascript">
  111. var ActivityTopAuthors = {{Json .ActivityTopAuthors | SafeJS}};
  112. </script>
  113. <activity-top-authors :data="activityTopAuthors" />
  114. </div>
  115. </div>
  116. {{end}}
  117. {{end}}
  118. {{if gt .Activity.PublishedReleaseCount 0}}
  119. <h4 class="ui horizontal divider header" id="published-releases">
  120. <span class="text">{{svg "octicon-tag"}}</span>
  121. {{.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) }}
  122. </h4>
  123. <div class="list">
  124. {{range .Activity.PublishedReleases}}
  125. <p class="desc">
  126. <div class="ui green label">{{$.i18n.Tr "repo.activity.published_release_label"}}</div>
  127. {{.TagName}}
  128. {{if not .IsTag}}
  129. <a class="title" href="{{$.RepoLink}}/src/{{.TagName | EscapePound}}">{{.Title | RenderEmoji}}</a>
  130. {{end}}
  131. {{TimeSinceUnix .CreatedUnix $.Lang}}
  132. </p>
  133. {{end}}
  134. </div>
  135. {{end}}
  136. {{if gt .Activity.MergedPRCount 0}}
  137. <h4 class="ui horizontal divider header" id="merged-pull-requests">
  138. <span class="text">{{svg "octicon-git-pull-request"}}</span>
  139. {{.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) }}
  140. </h4>
  141. <div class="list">
  142. {{range .Activity.MergedPRs}}
  143. <p class="desc">
  144. <div class="ui purple label">{{$.i18n.Tr "repo.activity.merged_prs_label"}}</div>
  145. #{{.Index}} <a class="title" href="{{$.RepoLink}}/pulls/{{.Index}}">{{.Issue.Title | RenderEmoji}}</a>
  146. {{TimeSinceUnix .MergedUnix $.Lang}}
  147. </p>
  148. {{end}}
  149. </div>
  150. {{end}}
  151. {{if gt .Activity.OpenedPRCount 0}}
  152. <h4 class="ui horizontal divider header" id="proposed-pull-requests">
  153. <span class="text">{{svg "octicon-git-branch"}}</span>
  154. {{.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) }}
  155. </h4>
  156. <div class="list">
  157. {{range .Activity.OpenedPRs}}
  158. <p class="desc">
  159. <div class="ui green label">{{$.i18n.Tr "repo.activity.opened_prs_label"}}</div>
  160. #{{.Index}} <a class="title" href="{{$.RepoLink}}/pulls/{{.Index}}">{{.Issue.Title | RenderEmoji}}</a>
  161. {{TimeSinceUnix .Issue.CreatedUnix $.Lang}}
  162. </p>
  163. {{end}}
  164. </div>
  165. {{end}}
  166. {{if gt .Activity.ClosedIssueCount 0}}
  167. <h4 class="ui horizontal divider header" id="closed-issues">
  168. <span class="text">{{svg "octicon-issue-closed"}}</span>
  169. {{.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) }}
  170. </h4>
  171. <div class="list">
  172. {{range .Activity.ClosedIssues}}
  173. <p class="desc">
  174. <div class="ui red label">{{$.i18n.Tr "repo.activity.closed_issue_label"}}</div>
  175. #{{.Index}} <a class="title" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title | RenderEmoji}}</a>
  176. {{TimeSinceUnix .ClosedUnix $.Lang}}
  177. </p>
  178. {{end}}
  179. </div>
  180. {{end}}
  181. {{if gt .Activity.OpenedIssueCount 0}}
  182. <h4 class="ui horizontal divider header" id="new-issues">
  183. <span class="text">{{svg "octicon-issue-opened"}}</span>
  184. {{.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) }}
  185. </h4>
  186. <div class="list">
  187. {{range .Activity.OpenedIssues}}
  188. <p class="desc">
  189. <div class="ui green label">{{$.i18n.Tr "repo.activity.new_issue_label"}}</div>
  190. #{{.Index}} <a class="title" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title | RenderEmoji}}</a>
  191. {{TimeSinceUnix .CreatedUnix $.Lang}}
  192. </p>
  193. {{end}}
  194. </div>
  195. {{end}}
  196. {{if gt .Activity.UnresolvedIssueCount 0}}
  197. <h4 class="ui horizontal divider header" id="unresolved-conversations">
  198. <span class="text">{{svg "octicon-comment-discussion"}}</span>
  199. {{.i18n.Tr (TrN .i18n.Lang .Activity.UnresolvedIssueCount "repo.activity.title.unresolved_conv_1" "repo.activity.title.unresolved_conv_n") .Activity.UnresolvedIssueCount }}
  200. </h4>
  201. <div class="text center desc">
  202. {{.i18n.Tr "repo.activity.unresolved_conv_desc"}}
  203. </div>
  204. <div class="list">
  205. {{range .Activity.UnresolvedIssues}}
  206. <p class="desc">
  207. <div class="ui green label">{{$.i18n.Tr "repo.activity.unresolved_conv_label"}}</div>
  208. #{{.Index}}
  209. {{if .IsPull}}
  210. <a class="title" href="{{$.RepoLink}}/pulls/{{.Index}}">{{.Title | RenderEmoji}}</a>
  211. {{else}}
  212. <a class="title" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title | RenderEmoji}}</a>
  213. {{end}}
  214. {{TimeSinceUnix .UpdatedUnix $.Lang}}
  215. </p>
  216. {{end}}
  217. </div>
  218. {{end}}
  219. </div>
  220. </div>
  221. {{template "base/footer" .}}