summaryrefslogtreecommitdiff
path: root/internal/router/template.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-04-15 14:33:01 +0200
committerLibravatar GitHub <noreply@github.com>2022-04-15 14:33:01 +0200
commit26683b3d49beea9b1f0e8f78df4720285d4c0825 (patch)
tree06bf09cdee7a60c41947a0bd03d6a42ad83ee784 /internal/router/template.go
parent[bugfix] Fix broken only_media and only_public flags on /api/v1/accounts/:id/... (diff)
downloadgotosocial-26683b3d49beea9b1f0e8f78df4720285d4c0825.tar.xz
[feature] Web profile pages for accounts (#449)
* add default avatars * allow webModule to error * return errWithCode from account get * add AccountGetLocalByUsername * check nil requesting account * add timestampShort function for just month/year * move loading logic to New + add default avatars * add profile page view * update swagger docs * add excludeReblogs to GetAccountStatuses * ignore casing when selecting local account by username * appropriate redirects * css fiddling * add 'about' heading * adjust thread page to work with routing * return AP representation if requested + authorized * simplify auth check * go fmt * golangci-lint ignore math/rand
Diffstat (limited to 'internal/router/template.go')
-rw-r--r--internal/router/template.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/router/template.go b/internal/router/template.go
index 1a0186d6d..50d5f1a82 100644
--- a/internal/router/template.go
+++ b/internal/router/template.go
@@ -67,6 +67,11 @@ func timestamp(stamp string) string {
return t.Format("January 2, 2006, 15:04:05")
}
+func timestampShort(stamp string) string {
+ t, _ := time.Parse(time.RFC3339, stamp)
+ return t.Format("January, 2006")
+}
+
type iconWithLabel struct {
faIcon string
label string
@@ -98,5 +103,6 @@ func LoadTemplateFunctions(engine *gin.Engine) {
"oddOrEven": oddOrEven,
"visibilityIcon": visibilityIcon,
"timestamp": timestamp,
+ "timestampShort": timestampShort,
})
}