judgels
judgels copied to clipboard
Support custom app logo
Description
Support custom app logo in both admin and client interfaces.
Admin | Client |
---|---|
(Possible) Implementation Details
-
[ ] Add optional config
logo
in JudgelsAppConfiguration.public interface JudgelsAppConfiguration { String getName(); Optional<String> getLogo(); <-- new config
-
[ ] Add the
logo
config tojudgels-server.yml.example
(commented out by default):judgels: baseDataDir: var/data app: name: Judgels # logo: var/conf/logo.png <-- new config
Specific for admin interface
- [ ] Implement a new
GET /logo
endpoint in Michael's IndexResource.- If the above config exists, return the logo as image.
- Otherwise, return the existing logo.
- Refer to UserAvatarResource::renderAvatar as an example on how to read from resources, and how to return image response.
- [ ] Point the logo image URL in admin interface to the above new endpoint.
Specific for client interface
- [ ] Implement a new
GET /api/v2/web/logo
endpoint in Jophiel. Create a newweb.WebResource
resource, and implement the endpoint there. Implementation is similar to Michael's endpoint above. - [ ] Point the logo image URL in client interface AND favico to the above new endpoint (apiUrl +
/logo
) - [ ] Remove all existing images in
judgels-client
, because now we fetch the image from the server.
For deployment
-
[ ] Add optional
app_logo:
config inenv-example/vars.yml
(commented out by default).app_version: xxx app_name: xxx app_slogan: xxx app_title: xxx app_description: xxx # app_logo: var/conf/logo.png <-- new config
-
[ ] Modify the ansible playbook so that if the config exists, it:
- copies the file
env/logo.png
tovar/conf/
- adds the
logo
config tojudgels-server.yml
as explained above.
- copies the file