Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

pulse.tmpl 12KB

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