From 8953f57d887c060c3b58f83c38d2010d27a45ef3 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Mon, 25 Mar 2024 18:32:24 +0100 Subject: [feature] User-selectable preset CSS themes for accounts (#2777) * [feature] User-selectable preset themes * docs, more theme stuff * lint, tests * fix css name * correct some little issues * add another theme * fix poll background * okay last theme i swear * make retrieval of apimodel themes more conventional * preallocate stylesheet slices --- docs/api/swagger.yaml | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'docs/api') diff --git a/docs/api/swagger.yaml b/docs/api/swagger.yaml index e962c6724..e17e3f479 100644 --- a/docs/api/swagger.yaml +++ b/docs/api/swagger.yaml @@ -294,6 +294,10 @@ definitions: description: Account has been suspended by our instance. type: boolean x-go-name: Suspended + theme: + description: Filename of user-selected CSS theme to include when rendering this account's profile or statuses. Eg., `blurple-light.css`. + type: string + x-go-name: Theme url: description: Web location of the account's profile page. example: https://example.org/@some_user @@ -2463,6 +2467,24 @@ definitions: type: object x-go-name: Tag x-go-package: github.com/superseriousbusiness/gotosocial/internal/api/model + theme: + properties: + description: + description: User-facing description of this theme. + type: string + x-go-name: Description + file_name: + description: FileName of this theme in the themes directory. + type: string + x-go-name: FileName + title: + description: User-facing title of this theme. + type: string + x-go-name: Title + title: Theme represents one user-selectable preset CSS theme. + type: object + x-go-name: Theme + x-go-package: github.com/superseriousbusiness/gotosocial/internal/api/model wellKnownResponse: description: See https://webfinger.net/ properties: @@ -3448,6 +3470,34 @@ paths: summary: Search for accounts by username and/or display name. tags: - accounts + /api/v1/accounts/themes: + get: + operationId: accountThemes + produces: + - application/json + responses: + "200": + description: Array of themes. + schema: + items: + $ref: '#/definitions/theme' + type: array + "400": + description: bad request + "401": + description: unauthorized + "404": + description: not found + "406": + description: not acceptable + "500": + description: internal server error + security: + - OAuth2 Bearer: + - read:accounts + summary: See preset CSS themes available to accounts on this instance. + tags: + - accounts /api/v1/accounts/update_credentials: patch: consumes: -- cgit v1.2.3