Files
gitea/templates/user/profile.tmpl
Admin 54510ce582
Some checks failed
Build and Release / Create Release (push) Has been skipped
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 1m36s
Build and Release / Lint (push) Failing after 1m55s
Build and Release / Build Binaries (amd64, darwin) (push) Has been skipped
Build and Release / Build Binaries (amd64, linux) (push) Has been skipped
Build and Release / Build Binaries (amd64, windows) (push) Has been skipped
Build and Release / Build Binaries (arm64, darwin) (push) Has been skipped
Build and Release / Build Binaries (arm64, linux) (push) Has been skipped
Build and Release / Unit Tests (push) Successful in 2m4s
feat: add activity heatmap on profile overview
- Add ShowHeatmapOnProfile field to user model
- Add checkbox in user settings under privacy section
- Display heatmap on profile overview page when enabled
- Users can now show their contribution activity on their profile

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 02:22:40 +00:00

116 lines
4.0 KiB
Handlebars

{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content user profile">
<div class="ui container">
<div class="ui stackable grid">
<div class="ui four wide column">
{{template "shared/user/profile_big_avatar" .}}
</div>
<div class="ui twelve wide column tw-mb-4">
{{template "user/overview/header" .}}
{{if eq .TabName "activity"}}
{{if .ContextUser.KeepActivityPrivate}}
<div class="ui info message">
<p>{{ctx.Locale.Tr "user.disabled_public_activity"}}</p>
</div>
{{end}}
{{template "user/heatmap" .}}
{{template "user/dashboard/feeds" .}}
{{else if eq .TabName "stars"}}
<div class="stars">
{{template "shared/repo/search" .}}
{{template "shared/repo/list" .}}
{{template "base/paginate" .}}
</div>
{{else if eq .TabName "following"}}
{{template "repo/user_cards" .}}
{{else if eq .TabName "followers"}}
{{template "repo/user_cards" .}}
{{else if eq .TabName "overview"}}
{{/* Activity Heatmap on Overview */}}
{{if and .ContextUser.ShowHeatmapOnProfile .HeatmapData}}
<div class="ui segment tw-mb-4">
<h4 class="ui header tw-flex tw-items-center">
{{svg "octicon-graph" 16}} {{ctx.Locale.Tr "user.activity_heatmap"}}
</h4>
{{template "user/heatmap" .}}
</div>
{{end}}
{{/* Pinned Repositories Section */}}
{{if or .UserPinnedRepos .IsContextUserProfile}}
<div class="ui segment pinned-repos-section tw-mb-4">
<h4 class="ui header tw-flex tw-items-center">
{{svg "octicon-pin" 16}} {{ctx.Locale.Tr "user.pinned_repos"}}
{{if .IsContextUserProfile}}
<span class="tw-ml-auto text grey tw-text-sm">{{ctx.Locale.Tr "user.pinned_repos_hint"}}</span>
{{end}}
</h4>
{{if .UserPinnedRepos}}
<div class="ui three stackable cards pinned-repos">
{{range .UserPinnedRepos}}
{{if .Repo}}
<a class="ui card" href="{{.Repo.Link}}">
<div class="content">
<div class="header text truncate">
{{if .Repo.IsPrivate}}{{svg "octicon-lock" 16}}{{else if .Repo.IsFork}}{{svg "octicon-repo-forked" 16}}{{else if .Repo.IsMirror}}{{svg "octicon-mirror" 16}}{{else}}{{svg "octicon-repo" 16}}{{end}}
{{if ne .Repo.OwnerID $.ContextUser.ID}}
<span class="text grey">{{.Repo.Owner.Name}}/</span>
{{end}}
{{.Repo.Name}}
</div>
{{if .Repo.Description}}
<div class="description text truncate">{{.Repo.Description}}</div>
{{end}}
</div>
<div class="extra content">
{{if .Repo.PrimaryLanguage}}
<span class="tw-mr-2">
<span class="repo-language-color" style="background-color: {{.Repo.PrimaryLanguage.Color}}"></span>
{{.Repo.PrimaryLanguage.Language}}
</span>
{{end}}
{{if .Repo.NumStars}}
<span class="tw-mr-2">{{svg "octicon-star" 14}} {{.Repo.NumStars}}</span>
{{end}}
{{if .Repo.NumForks}}
<span>{{svg "octicon-repo-forked" 14}} {{.Repo.NumForks}}</span>
{{end}}
</div>
</a>
{{end}}
{{end}}
</div>
{{else if .IsContextUserProfile}}
<div class="ui placeholder segment tw-text-center">
<div class="ui icon header">
{{svg "octicon-pin" 32}}
<div class="content">
{{ctx.Locale.Tr "user.pinned_repos_empty_title"}}
<div class="sub header">
{{ctx.Locale.Tr "user.pinned_repos_empty_desc"}}
</div>
</div>
</div>
</div>
{{end}}
</div>
{{end}}
{{/* Profile README */}}
{{if .ProfileReadmeContent}}
<div id="readme_profile" class="render-content markup">{{.ProfileReadmeContent}}</div>
{{end}}
{{else if eq .TabName "organizations"}}
{{template "repo/user_cards" .}}
{{else}}
{{template "shared/repo/search" .}}
{{template "shared/repo/list" .}}
{{template "base/paginate" .}}
{{end}}
</div>
</div>
</div>
</div>
{{template "base/footer" .}}