From 1fa96629461ac4229932b0a4526fc2f60c88ec51 Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Sat, 4 May 2019 15:39:03 +0300 Subject: Git statistics in Activity tab (#4724) * Initial implementation for git statistics in Activity tab * Create top user by commit count endpoint * Add UI and update src-d/go-git dependency * Add coloring * Fix typo * Move git activity stats data extraction to git module * Fix message * Add git code stats test --- templates/repo/activity.tmpl | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'templates') diff --git a/templates/repo/activity.tmpl b/templates/repo/activity.tmpl index 2b8fbc6c1c..5b6559c8bf 100644 --- a/templates/repo/activity.tmpl +++ b/templates/repo/activity.tmpl @@ -81,6 +81,33 @@ {{end}} + {{if .Permission.CanRead $.UnitTypeCode}} + {{if eq .Activity.Code.CommitCountInAllBranches 0}} +
+

{{.i18n.Tr "repo.activity.no_git_activity" }}

+
+ {{end}} + {{if gt .Activity.Code.CommitCountInAllBranches 0}} +
+
+ {{.i18n.Tr "repo.activity.git_stats_exclude_merges" }} + {{.i18n.Tr (TrN .i18n.Lang .Activity.Code.AuthorCount "repo.activity.git_stats_author_1" "repo.activity.git_stats_author_n") .Activity.Code.AuthorCount }} + {{.i18n.Tr "repo.activity.git_stats_pushed" }} + {{.i18n.Tr (TrN .i18n.Lang .Activity.Code.CommitCount "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n") .Activity.Code.CommitCount }} + {{.i18n.Tr "repo.activity.git_stats_push_to_branch" .Repository.DefaultBranch }} + {{.i18n.Tr (TrN .i18n.Lang .Activity.Code.CommitCountInAllBranches "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n") .Activity.Code.CommitCountInAllBranches }} + {{.i18n.Tr "repo.activity.git_stats_push_to_all_branches" }} + {{.i18n.Tr "repo.activity.git_stats_on_default_branch" .Repository.DefaultBranch }} + {{.i18n.Tr (TrN .i18n.Lang .Activity.Code.ChangedFiles "repo.activity.git_stats_file_1" "repo.activity.git_stats_file_n") .Activity.Code.ChangedFiles }} + {{.i18n.Tr "repo.activity.git_stats_files_changed" }} + {{.i18n.Tr (TrN .i18n.Lang .Activity.Code.Additions "repo.activity.git_stats_addition_1" "repo.activity.git_stats_addition_n") .Activity.Code.Additions }} + {{.i18n.Tr "repo.activity.git_stats_and_deletions" }} + {{.i18n.Tr (TrN .i18n.Lang .Activity.Code.Deletions "repo.activity.git_stats_deletion_1" "repo.activity.git_stats_deletion_n") .Activity.Code.Deletions }}. +
+
+ {{end}} + {{end}} + {{if gt .Activity.PublishedReleaseCount 0}}

-- cgit v1.2.3