diff options
author | 2022-04-15 14:33:01 +0200 | |
---|---|---|
committer | 2022-04-15 14:33:01 +0200 | |
commit | 26683b3d49beea9b1f0e8f78df4720285d4c0825 (patch) | |
tree | 06bf09cdee7a60c41947a0bd03d6a42ad83ee784 /web/template | |
parent | [bugfix] Fix broken only_media and only_public flags on /api/v1/accounts/:id/... (diff) | |
download | gotosocial-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 'web/template')
-rw-r--r-- | web/template/profile.tmpl | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/web/template/profile.tmpl b/web/template/profile.tmpl new file mode 100644 index 000000000..cfabeee6f --- /dev/null +++ b/web/template/profile.tmpl @@ -0,0 +1,47 @@ +{{ template "header.tmpl" .}} +<main> + {{ if .account.Header }}<a href="{{.account.Header}}" class="headerimage"><img src="{{.account.Header}}"></a>{{ end }} + <div class="profile"> + <div class="basic"> + <a href="{{.account.URL}}" class="displayname">{{if .account.DisplayName}}{{.account.DisplayName}}{{else}}{{.account.Username}}{{end}}</a> + <a href="{{.account.URL}}" class="username">@{{.account.Username}}</a> + <a href="{{.account.Avatar}}" class="avatar"><img src="{{.account.Avatar}}"></a> + </div> + <div class="detailed"> + <h2>About @{{.account.Username}}</h2> + <div class="bio"> + {{ if .account.Note }}{{ .account.Note | noescape }}{{else}}This GoToSocial user hasn't written a bio yet!{{end}} + </div> + </div> + </div> + <div class="accountstats"> + <div class="entry">Joined {{.account.CreatedAt | timestampShort}}</div> + <div class="entry">Followed by {{.account.FollowersCount}}</div> + <div class="entry">Following {{.account.FollowingCount}}</div> + <div class="entry">Posted {{.account.StatusesCount}}</div> + </div> + <h2>Recent public posts by @{{.account.Username}}</h2> + <div class="thread"> + {{range .statuses}} + <div class="toot expanded"> + {{ template "status.tmpl" .}} + </div> + {{end}} + </div> +</main> +<script> + Array.from(document.getElementsByClassName("spoiler-label")).forEach((label) => { + let checkbox = document.getElementById(label.htmlFor); + function update() { + if(checkbox.checked) { + label.innerHTML = "Show more"; + } else { + label.innerHTML = "Show less"; + } + } + update(); + + label.addEventListener("click", () => {setTimeout(update, 1)}); + }); +</script> +{{ template "footer.tmpl" .}}
\ No newline at end of file |