diff options
author | Lauris BH <lauris@nix.lv> | 2019-05-04 15:39:03 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-04 15:39:03 +0300 |
commit | 1fa96629461ac4229932b0a4526fc2f60c88ec51 (patch) | |
tree | caa3906758c6998bb6450932393336ac57c3db19 /templates/repo | |
parent | 2933ae4e88bb954af76c4e1e67c7ab1e4892e4a4 (diff) | |
download | gitea-1fa96629461ac4229932b0a4526fc2f60c88ec51.tar.gz gitea-1fa96629461ac4229932b0a4526fc2f60c88ec51.zip |
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
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/activity.tmpl | 27 |
1 files changed, 27 insertions, 0 deletions
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 @@ </div> {{end}} + {{if .Permission.CanRead $.UnitTypeCode}} + {{if eq .Activity.Code.CommitCountInAllBranches 0}} + <div class="ui center aligned segment"> + <h4 class="ui header">{{.i18n.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"> + {{.i18n.Tr "repo.activity.git_stats_exclude_merges" }} + <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> + {{.i18n.Tr "repo.activity.git_stats_pushed" }} + <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> + {{.i18n.Tr "repo.activity.git_stats_push_to_branch" .Repository.DefaultBranch }} + <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> + {{.i18n.Tr "repo.activity.git_stats_push_to_all_branches" }} + {{.i18n.Tr "repo.activity.git_stats_on_default_branch" .Repository.DefaultBranch }} + <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> + {{.i18n.Tr "repo.activity.git_stats_files_changed" }} + <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> + {{.i18n.Tr "repo.activity.git_stats_and_deletions" }} + <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>. + </div> + </div> + {{end}} + {{end}} + {{if gt .Activity.PublishedReleaseCount 0}} <h4 class="ui horizontal divider header" id="published-releases"> <i class="text octicon octicon-tag"></i> |