aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorŞahin Akkaya <sahin@sahinakkaya.dev>2024-02-24 13:22:51 +0300
committerGitHub <noreply@github.com>2024-02-24 10:22:51 +0000
commitd3982bcd814bac93e3cbce1c7eb749b17e413fbd (patch)
treeefac566be7e2d432017a58012954d77a159bce9f /templates
parent0a426cc575734e5eff410d6a790f40473117f753 (diff)
downloadgitea-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.tmpl1
-rw-r--r--templates/repo/navbar.tmpl3
-rw-r--r--templates/repo/recent_commits.tmpl9
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}}