本站源代码
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

221 lignes
12KB

  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. </div>
  21. </div>
  22. </div>
  23. </h2>
  24. <div class="ui divider"></div>
  25. {{if (or (.Permission.CanRead $.UnitTypeIssues) (.Permission.CanRead $.UnitTypePullRequests))}}
  26. <h4 class="ui top attached header">{{.i18n.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. {{.i18n.Tr (TrN .i18n.Lang .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. {{.i18n.Tr (TrN .i18n.Lang .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. <i class="text purple octicon octicon-git-pull-request"></i> <strong>{{.Activity.MergedPRCount}}</strong><br>
  63. {{.i18n.Tr (TrN .i18n.Lang .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. <i class="text green octicon octicon-git-branch"></i> <strong>{{.Activity.OpenedPRCount}}</strong><br>
  67. {{.i18n.Tr (TrN .i18n.Lang .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. <i class="text red octicon octicon-issue-closed"></i> <strong>{{.Activity.ClosedIssueCount}}</strong><br>
  73. {{.i18n.Tr (TrN .i18n.Lang .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. <i class="text green octicon octicon-issue-opened"></i> <strong>{{.Activity.OpenedIssueCount}}</strong><br>
  77. {{.i18n.Tr (TrN .i18n.Lang .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">{{.i18n.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. {{.i18n.Tr "repo.activity.git_stats_exclude_merges" }}
  92. <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>
  93. {{.i18n.Tr (TrN .i18n.Lang .Activity.Code.AuthorCount "repo.activity.git_stats_pushed_1" "repo.activity.git_stats_pushed_n") }}
  94. <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>
  95. {{.i18n.Tr "repo.activity.git_stats_push_to_branch" .Repository.DefaultBranch }}
  96. <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>
  97. {{.i18n.Tr "repo.activity.git_stats_push_to_all_branches" }}
  98. {{.i18n.Tr "repo.activity.git_stats_on_default_branch" .Repository.DefaultBranch }}
  99. <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>
  100. {{.i18n.Tr (TrN .i18n.Lang .Activity.Code.ChangedFiles "repo.activity.git_stats_files_changed_1" "repo.activity.git_stats_files_changed_n") }}
  101. {{.i18n.Tr "repo.activity.git_stats_additions" }}
  102. <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>
  103. {{.i18n.Tr "repo.activity.git_stats_and_deletions" }}
  104. <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>.
  105. </div>
  106. </div>
  107. {{end}}
  108. {{end}}
  109. {{if gt .Activity.PublishedReleaseCount 0}}
  110. <h4 class="ui horizontal divider header" id="published-releases">
  111. <i class="text octicon octicon-tag"></i>
  112. {{.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) }}
  113. </h4>
  114. <div class="list">
  115. {{range .Activity.PublishedReleases}}
  116. <p class="desc">
  117. <div class="ui green label">{{$.i18n.Tr "repo.activity.published_release_label"}}</div>
  118. {{.TagName}}
  119. {{if not .IsTag}}
  120. <a class="title has-emoji" href="{{$.Repository.HTMLURL}}/src/{{.TagName | EscapePound}}">{{.Title}}</a>
  121. {{end}}
  122. {{TimeSinceUnix .CreatedUnix $.Lang}}
  123. </p>
  124. {{end}}
  125. </div>
  126. {{end}}
  127. {{if gt .Activity.MergedPRCount 0}}
  128. <h4 class="ui horizontal divider header" id="merged-pull-requests">
  129. <i class="text octicon octicon-git-pull-request"></i>
  130. {{.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) }}
  131. </h4>
  132. <div class="list">
  133. {{range .Activity.MergedPRs}}
  134. <p class="desc">
  135. <div class="ui purple label">{{$.i18n.Tr "repo.activity.merged_prs_label"}}</div>
  136. #{{.Index}} <a class="title has-emoji" href="{{$.Repository.HTMLURL}}/pulls/{{.Index}}">{{.Issue.Title}}</a>
  137. {{TimeSinceUnix .MergedUnix $.Lang}}
  138. </p>
  139. {{end}}
  140. </div>
  141. {{end}}
  142. {{if gt .Activity.OpenedPRCount 0}}
  143. <h4 class="ui horizontal divider header" id="proposed-pull-requests">
  144. <i class="text octicon octicon-git-branch"></i>
  145. {{.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) }}
  146. </h4>
  147. <div class="list">
  148. {{range .Activity.OpenedPRs}}
  149. <p class="desc">
  150. <div class="ui green label">{{$.i18n.Tr "repo.activity.opened_prs_label"}}</div>
  151. #{{.Index}} <a class="title has-emoji" href="{{$.Repository.HTMLURL}}/pulls/{{.Index}}">{{.Issue.Title}}</a>
  152. {{TimeSinceUnix .Issue.CreatedUnix $.Lang}}
  153. </p>
  154. {{end}}
  155. </div>
  156. {{end}}
  157. {{if gt .Activity.ClosedIssueCount 0}}
  158. <h4 class="ui horizontal divider header" id="closed-issues">
  159. <i class="text octicon octicon-issue-closed"></i>
  160. {{.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) }}
  161. </h4>
  162. <div class="list">
  163. {{range .Activity.ClosedIssues}}
  164. <p class="desc">
  165. <div class="ui red label">{{$.i18n.Tr "repo.activity.closed_issue_label"}}</div>
  166. #{{.Index}} <a class="title has-emoji" href="{{$.Repository.HTMLURL}}/issues/{{.Index}}">{{.Title}}</a>
  167. {{TimeSinceUnix .ClosedUnix $.Lang}}
  168. </p>
  169. {{end}}
  170. </div>
  171. {{end}}
  172. {{if gt .Activity.OpenedIssueCount 0}}
  173. <h4 class="ui horizontal divider header" id="new-issues">
  174. <i class="text octicon octicon-issue-opened"></i>
  175. {{.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) }}
  176. </h4>
  177. <div class="list">
  178. {{range .Activity.OpenedIssues}}
  179. <p class="desc">
  180. <div class="ui green label">{{$.i18n.Tr "repo.activity.new_issue_label"}}</div>
  181. #{{.Index}} <a class="title has-emoji" href="{{$.Repository.HTMLURL}}/issues/{{.Index}}">{{.Title}}</a>
  182. {{TimeSinceUnix .CreatedUnix $.Lang}}
  183. </p>
  184. {{end}}
  185. </div>
  186. {{end}}
  187. {{if gt .Activity.UnresolvedIssueCount 0}}
  188. <h4 class="ui horizontal divider header" id="unresolved-conversations">
  189. <i class="text octicon octicon-comment-discussion"></i>
  190. {{.i18n.Tr (TrN .i18n.Lang .Activity.UnresolvedIssueCount "repo.activity.title.unresolved_conv_1" "repo.activity.title.unresolved_conv_n") .Activity.UnresolvedIssueCount }}
  191. </h4>
  192. <div class="text center desc">
  193. {{.i18n.Tr "repo.activity.unresolved_conv_desc"}}
  194. </div>
  195. <div class="list">
  196. {{range .Activity.UnresolvedIssues}}
  197. <p class="desc">
  198. <div class="ui green label">{{$.i18n.Tr "repo.activity.unresolved_conv_label"}}</div>
  199. #{{.Index}}
  200. {{if .IsPull}}
  201. <a class="title has-emoji" href="{{$.Repository.HTMLURL}}/pulls/{{.Index}}">{{.Title}}</a>
  202. {{else}}
  203. <a class="title has-emoji" href="{{$.Repository.HTMLURL}}/issues/{{.Index}}">{{.Title}}</a>
  204. {{end}}
  205. {{TimeSinceUnix .UpdatedUnix $.Lang}}
  206. </p>
  207. {{end}}
  208. </div>
  209. {{end}}
  210. </div>
  211. </div>
  212. {{template "base/footer" .}}
上海开阖软件有限公司 沪ICP备12045867号-1