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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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"><time data-format="date" datetime="{{.DateFrom}}">{{.DateFrom}}</time> - <time data-format="date" datetime="{{.DateUntil}}">{{.DateUntil}}</time>
  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. {{.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. </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">{{.locale.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. {{.locale.TrN .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. {{.locale.TrN .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. {{.locale.TrN .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. {{.locale.TrN .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. {{.locale.TrN .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. {{.locale.TrN .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">{{.locale.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. {{.locale.Tr "repo.activity.git_stats_exclude_merges"}}
  95. <strong>{{.locale.TrN .Activity.Code.AuthorCount "repo.activity.git_stats_author_1" "repo.activity.git_stats_author_n" .Activity.Code.AuthorCount}}</strong>
  96. {{.locale.TrN .Activity.Code.AuthorCount "repo.activity.git_stats_pushed_1" "repo.activity.git_stats_pushed_n"}}
  97. <strong>{{.locale.TrN .Activity.Code.CommitCount "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n" .Activity.Code.CommitCount}}</strong>
  98. {{.locale.Tr "repo.activity.git_stats_push_to_branch" .Repository.DefaultBranch}}
  99. <strong>{{.locale.TrN .Activity.Code.CommitCountInAllBranches "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n" .Activity.Code.CommitCountInAllBranches}}</strong>
  100. {{.locale.Tr "repo.activity.git_stats_push_to_all_branches"}}
  101. {{.locale.Tr "repo.activity.git_stats_on_default_branch" .Repository.DefaultBranch}}
  102. <strong>{{.locale.TrN .Activity.Code.ChangedFiles "repo.activity.git_stats_file_1" "repo.activity.git_stats_file_n" .Activity.Code.ChangedFiles}}</strong>
  103. {{.locale.TrN .Activity.Code.ChangedFiles "repo.activity.git_stats_files_changed_1" "repo.activity.git_stats_files_changed_n"}}
  104. {{.locale.Tr "repo.activity.git_stats_additions"}}
  105. <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>
  106. {{.locale.Tr "repo.activity.git_stats_and_deletions"}}
  107. <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>.
  108. </div>
  109. <div class="ui attached segment">
  110. <div id="repo-activity-top-authors-chart"></div>
  111. </div>
  112. </div>
  113. {{end}}
  114. {{end}}
  115. {{if gt .Activity.PublishedReleaseCount 0}}
  116. <h4 class="ui horizontal divider header" id="published-releases">
  117. <span class="text">{{svg "octicon-tag"}}</span>
  118. {{.locale.Tr "repo.activity.title.releases_published_by"
  119. (.locale.TrN .Activity.PublishedReleaseCount "repo.activity.title.releases_1" "repo.activity.title.releases_n" .Activity.PublishedReleaseCount)
  120. (.locale.TrN .Activity.PublishedReleaseAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.PublishedReleaseAuthorCount)
  121. }}
  122. </h4>
  123. <div class="list">
  124. {{range .Activity.PublishedReleases}}
  125. <p class="desc">
  126. <span class="ui green label">{{$.locale.Tr "repo.activity.published_release_label"}}</span>
  127. {{.TagName}}
  128. {{if not .IsTag}}
  129. <a class="title" href="{{$.RepoLink}}/src/{{.TagName | PathEscapeSegments}}">{{.Title | RenderEmoji}}</a>
  130. {{end}}
  131. {{TimeSinceUnix .CreatedUnix $.locale}}
  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. {{.locale.Tr "repo.activity.title.prs_merged_by"
  140. (.locale.TrN .Activity.MergedPRCount "repo.activity.title.prs_1" "repo.activity.title.prs_n" .Activity.MergedPRCount)
  141. (.locale.TrN .Activity.MergedPRAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.MergedPRAuthorCount)
  142. }}
  143. </h4>
  144. <div class="list">
  145. {{range .Activity.MergedPRs}}
  146. <p class="desc">
  147. <span class="ui purple label">{{$.locale.Tr "repo.activity.merged_prs_label"}}</span>
  148. #{{.Index}} <a class="title" href="{{$.RepoLink}}/pulls/{{.Index}}">{{.Issue.Title | RenderEmoji}}</a>
  149. {{TimeSinceUnix .MergedUnix $.locale}}
  150. </p>
  151. {{end}}
  152. </div>
  153. {{end}}
  154. {{if gt .Activity.OpenedPRCount 0}}
  155. <h4 class="ui horizontal divider header" id="proposed-pull-requests">
  156. <span class="text">{{svg "octicon-git-branch"}}</span>
  157. {{.locale.Tr "repo.activity.title.prs_opened_by"
  158. (.locale.TrN .Activity.OpenedPRCount "repo.activity.title.prs_1" "repo.activity.title.prs_n" .Activity.OpenedPRCount)
  159. (.locale.TrN .Activity.OpenedPRAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.OpenedPRAuthorCount)
  160. }}
  161. </h4>
  162. <div class="list">
  163. {{range .Activity.OpenedPRs}}
  164. <p class="desc">
  165. <span class="ui green label">{{$.locale.Tr "repo.activity.opened_prs_label"}}</span>
  166. #{{.Index}} <a class="title" href="{{$.RepoLink}}/pulls/{{.Index}}">{{.Issue.Title | RenderEmoji}}</a>
  167. {{TimeSinceUnix .Issue.CreatedUnix $.locale}}
  168. </p>
  169. {{end}}
  170. </div>
  171. {{end}}
  172. {{if gt .Activity.ClosedIssueCount 0}}
  173. <h4 class="ui horizontal divider header" id="closed-issues">
  174. <span class="text">{{svg "octicon-issue-closed"}}</span>
  175. {{.locale.Tr "repo.activity.title.issues_closed_from"
  176. (.locale.TrN .Activity.ClosedIssueCount "repo.activity.title.issues_1" "repo.activity.title.issues_n" .Activity.ClosedIssueCount)
  177. (.locale.TrN .Activity.ClosedIssueAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.ClosedIssueAuthorCount)
  178. }}
  179. </h4>
  180. <div class="list">
  181. {{range .Activity.ClosedIssues}}
  182. <p class="desc">
  183. <span class="ui red label">{{$.locale.Tr "repo.activity.closed_issue_label"}}</span>
  184. #{{.Index}} <a class="title" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title | RenderEmoji}}</a>
  185. {{TimeSinceUnix .ClosedUnix $.locale}}
  186. </p>
  187. {{end}}
  188. </div>
  189. {{end}}
  190. {{if gt .Activity.OpenedIssueCount 0}}
  191. <h4 class="ui horizontal divider header" id="new-issues">
  192. <span class="text">{{svg "octicon-issue-opened"}}</span>
  193. {{.locale.Tr "repo.activity.title.issues_created_by"
  194. (.locale.TrN .Activity.OpenedIssueCount "repo.activity.title.issues_1" "repo.activity.title.issues_n" .Activity.OpenedIssueCount)
  195. (.locale.TrN .Activity.OpenedIssueAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.OpenedIssueAuthorCount)
  196. }}
  197. </h4>
  198. <div class="list">
  199. {{range .Activity.OpenedIssues}}
  200. <p class="desc">
  201. <span class="ui green label">{{$.locale.Tr "repo.activity.new_issue_label"}}</span>
  202. #{{.Index}} <a class="title" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title | RenderEmoji}}</a>
  203. {{TimeSinceUnix .CreatedUnix $.locale}}
  204. </p>
  205. {{end}}
  206. </div>
  207. {{end}}
  208. {{if gt .Activity.UnresolvedIssueCount 0}}
  209. <h4 class="ui horizontal divider header" id="unresolved-conversations">
  210. <span class="text">{{svg "octicon-comment-discussion"}}</span>
  211. {{.locale.TrN .Activity.UnresolvedIssueCount "repo.activity.title.unresolved_conv_1" "repo.activity.title.unresolved_conv_n" .Activity.UnresolvedIssueCount}}
  212. </h4>
  213. <div class="text center desc">
  214. {{.locale.Tr "repo.activity.unresolved_conv_desc"}}
  215. </div>
  216. <div class="list">
  217. {{range .Activity.UnresolvedIssues}}
  218. <p class="desc">
  219. <span class="ui green label">{{$.locale.Tr "repo.activity.unresolved_conv_label"}}</span>
  220. #{{.Index}}
  221. {{if .IsPull}}
  222. <a class="title" href="{{$.RepoLink}}/pulls/{{.Index}}">{{.Title | RenderEmoji}}</a>
  223. {{else}}
  224. <a class="title" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title | RenderEmoji}}</a>
  225. {{end}}
  226. {{TimeSinceUnix .UpdatedUnix $.locale}}
  227. </p>
  228. {{end}}
  229. </div>
  230. {{end}}
  231. </div>
  232. </div>
  233. {{template "base/footer" .}}