diff --git a/appview/pages/funcmap.go b/appview/pages/funcmap.go index 5995b765..67305510 100644 --- a/appview/pages/funcmap.go +++ b/appview/pages/funcmap.go @@ -33,9 +33,15 @@ func funcMap() template.FuncMap { "splitOn": func(s, sep string) []string { return strings.Split(s, sep) }, + "int64": func(a int) int64 { + return int64(a) + }, "add": func(a, b int) int { return a + b }, + "now": func() time.Time { + return time.Now() + }, // the absolute state of go templates "add64": func(a, b int64) int64 { return a + b @@ -79,6 +85,7 @@ func funcMap() template.FuncMap { "longTimeFmt": func(t time.Time) string { return t.Format("2006-01-02 * 3:04 PM") }, + "commaFmt": humanize.Comma, "shortTimeFmt": func(t time.Time) string { return humanize.CustomRelTime(t, time.Now(), "", "", []humanize.RelTimeMagnitude{ {time.Second, "now", time.Second}, diff --git a/appview/pages/pages.go b/appview/pages/pages.go index 5b342d92..29cb7608 100644 --- a/appview/pages/pages.go +++ b/appview/pages/pages.go @@ -316,6 +316,7 @@ type ProfilePageParams struct { CollaboratingRepos []db.Repo ProfileTimeline *db.ProfileTimeline Card ProfileCard + Punchcard db.Punchcard DidHandleMap map[string]string } diff --git a/appview/pages/templates/user/profile.html b/appview/pages/templates/user/profile.html index f2a420f0..bb4a70f6 100644 --- a/appview/pages/templates/user/profile.html +++ b/appview/pages/templates/user/profile.html @@ -8,13 +8,18 @@ {{ end }} {{ define "content" }} -
ACTIVITY
-This user does not have any repos yet.
- {{ end }} -COLLABORATING ON
-This user does not have any repos yet.
+ {{ end }} +COLLABORATING ON
+This user is not collaborating.
- {{ end }} +This user is not collaborating.
+ {{ end }} ++ PUNCHCARD + + {{ .Total | int64 | commaFmt }} commits + +
+