feat(web): join date on profiles
2 files changed, +5 −1
- extra.go modified +4 −1
- templates/user.html modified +1 −0
extra.go modified
| @@ -488,7 +488,10 @@ type heatView struct { | ||
| 488 | 488 | func (s *Server) activity(owner User, year int) heatView { |
| 489 | 489 | counts := s.activityCounts(owner) |
| 490 | 490 | 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 | + } | |
| 492 | 495 | for day := range counts { |
| 493 | 496 | y, _ := strconv.Atoi(day[:4]) |
| 494 | 497 | years[y] = true |
templates/user.html modified
| @@ -12,6 +12,7 @@ | ||
| 12 | 12 | {{if $p.Location}}<p>{{$p.Location}}</p>{{end}} |
| 13 | 13 | {{if $p.Workplace}}<p>{{$p.Workplace}}</p>{{end}} |
| 14 | 14 | {{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> | |
| 15 | 16 | {{with .Data.Bio}}<div class="bio readme">{{.}}</div>{{end}} |
| 16 | 17 | {{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}} |
| 17 | 18 | </aside> |