From 7bd4bed55899face526107cb6f4413e7c6ed1011 Mon Sep 17 00:00:00 2001 From: Frederic Thevenet Date: Sat, 10 May 2025 19:46:41 +0000 Subject: [PATCH] [feature/frontend] Add id attributes to 'about user' section to allow for reordering using css (#4164) # Description This pull request adds `id` attributes to elements in the "About" section of the user page so that it is easy to look them up using css. It also move the screen reader only elements for some these so that they are re-ordered alongside their parent element. closes #4163 ## Checklist Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]` If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want). - [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md). - [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat. - [x] I/we have not leveraged AI to create the proposed changes. - [x] I/we have performed a self-review of added code. - [x] I/we have written code that is legible and maintainable by others. - [x] I/we have commented the added code, particularly in hard-to-understand areas. - [x] I/we have made any necessary changes to documentation. - [x] I/we have added tests that cover new code. - [x] I/we have run tests and they pass locally with the changes. - [x] I/we have run `go fmt ./...` and `golangci-lint run`. Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4164 Co-authored-by: Frederic Thevenet Co-committed-by: Frederic Thevenet --- web/template/profile_about_user.tmpl | 12 ++++++------ web/template/profile_fields.tmpl | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/web/template/profile_about_user.tmpl b/web/template/profile_about_user.tmpl index 7f3ce0e97..7b010a0ee 100644 --- a/web/template/profile_about_user.tmpl +++ b/web/template/profile_about_user.tmpl @@ -18,23 +18,23 @@ */ -}} {{- with . }} -
-
+
+

About {{- .account.Username -}}

{{- if .account.Fields }} {{- include "profile_fields.tmpl" . | indent 1 }} {{- end }} -

Bio

-
+
+

Bio

{{- if .account.Note }} {{ emojify .account.Emojis (noescape .account.Note) }} {{- else }}

This GoToSocial user hasn't written a bio yet!

{{- end }}
-

Stats

-
+
+

Stats

Joined
diff --git a/web/template/profile_fields.tmpl b/web/template/profile_fields.tmpl index e9005d4c9..cd9e4eb6a 100644 --- a/web/template/profile_fields.tmpl +++ b/web/template/profile_fields.tmpl @@ -18,7 +18,7 @@ */ -}} {{- with . }} -
+

Fields

{{- range .account.Fields }}