summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorŞahin Akkaya <sahin@sahinakkaya.dev>2024-02-16 01:21:13 +0300
committerGitHub <noreply@github.com>2024-02-15 23:21:13 +0100
commit21331be30cb8f6c2d8b9dd99f1061623900632b9 (patch)
tree779a5766d030183c98351dd04fb0c119891af8f3 /templates
parent07597c71a4b6642beae7589c678603f4846f7920 (diff)
downloadgitea-21331be30cb8f6c2d8b9dd99f1061623900632b9.tar.gz
gitea-21331be30cb8f6c2d8b9dd99f1061623900632b9.zip
Implement contributors graph (#27882)
Continuation of https://github.com/go-gitea/gitea/pull/25439. Fixes #847 Before: <img width="1296" alt="image" src="https://github.com/go-gitea/gitea/assets/32161460/24571ac8-b254-43c9-b178-97340f0dc8a9"> ---- After: <img width="1296" alt="image" src="https://github.com/go-gitea/gitea/assets/32161460/c60b2459-9d10-4d42-8d83-d5ef0f45bf94"> --- #### Overview This is the implementation of a requested feature: Contributors graph (#847) It makes Activity page a multi-tab page and adds a new tab called Contributors. Contributors tab shows the contribution graphs over time since the repository existed. It also shows per user contribution graphs for top 100 contributors. Top 100 is calculated based on the selected contribution type (commits, additions or deletions). --- #### Demo (The demo is a bit old but still a good example to show off the main features) <video src="https://github.com/go-gitea/gitea/assets/32161460/9f68103f-8145-4cc2-94bc-5546daae7014" controls width="320" height="240"> <a href="https://github.com/go-gitea/gitea/assets/32161460/9f68103f-8145-4cc2-94bc-5546daae7014">Download</a> </video> #### Features: - Select contribution type (commits, additions or deletions) - See overall and per user contribution graphs for the selected contribution type - Zoom and pan on graphs to see them in detail - See top 100 contributors based on the selected contribution type and selected time range - Go directly to users' profile by clicking their name if they are registered gitea users - Cache the results so that when the same repository is visited again fetching data will be faster --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: hiifong <i@hiif.ong> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: yp05327 <576951401@qq.com>
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/activity.tmpl234
-rw-r--r--templates/repo/contributors.tmpl13
-rw-r--r--templates/repo/navbar.tmpl8
-rw-r--r--templates/repo/pulse.tmpl227
4 files changed, 255 insertions, 227 deletions
diff --git a/templates/repo/activity.tmpl b/templates/repo/activity.tmpl
index 3149f20670..960083d2fb 100644
--- a/templates/repo/activity.tmpl
+++ b/templates/repo/activity.tmpl
@@ -1,235 +1,15 @@
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content repository commits">
{{template "repo/header" .}}
- <div class="ui container">
- <h2 class="ui header activity-header">
- <span>{{DateTime "long" .DateFrom}} - {{DateTime "long" .DateUntil}}</span>
- <!-- Period -->
- <div class="ui floating dropdown jump filter">
- <div class="ui basic compact button">
- {{ctx.Locale.Tr "repo.activity.period.filter_label"}} <strong>{{.PeriodText}}</strong>
- {{svg "octicon-triangle-down" 14 "dropdown icon"}}
- </div>
- <div class="menu">
- <a class="{{if eq .Period "daily"}}active {{end}}item" href="{{$.RepoLink}}/activity/daily">{{ctx.Locale.Tr "repo.activity.period.daily"}}</a>
- <a class="{{if eq .Period "halfweekly"}}active {{end}}item" href="{{$.RepoLink}}/activity/halfweekly">{{ctx.Locale.Tr "repo.activity.period.halfweekly"}}</a>
- <a class="{{if eq .Period "weekly"}}active {{end}}item" href="{{$.RepoLink}}/activity/weekly">{{ctx.Locale.Tr "repo.activity.period.weekly"}}</a>
- <a class="{{if eq .Period "monthly"}}active {{end}}item" href="{{$.RepoLink}}/activity/monthly">{{ctx.Locale.Tr "repo.activity.period.monthly"}}</a>
- <a class="{{if eq .Period "quarterly"}}active {{end}}item" href="{{$.RepoLink}}/activity/quarterly">{{ctx.Locale.Tr "repo.activity.period.quarterly"}}</a>
- <a class="{{if eq .Period "semiyearly"}}active {{end}}item" href="{{$.RepoLink}}/activity/semiyearly">{{ctx.Locale.Tr "repo.activity.period.semiyearly"}}</a>
- <a class="{{if eq .Period "yearly"}}active {{end}}item" href="{{$.RepoLink}}/activity/yearly">{{ctx.Locale.Tr "repo.activity.period.yearly"}}</a>
- </div>
- </div>
- </h2>
- <div class="divider"></div>
-
- {{if (or (.Permission.CanRead $.UnitTypeIssues) (.Permission.CanRead $.UnitTypePullRequests))}}
- <h4 class="ui top attached header">{{ctx.Locale.Tr "repo.activity.overview"}}</h4>
- <div class="ui attached segment two column grid">
- {{if .Permission.CanRead $.UnitTypePullRequests}}
- <div class="column">
- {{if gt .Activity.ActivePRCount 0}}
- <div class="stats-table">
- <a href="#merged-pull-requests" class="table-cell tiny background purple" style="width: {{.Activity.MergedPRPerc}}{{if ne .Activity.MergedPRPerc 0}}%{{end}}"></a>
- <a href="#proposed-pull-requests" class="table-cell tiny background green"></a>
- </div>
- {{else}}
- <div class="stats-table">
- <a class="table-cell tiny background light grey"></a>
- </div>
- {{end}}
- {{ctx.Locale.TrN .Activity.ActivePRCount "repo.activity.active_prs_count_1" "repo.activity.active_prs_count_n" .Activity.ActivePRCount | Safe}}
- </div>
- {{end}}
- {{if .Permission.CanRead $.UnitTypeIssues}}
- <div class="column">
- {{if gt .Activity.ActiveIssueCount 0}}
- <div class="stats-table">
- <a href="#closed-issues" class="table-cell tiny background red" style="width: {{.Activity.ClosedIssuePerc}}{{if ne .Activity.ClosedIssuePerc 0}}%{{end}}"></a>
- <a href="#new-issues" class="table-cell tiny background green"></a>
- </div>
- {{else}}
- <div class="stats-table">
- <a class="table-cell tiny background light grey"></a>
- </div>
- {{end}}
- {{ctx.Locale.TrN .Activity.ActiveIssueCount "repo.activity.active_issues_count_1" "repo.activity.active_issues_count_n" .Activity.ActiveIssueCount | Safe}}
- </div>
- {{end}}
+ <div class="ui container flex-container">
+ <div class="flex-container-nav">
+ {{template "repo/navbar" .}}
</div>
- <div class="ui attached segment horizontal segments">
- {{if .Permission.CanRead $.UnitTypePullRequests}}
- <a href="#merged-pull-requests" class="ui attached segment text center">
- <span class="text purple">{{svg "octicon-git-pull-request"}}</span> <strong>{{.Activity.MergedPRCount}}</strong><br>
- {{ctx.Locale.TrN .Activity.MergedPRCount "repo.activity.merged_prs_count_1" "repo.activity.merged_prs_count_n"}}
- </a>
- <a href="#proposed-pull-requests" class="ui attached segment text center">
- <span class="text green">{{svg "octicon-git-branch"}}</span> <strong>{{.Activity.OpenedPRCount}}</strong><br>
- {{ctx.Locale.TrN .Activity.OpenedPRCount "repo.activity.opened_prs_count_1" "repo.activity.opened_prs_count_n"}}
- </a>
- {{end}}
- {{if .Permission.CanRead $.UnitTypeIssues}}
- <a href="#closed-issues" class="ui attached segment text center">
- <span class="text red">{{svg "octicon-issue-closed"}}</span> <strong>{{.Activity.ClosedIssueCount}}</strong><br>
- {{ctx.Locale.TrN .Activity.ClosedIssueCount "repo.activity.closed_issues_count_1" "repo.activity.closed_issues_count_n"}}
- </a>
- <a href="#new-issues" class="ui attached segment text center">
- <span class="text green">{{svg "octicon-issue-opened"}}</span> <strong>{{.Activity.OpenedIssueCount}}</strong><br>
- {{ctx.Locale.TrN .Activity.OpenedIssueCount "repo.activity.new_issues_count_1" "repo.activity.new_issues_count_n"}}
- </a>
- {{end}}
+ <div class="flex-container-main">
+ {{if .PageIsPulse}}{{template "repo/pulse" .}}{{end}}
+ {{if .PageIsContributors}}{{template "repo/contributors" .}}{{end}}
</div>
- {{end}}
-
- {{if .Permission.CanRead $.UnitTypeCode}}
- {{if eq .Activity.Code.CommitCountInAllBranches 0}}
- <div class="ui center aligned segment">
- <h4 class="ui header">{{ctx.Locale.Tr "repo.activity.no_git_activity"}}</h4>
- </div>
- {{end}}
- {{if gt .Activity.Code.CommitCountInAllBranches 0}}
- <div class="ui attached segment horizontal segments">
- <div class="ui attached segment text">
- {{ctx.Locale.Tr "repo.activity.git_stats_exclude_merges"}}
- <strong>{{ctx.Locale.TrN .Activity.Code.AuthorCount "repo.activity.git_stats_author_1" "repo.activity.git_stats_author_n" .Activity.Code.AuthorCount}}</strong>
- {{ctx.Locale.TrN .Activity.Code.AuthorCount "repo.activity.git_stats_pushed_1" "repo.activity.git_stats_pushed_n"}}
- <strong>{{ctx.Locale.TrN .Activity.Code.CommitCount "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n" .Activity.Code.CommitCount}}</strong>
- {{ctx.Locale.Tr "repo.activity.git_stats_push_to_branch" .Repository.DefaultBranch}}
- <strong>{{ctx.Locale.TrN .Activity.Code.CommitCountInAllBranches "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n" .Activity.Code.CommitCountInAllBranches}}</strong>
- {{ctx.Locale.Tr "repo.activity.git_stats_push_to_all_branches"}}
- {{ctx.Locale.Tr "repo.activity.git_stats_on_default_branch" .Repository.DefaultBranch}}
- <strong>{{ctx.Locale.TrN .Activity.Code.ChangedFiles "repo.activity.git_stats_file_1" "repo.activity.git_stats_file_n" .Activity.Code.ChangedFiles}}</strong>
- {{ctx.Locale.TrN .Activity.Code.ChangedFiles "repo.activity.git_stats_files_changed_1" "repo.activity.git_stats_files_changed_n"}}
- {{ctx.Locale.Tr "repo.activity.git_stats_additions"}}
- <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>
- {{ctx.Locale.Tr "repo.activity.git_stats_and_deletions"}}
- <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>.
- </div>
- <div class="ui attached segment">
- <div id="repo-activity-top-authors-chart"></div>
- </div>
- </div>
- {{end}}
- {{end}}
-
- {{if gt .Activity.PublishedReleaseCount 0}}
- <h4 class="divider divider-text gt-normal-case" id="published-releases">
- {{svg "octicon-tag" 16 "gt-mr-3"}}
- {{ctx.Locale.Tr "repo.activity.title.releases_published_by"
- (ctx.Locale.TrN .Activity.PublishedReleaseCount "repo.activity.title.releases_1" "repo.activity.title.releases_n" .Activity.PublishedReleaseCount)
- (ctx.Locale.TrN .Activity.PublishedReleaseAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.PublishedReleaseAuthorCount)
- }}
- </h4>
- <div class="list">
- {{range .Activity.PublishedReleases}}
- <p class="desc">
- <span class="ui green label">{{ctx.Locale.Tr "repo.activity.published_release_label"}}</span>
- {{.TagName}}
- {{if not .IsTag}}
- <a class="title" href="{{$.RepoLink}}/src/{{.TagName | PathEscapeSegments}}">{{.Title | RenderEmoji $.Context | RenderCodeBlock}}</a>
- {{end}}
- {{TimeSinceUnix .CreatedUnix ctx.Locale}}
- </p>
- {{end}}
- </div>
- {{end}}
-
- {{if gt .Activity.MergedPRCount 0}}
- <h4 class="divider divider-text gt-normal-case" id="merged-pull-requests">
- {{svg "octicon-git-pull-request" 16 "gt-mr-3"}}
- {{ctx.Locale.Tr "repo.activity.title.prs_merged_by"
- (ctx.Locale.TrN .Activity.MergedPRCount "repo.activity.title.prs_1" "repo.activity.title.prs_n" .Activity.MergedPRCount)
- (ctx.Locale.TrN .Activity.MergedPRAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.MergedPRAuthorCount)
- }}
- </h4>
- <div class="list">
- {{range .Activity.MergedPRs}}
- <p class="desc">
- <span class="ui purple label">{{ctx.Locale.Tr "repo.activity.merged_prs_label"}}</span>
- #{{.Index}} <a class="title" href="{{$.RepoLink}}/pulls/{{.Index}}">{{.Issue.Title | RenderEmoji $.Context | RenderCodeBlock}}</a>
- {{TimeSinceUnix .MergedUnix ctx.Locale}}
- </p>
- {{end}}
- </div>
- {{end}}
-
- {{if gt .Activity.OpenedPRCount 0}}
- <h4 class="divider divider-text gt-normal-case" id="proposed-pull-requests">
- {{svg "octicon-git-branch" 16 "gt-mr-3"}}
- {{ctx.Locale.Tr "repo.activity.title.prs_opened_by"
- (ctx.Locale.TrN .Activity.OpenedPRCount "repo.activity.title.prs_1" "repo.activity.title.prs_n" .Activity.OpenedPRCount)
- (ctx.Locale.TrN .Activity.OpenedPRAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.OpenedPRAuthorCount)
- }}
- </h4>
- <div class="list">
- {{range .Activity.OpenedPRs}}
- <p class="desc">
- <span class="ui green label">{{ctx.Locale.Tr "repo.activity.opened_prs_label"}}</span>
- #{{.Index}} <a class="title" href="{{$.RepoLink}}/pulls/{{.Index}}">{{.Issue.Title | RenderEmoji $.Context | RenderCodeBlock}}</a>
- {{TimeSinceUnix .Issue.CreatedUnix ctx.Locale}}
- </p>
- {{end}}
- </div>
- {{end}}
-
- {{if gt .Activity.ClosedIssueCount 0}}
- <h4 class="divider divider-text gt-normal-case" id="closed-issues">
- {{svg "octicon-issue-closed" 16 "gt-mr-3"}}
- {{ctx.Locale.Tr "repo.activity.title.issues_closed_from"
- (ctx.Locale.TrN .Activity.ClosedIssueCount "repo.activity.title.issues_1" "repo.activity.title.issues_n" .Activity.ClosedIssueCount)
- (ctx.Locale.TrN .Activity.ClosedIssueAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.ClosedIssueAuthorCount)
- }}
- </h4>
- <div class="list">
- {{range .Activity.ClosedIssues}}
- <p class="desc">
- <span class="ui red label">{{ctx.Locale.Tr "repo.activity.closed_issue_label"}}</span>
- #{{.Index}} <a class="title" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title | RenderEmoji $.Context | RenderCodeBlock}}</a>
- {{TimeSinceUnix .ClosedUnix ctx.Locale}}
- </p>
- {{end}}
- </div>
- {{end}}
-
- {{if gt .Activity.OpenedIssueCount 0}}
- <h4 class="divider divider-text gt-normal-case" id="new-issues">
- {{svg "octicon-issue-opened" 16 "gt-mr-3"}}
- {{ctx.Locale.Tr "repo.activity.title.issues_created_by"
- (ctx.Locale.TrN .Activity.OpenedIssueCount "repo.activity.title.issues_1" "repo.activity.title.issues_n" .Activity.OpenedIssueCount)
- (ctx.Locale.TrN .Activity.OpenedIssueAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.OpenedIssueAuthorCount)
- }}
- </h4>
- <div class="list">
- {{range .Activity.OpenedIssues}}
- <p class="desc">
- <span class="ui green label">{{ctx.Locale.Tr "repo.activity.new_issue_label"}}</span>
- #{{.Index}} <a class="title" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title | RenderEmoji $.Context | RenderCodeBlock}}</a>
- {{TimeSinceUnix .CreatedUnix ctx.Locale}}
- </p>
- {{end}}
- </div>
- {{end}}
-
- {{if gt .Activity.UnresolvedIssueCount 0}}
- <h4 class="divider divider-text gt-normal-case" id="unresolved-conversations" data-tooltip-content="{{ctx.Locale.Tr "repo.activity.unresolved_conv_desc"}}">
- {{svg "octicon-comment-discussion" 16 "gt-mr-3"}}
- {{ctx.Locale.TrN .Activity.UnresolvedIssueCount "repo.activity.title.unresolved_conv_1" "repo.activity.title.unresolved_conv_n" .Activity.UnresolvedIssueCount}}
- </h4>
- <div class="list">
- {{range .Activity.UnresolvedIssues}}
- <p class="desc">
- <span class="ui green label">{{ctx.Locale.Tr "repo.activity.unresolved_conv_label"}}</span>
- #{{.Index}}
- {{if .IsPull}}
- <a class="title" href="{{$.RepoLink}}/pulls/{{.Index}}">{{.Title | RenderEmoji $.Context | RenderCodeBlock}}</a>
- {{else}}
- <a class="title" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title | RenderEmoji $.Context | RenderCodeBlock}}</a>
- {{end}}
- {{TimeSinceUnix .UpdatedUnix ctx.Locale}}
- </p>
- {{end}}
- </div>
- {{end}}
</div>
</div>
{{template "base/footer" .}}
+
diff --git a/templates/repo/contributors.tmpl b/templates/repo/contributors.tmpl
new file mode 100644
index 0000000000..49a251c1f9
--- /dev/null
+++ b/templates/repo/contributors.tmpl
@@ -0,0 +1,13 @@
+{{if .Permission.CanRead $.UnitTypeCode}}
+ <div id="repo-contributors-chart"
+ data-locale-filter-label="{{ctx.Locale.Tr "repo.contributors.contribution_type.filter_label"}}"
+ data-locale-contribution-type-commits="{{ctx.Locale.Tr "repo.contributors.contribution_type.commits"}}"
+ data-locale-contribution-type-additions="{{ctx.Locale.Tr "repo.contributors.contribution_type.additions"}}"
+ data-locale-contribution-type-deletions="{{ctx.Locale.Tr "repo.contributors.contribution_type.deletions"}}"
+ data-locale-loading-title="{{ctx.Locale.Tr "repo.contributors.loading_title"}}"
+ data-locale-loading-title-failed="{{ctx.Locale.Tr "repo.contributors.loading_title_failed"}}"
+ data-locale-loading-info="{{ctx.Locale.Tr "repo.contributors.loading_info"}}"
+ data-locale-component-failed-to-load="{{ctx.Locale.Tr "repo.contributors.component_failed_to_load"}}"
+ >
+ </div>
+{{end}}
diff --git a/templates/repo/navbar.tmpl b/templates/repo/navbar.tmpl
new file mode 100644
index 0000000000..a9042ee30d
--- /dev/null
+++ b/templates/repo/navbar.tmpl
@@ -0,0 +1,8 @@
+<div class="ui fluid vertical menu">
+ <a class="{{if .PageIsPulse}}active {{end}}item" href="{{.RepoLink}}/activity">
+ {{ctx.Locale.Tr "repo.activity.navbar.pulse"}}
+ </a>
+ <a class="{{if .PageIsContributors}}active {{end}}item" href="{{.RepoLink}}/activity/contributors">
+ {{ctx.Locale.Tr "repo.activity.navbar.contributors"}}
+ </a>
+</div>
diff --git a/templates/repo/pulse.tmpl b/templates/repo/pulse.tmpl
new file mode 100644
index 0000000000..ccd7ebf6b5
--- /dev/null
+++ b/templates/repo/pulse.tmpl
@@ -0,0 +1,227 @@
+<h2 class="ui header activity-header">
+ <span>{{DateTime "long" .DateFrom}} - {{DateTime "long" .DateUntil}}</span>
+ <!-- Period -->
+ <div class="ui floating dropdown jump filter">
+ <div class="ui basic compact button">
+ {{ctx.Locale.Tr "repo.activity.period.filter_label"}} <strong>{{.PeriodText}}</strong>
+ {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+ </div>
+ <div class="menu">
+ <a class="{{if eq .Period "daily"}}active {{end}}item" href="{{$.RepoLink}}/activity/daily">{{ctx.Locale.Tr "repo.activity.period.daily"}}</a>
+ <a class="{{if eq .Period "halfweekly"}}active {{end}}item" href="{{$.RepoLink}}/activity/halfweekly">{{ctx.Locale.Tr "repo.activity.period.halfweekly"}}</a>
+ <a class="{{if eq .Period "weekly"}}active {{end}}item" href="{{$.RepoLink}}/activity/weekly">{{ctx.Locale.Tr "repo.activity.period.weekly"}}</a>
+ <a class="{{if eq .Period "monthly"}}active {{end}}item" href="{{$.RepoLink}}/activity/monthly">{{ctx.Locale.Tr "repo.activity.period.monthly"}}</a>
+ <a class="{{if eq .Period "quarterly"}}active {{end}}item" href="{{$.RepoLink}}/activity/quarterly">{{ctx.Locale.Tr "repo.activity.period.quarterly"}}</a>
+ <a class="{{if eq .Period "semiyearly"}}active {{end}}item" href="{{$.RepoLink}}/activity/semiyearly">{{ctx.Locale.Tr "repo.activity.period.semiyearly"}}</a>
+ <a class="{{if eq .Period "yearly"}}active {{end}}item" href="{{$.RepoLink}}/activity/yearly">{{ctx.Locale.Tr "repo.activity.period.yearly"}}</a>
+ </div>
+ </div>
+</h2>
+
+{{if (or (.Permission.CanRead $.UnitTypeIssues) (.Permission.CanRead $.UnitTypePullRequests))}}
+<h4 class="ui top attached header">{{ctx.Locale.Tr "repo.activity.overview"}}</h4>
+<div class="ui attached segment two column grid">
+ {{if .Permission.CanRead $.UnitTypePullRequests}}
+ <div class="column">
+ {{if gt .Activity.ActivePRCount 0}}
+ <div class="stats-table">
+ <a href="#merged-pull-requests" class="table-cell tiny background purple" style="width: {{.Activity.MergedPRPerc}}{{if ne .Activity.MergedPRPerc 0}}%{{end}}"></a>
+ <a href="#proposed-pull-requests" class="table-cell tiny background green"></a>
+ </div>
+ {{else}}
+ <div class="stats-table">
+ <a class="table-cell tiny background light grey"></a>
+ </div>
+ {{end}}
+ {{ctx.Locale.TrN .Activity.ActivePRCount "repo.activity.active_prs_count_1" "repo.activity.active_prs_count_n" .Activity.ActivePRCount | Safe}}
+ </div>
+ {{end}}
+ {{if .Permission.CanRead $.UnitTypeIssues}}
+ <div class="column">
+ {{if gt .Activity.ActiveIssueCount 0}}
+ <div class="stats-table">
+ <a href="#closed-issues" class="table-cell tiny background red" style="width: {{.Activity.ClosedIssuePerc}}{{if ne .Activity.ClosedIssuePerc 0}}%{{end}}"></a>
+ <a href="#new-issues" class="table-cell tiny background green"></a>
+ </div>
+ {{else}}
+ <div class="stats-table">
+ <a class="table-cell tiny background light grey"></a>
+ </div>
+ {{end}}
+ {{ctx.Locale.TrN .Activity.ActiveIssueCount "repo.activity.active_issues_count_1" "repo.activity.active_issues_count_n" .Activity.ActiveIssueCount | Safe}}
+ </div>
+ {{end}}
+</div>
+<div class="ui attached segment horizontal segments">
+ {{if .Permission.CanRead $.UnitTypePullRequests}}
+ <a href="#merged-pull-requests" class="ui attached segment text center">
+ <span class="text purple">{{svg "octicon-git-pull-request"}}</span> <strong>{{.Activity.MergedPRCount}}</strong><br>
+ {{ctx.Locale.TrN .Activity.MergedPRCount "repo.activity.merged_prs_count_1" "repo.activity.merged_prs_count_n"}}
+ </a>
+ <a href="#proposed-pull-requests" class="ui attached segment text center">
+ <span class="text green">{{svg "octicon-git-branch"}}</span> <strong>{{.Activity.OpenedPRCount}}</strong><br>
+ {{ctx.Locale.TrN .Activity.OpenedPRCount "repo.activity.opened_prs_count_1" "repo.activity.opened_prs_count_n"}}
+ </a>
+ {{end}}
+ {{if .Permission.CanRead $.UnitTypeIssues}}
+ <a href="#closed-issues" class="ui attached segment text center">
+ <span class="text red">{{svg "octicon-issue-closed"}}</span> <strong>{{.Activity.ClosedIssueCount}}</strong><br>
+ {{ctx.Locale.TrN .Activity.ClosedIssueCount "repo.activity.closed_issues_count_1" "repo.activity.closed_issues_count_n"}}
+ </a>
+ <a href="#new-issues" class="ui attached segment text center">
+ <span class="text green">{{svg "octicon-issue-opened"}}</span> <strong>{{.Activity.OpenedIssueCount}}</strong><br>
+ {{ctx.Locale.TrN .Activity.OpenedIssueCount "repo.activity.new_issues_count_1" "repo.activity.new_issues_count_n"}}
+ </a>
+ {{end}}
+</div>
+{{end}}
+
+{{if .Permission.CanRead $.UnitTypeCode}}
+ {{if eq .Activity.Code.CommitCountInAllBranches 0}}
+ <div class="ui center aligned segment">
+ <h4 class="ui header">{{ctx.Locale.Tr "repo.activity.no_git_activity"}}</h4>
+ </div>
+ {{end}}
+ {{if gt .Activity.Code.CommitCountInAllBranches 0}}
+ <div class="ui attached segment horizontal segments">
+ <div class="ui attached segment text">
+ {{ctx.Locale.Tr "repo.activity.git_stats_exclude_merges"}}
+ <strong>{{ctx.Locale.TrN .Activity.Code.AuthorCount "repo.activity.git_stats_author_1" "repo.activity.git_stats_author_n" .Activity.Code.AuthorCount}}</strong>
+ {{ctx.Locale.TrN .Activity.Code.AuthorCount "repo.activity.git_stats_pushed_1" "repo.activity.git_stats_pushed_n"}}
+ <strong>{{ctx.Locale.TrN .Activity.Code.CommitCount "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n" .Activity.Code.CommitCount}}</strong>
+ {{ctx.Locale.Tr "repo.activity.git_stats_push_to_branch" .Repository.DefaultBranch}}
+ <strong>{{ctx.Locale.TrN .Activity.Code.CommitCountInAllBranches "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n" .Activity.Code.CommitCountInAllBranches}}</strong>
+ {{ctx.Locale.Tr "repo.activity.git_stats_push_to_all_branches"}}
+ {{ctx.Locale.Tr "repo.activity.git_stats_on_default_branch" .Repository.DefaultBranch}}
+ <strong>{{ctx.Locale.TrN .Activity.Code.ChangedFiles "repo.activity.git_stats_file_1" "repo.activity.git_stats_file_n" .Activity.Code.ChangedFiles}}</strong>
+ {{ctx.Locale.TrN .Activity.Code.ChangedFiles "repo.activity.git_stats_files_changed_1" "repo.activity.git_stats_files_changed_n"}}
+ {{ctx.Locale.Tr "repo.activity.git_stats_additions"}}
+ <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>
+ {{ctx.Locale.Tr "repo.activity.git_stats_and_deletions"}}
+ <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>.
+ </div>
+ <div class="ui attached segment">
+ <div id="repo-activity-top-authors-chart"></div>
+ </div>
+ </div>
+ {{end}}
+{{end}}
+
+{{if gt .Activity.PublishedReleaseCount 0}}
+ <h4 class="divider divider-text gt-normal-case" id="published-releases">
+ {{svg "octicon-tag" 16 "gt-mr-3"}}
+ {{ctx.Locale.Tr "repo.activity.title.releases_published_by"
+ (ctx.Locale.TrN .Activity.PublishedReleaseCount "repo.activity.title.releases_1" "repo.activity.title.releases_n" .Activity.PublishedReleaseCount)
+ (ctx.Locale.TrN .Activity.PublishedReleaseAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.PublishedReleaseAuthorCount)
+ }}
+ </h4>
+ <div class="list">
+ {{range .Activity.PublishedReleases}}
+ <p class="desc">
+ <span class="ui green label">{{ctx.Locale.Tr "repo.activity.published_release_label"}}</span>
+ {{.TagName}}
+ {{if not .IsTag}}
+ <a class="title" href="{{$.RepoLink}}/src/{{.TagName | PathEscapeSegments}}">{{.Title | RenderEmoji $.Context | RenderCodeBlock}}</a>
+ {{end}}
+ {{TimeSinceUnix .CreatedUnix ctx.Locale}}
+ </p>
+ {{end}}
+ </div>
+{{end}}
+
+{{if gt .Activity.MergedPRCount 0}}
+ <h4 class="divider divider-text gt-normal-case" id="merged-pull-requests">
+ {{svg "octicon-git-pull-request" 16 "gt-mr-3"}}
+ {{ctx.Locale.Tr "repo.activity.title.prs_merged_by"
+ (ctx.Locale.TrN .Activity.MergedPRCount "repo.activity.title.prs_1" "repo.activity.title.prs_n" .Activity.MergedPRCount)
+ (ctx.Locale.TrN .Activity.MergedPRAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.MergedPRAuthorCount)
+ }}
+ </h4>
+ <div class="list">
+ {{range .Activity.MergedPRs}}
+ <p class="desc">
+ <span class="ui purple label">{{ctx.Locale.Tr "repo.activity.merged_prs_label"}}</span>
+ #{{.Index}} <a class="title" href="{{$.RepoLink}}/pulls/{{.Index}}">{{.Issue.Title | RenderEmoji $.Context | RenderCodeBlock}}</a>
+ {{TimeSinceUnix .MergedUnix ctx.Locale}}
+ </p>
+ {{end}}
+ </div>
+{{end}}
+
+{{if gt .Activity.OpenedPRCount 0}}
+ <h4 class="divider divider-text gt-normal-case" id="proposed-pull-requests">
+ {{svg "octicon-git-branch" 16 "gt-mr-3"}}
+ {{ctx.Locale.Tr "repo.activity.title.prs_opened_by"
+ (ctx.Locale.TrN .Activity.OpenedPRCount "repo.activity.title.prs_1" "repo.activity.title.prs_n" .Activity.OpenedPRCount)
+ (ctx.Locale.TrN .Activity.OpenedPRAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.OpenedPRAuthorCount)
+ }}
+ </h4>
+ <div class="list">
+ {{range .Activity.OpenedPRs}}
+ <p class="desc">
+ <span class="ui green label">{{ctx.Locale.Tr "repo.activity.opened_prs_label"}}</span>
+ #{{.Index}} <a class="title" href="{{$.RepoLink}}/pulls/{{.Index}}">{{.Issue.Title | RenderEmoji $.Context | RenderCodeBlock}}</a>
+ {{TimeSinceUnix .Issue.CreatedUnix ctx.Locale}}
+ </p>
+ {{end}}
+ </div>
+{{end}}
+
+{{if gt .Activity.ClosedIssueCount 0}}
+ <h4 class="divider divider-text gt-normal-case" id="closed-issues">
+ {{svg "octicon-issue-closed" 16 "gt-mr-3"}}
+ {{ctx.Locale.Tr "repo.activity.title.issues_closed_from"
+ (ctx.Locale.TrN .Activity.ClosedIssueCount "repo.activity.title.issues_1" "repo.activity.title.issues_n" .Activity.ClosedIssueCount)
+ (ctx.Locale.TrN .Activity.ClosedIssueAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.ClosedIssueAuthorCount)
+ }}
+ </h4>
+ <div class="list">
+ {{range .Activity.ClosedIssues}}
+ <p class="desc">
+ <span class="ui red label">{{ctx.Locale.Tr "repo.activity.closed_issue_label"}}</span>
+ #{{.Index}} <a class="title" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title | RenderEmoji $.Context | RenderCodeBlock}}</a>
+ {{TimeSinceUnix .ClosedUnix ctx.Locale}}
+ </p>
+ {{end}}
+ </div>
+{{end}}
+
+{{if gt .Activity.OpenedIssueCount 0}}
+ <h4 class="divider divider-text gt-normal-case" id="new-issues">
+ {{svg "octicon-issue-opened" 16 "gt-mr-3"}}
+ {{ctx.Locale.Tr "repo.activity.title.issues_created_by"
+ (ctx.Locale.TrN .Activity.OpenedIssueCount "repo.activity.title.issues_1" "repo.activity.title.issues_n" .Activity.OpenedIssueCount)
+ (ctx.Locale.TrN .Activity.OpenedIssueAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.OpenedIssueAuthorCount)
+ }}
+ </h4>
+ <div class="list">
+ {{range .Activity.OpenedIssues}}
+ <p class="desc">
+ <span class="ui green label">{{ctx.Locale.Tr "repo.activity.new_issue_label"}}</span>
+ #{{.Index}} <a class="title" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title | RenderEmoji $.Context | RenderCodeBlock}}</a>
+ {{TimeSinceUnix .CreatedUnix ctx.Locale}}
+ </p>
+ {{end}}
+ </div>
+{{end}}
+
+{{if gt .Activity.UnresolvedIssueCount 0}}
+ <h4 class="divider divider-text gt-normal-case" id="unresolved-conversations" data-tooltip-content="{{ctx.Locale.Tr "repo.activity.unresolved_conv_desc"}}">
+ {{svg "octicon-comment-discussion" 16 "gt-mr-3"}}
+ {{ctx.Locale.TrN .Activity.UnresolvedIssueCount "repo.activity.title.unresolved_conv_1" "repo.activity.title.unresolved_conv_n" .Activity.UnresolvedIssueCount}}
+ </h4>
+ <div class="list">
+ {{range .Activity.UnresolvedIssues}}
+ <p class="desc">
+ <span class="ui green label">{{ctx.Locale.Tr "repo.activity.unresolved_conv_label"}}</span>
+ #{{.Index}}
+ {{if .IsPull}}
+ <a class="title" href="{{$.RepoLink}}/pulls/{{.Index}}">{{.Title | RenderEmoji $.Context | RenderCodeBlock}}</a>
+ {{else}}
+ <a class="title" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title | RenderEmoji $.Context | RenderCodeBlock}}</a>
+ {{end}}
+ {{TimeSinceUnix .UpdatedUnix ctx.Locale}}
+ </p>
+ {{end}}
+ </div>
+{{end}}