Skip to content

Commit

Permalink
Add UI and update src-d/go-git dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
lafriks committed Feb 23, 2019
1 parent dd732dd commit afa37b6
Show file tree
Hide file tree
Showing 29 changed files with 641 additions and 200 deletions.
8 changes: 4 additions & 4 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,24 @@ activity.title.releases_1 = %d Release
activity.title.releases_n = %d Releases
activity.title.releases_published_by = %s published by %s
activity.published_release_label = Published
activity.no_git_activity = There has been any commit activity in this period.
activity.git_stats_exclude_merges = Excluding merges,
activity.git_stats_author_1 = %d author
activity.git_stats_author_n = %d authors
activity.git_stats_pushed = has pushed
activity.git_stats_commit_1 = %d commit
activity.git_stats_commit_n = %d commits
activity.git_stats_push_to_branch = to %s and
activity.git_stats_push_to_all_branches = to all branches.
activity.git_stats_on_default_branch = On %s,
activity.git_stats_file_1 = %d file
activity.git_stats_file_n = %d files
activity.git_stats_files_changed = have changed and there have been
activity.git_stats_addition_1 = %d addition
activity.git_stats_addition_n = %d additions
activity.git_stats_and_deletions = and
activity.git_stats_deletion_1 = %d deletion
activity.git_stats_deletion_n = %d deletions
search = Search
search.search_repo = Search repository
Expand Down
2 changes: 1 addition & 1 deletion routers/repo/activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func Activity(ctx *context.Context) {
ctx.Data["PeriodText"] = ctx.Tr("repo.activity.period." + ctx.Data["Period"].(string))

var err error
if ctx.Data["Activity"], err = models.GetActivityStats(ctx.Repo.Repository.ID, timeFrom,
if ctx.Data["Activity"], err = models.GetActivityStats(ctx.Repo.Repository, timeFrom,
ctx.Repo.CanRead(models.UnitTypeReleases),
ctx.Repo.CanRead(models.UnitTypeIssues),
ctx.Repo.CanRead(models.UnitTypePullRequests),
Expand Down
34 changes: 26 additions & 8 deletions templates/repo/activity.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,32 @@
</div>
{{end}}

<span>
Excluding merges, <strong>{{.Activity.Code.AuthorCount}} authors</strong>
has pushed <strong>{{.Activity.Code.CommitCount}} commits</strong> to {{.Repository.DefaultBranch}}
and <strong>{{.Activity.Code.CommitCountInAllBranches}} commits</strong> to all branches.
On {{.Repository.DefaultBranch}}, <strong>{{.Activity.Code.ChangedFiles}} files</strong> have changed
and there have been <strong>{{.Activity.Code.Additions}} additions</strong>
and <strong>{{.Activity.Code.Deletions}} deletions</strong>.
</span>
{{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>{{.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>{{.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">
Expand Down
5 changes: 5 additions & 0 deletions vendor/gopkg.in/src-d/go-git.v4/config/config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions vendor/gopkg.in/src-d/go-git.v4/internal/url/url.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions vendor/gopkg.in/src-d/go-git.v4/options.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit afa37b6

Please sign in to comment.