Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User and repository statistic #7728

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions conf/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,24 @@ wiki.page_already_exists = Wiki page with same name already exists.
wiki.pages = Pages
wiki.last_updated = Last updated %s

insights = Insights
insights.contributors = Contributors
insights.contributions = Contributions
insights.contributions_commits = Commits
insights.contributions_additions = Additions
insights.contributions_deletions = Deletions
insights.contributor.num_of_commits = "%d commits"
insights.contributor.num_of_additions = "%d ++"
insights.contributor.num_of_deletions = "%d --"
insights.commits = Commits
insights.commits_by_week = "Commits by Week"
insights.commits_in_a_week = "Commits in a Week"
insights.code_frequency = "Code Frequency"
insights.code_frequency_header = "Code frequency over the history of %s"
insights.contributors_desc = Contributions to branch %s, excluding merge commits
insights.additions = "Additions"
insights.deletions = "Deletions"

settings = Settings
settings.options = Options
settings.collaboration = Collaboration
Expand Down
10 changes: 10 additions & 0 deletions internal/cmd/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,16 @@ func runWeb(c *cli.Context) error {

m.Get("/compare/:before([a-z0-9]{40})\\.\\.\\.:after([a-z0-9]{40})", repo.MustBeNotBare, context.RepoRef(), repo.CompareDiff)
}, ignSignIn, context.RepoAssignment())

m.Group("/:username/:reponame", func() {
// below are the group for repo insights path
m.Group("/graphs", func() {
m.Get("/contributors", repo.MustBeNotBare, repo.InsightContributorsPage)
m.Get("/commits", repo.MustBeNotBare, repo.InsightCommitsPage)
m.Get("/code_frequency", repo.MustBeNotBare, repo.InsightCodeFrequencyPage)
}, repo.InsightsGroup)
}, ignSignIn, context.RepoAssignment())

m.Group("/:username/:reponame", func() {
m.Get("", repo.Home)
m.Get("/stars", repo.Stars)
Expand Down