diff options
author | Şahin Akkaya <sahin@sahinakkaya.dev> | 2024-02-24 13:22:51 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-24 10:22:51 +0000 |
commit | d3982bcd814bac93e3cbce1c7eb749b17e413fbd (patch) | |
tree | efac566be7e2d432017a58012954d77a159bce9f /templates | |
parent | 0a426cc575734e5eff410d6a790f40473117f753 (diff) | |
download | gitea-d3982bcd814bac93e3cbce1c7eb749b17e413fbd.tar.gz gitea-d3982bcd814bac93e3cbce1c7eb749b17e413fbd.zip |
Implement recent commits graph (#29210)
This is the implementation of Recent Commits page. This feature was
mentioned on #18262.
It adds another tab to Activity page called Recent Commits. Recent
Commits tab shows number of commits since last year for the repository.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/activity.tmpl | 1 | ||||
-rw-r--r-- | templates/repo/navbar.tmpl | 3 | ||||
-rw-r--r-- | templates/repo/recent_commits.tmpl | 9 |
3 files changed, 13 insertions, 0 deletions
diff --git a/templates/repo/activity.tmpl b/templates/repo/activity.tmpl index 94f52b0e26..a19fb66261 100644 --- a/templates/repo/activity.tmpl +++ b/templates/repo/activity.tmpl @@ -9,6 +9,7 @@ {{if .PageIsPulse}}{{template "repo/pulse" .}}{{end}} {{if .PageIsContributors}}{{template "repo/contributors" .}}{{end}} {{if .PageIsCodeFrequency}}{{template "repo/code_frequency" .}}{{end}} + {{if .PageIsRecentCommits}}{{template "repo/recent_commits" .}}{{end}} </div> </div> </div> diff --git a/templates/repo/navbar.tmpl b/templates/repo/navbar.tmpl index aa5021e73a..b2471dc17e 100644 --- a/templates/repo/navbar.tmpl +++ b/templates/repo/navbar.tmpl @@ -8,4 +8,7 @@ <a class="{{if .PageIsCodeFrequency}}active{{end}} item" href="{{.RepoLink}}/activity/code-frequency"> {{ctx.Locale.Tr "repo.activity.navbar.code_frequency"}} </a> + <a class="{{if .PageIsRecentCommits}}active{{end}} item" href="{{.RepoLink}}/activity/recent-commits"> + {{ctx.Locale.Tr "repo.activity.navbar.recent_commits"}} + </a> </div> diff --git a/templates/repo/recent_commits.tmpl b/templates/repo/recent_commits.tmpl new file mode 100644 index 0000000000..5c241d635c --- /dev/null +++ b/templates/repo/recent_commits.tmpl @@ -0,0 +1,9 @@ +{{if .Permission.CanRead $.UnitTypeCode}} + <div id="repo-recent-commits-chart" + data-locale-loading-title="{{ctx.Locale.Tr "graphs.component_loading" (ctx.Locale.Tr "graphs.recent_commits.what")}}" + data-locale-loading-title-failed="{{ctx.Locale.Tr "graphs.component_loading_failed" (ctx.Locale.Tr "graphs.recent_commits.what")}}" + data-locale-loading-info="{{ctx.Locale.Tr "graphs.component_loading_info"}}" + data-locale-component-failed-to-load="{{ctx.Locale.Tr "graphs.component_failed_to_load"}}" + > + </div> +{{end}} |