~gitpocket/gitpocket

feat(web): join date on profiles, year tabs from registration onwards

commit
1fd283fc829e7046a396996351597530b6e0387a browse tree
parent
194001507ba88c1ba15f8a5a709bee93c72fc1b1
author
james <j@cpl0.zip>
signature
Verified ~james signed with a key registered by ~james
date
2026-11-13 10:03 UTC

2 files changed, +5 −1

extra.go modified

@@ -488,7 +488,10 @@ type heatView struct {
488488 func (s *Server) activity(owner User, year int) heatView {
489489 counts := s.activityCounts(owner)
490490 today := time.Now().UTC().Truncate(24 * time.Hour)
491- years := map[int]bool{today.Year(): true}
491+ years := map[int]bool{}
492+ for y := min(owner.Created.UTC().Year(), today.Year()); y <= today.Year(); y++ {
493+ years[y] = true
494+ }
492495 for day := range counts {
493496 y, _ := strconv.Atoi(day[:4])
494497 years[y] = true

templates/user.html modified

@@ -12,6 +12,7 @@
1212 {{if $p.Location}}<p>{{$p.Location}}</p>{{end}}
1313 {{if $p.Workplace}}<p>{{$p.Workplace}}</p>{{end}}
1414 {{if $p.Website}}<p><a href="{{$p.Website}}" rel="nofollow me">{{$p.Website}}</a></p>{{end}}
15+<p class="muted small" title="{{date .Data.Owner.Created}}">Joined {{.Data.Owner.Created.Format "2 January 2006"}}</p>
1516 {{with .Data.Bio}}<div class="bio readme">{{.}}</div>{{end}}
1617 {{if $own}}<a class="btn primary block" href="/create">Create a new repository ▸</a><a class="btn block" href="/settings">Edit your profile ▸</a>{{end}}
1718 </aside>