From 26f6b715ba1750221af51cd41c48d57fdcef5cf1 Mon Sep 17 00:00:00 2001 From: Ashar Fuadi Date: Fri, 6 Oct 2023 20:16:00 +0700 Subject: [PATCH] feat(client): support footer (#521) --- deployment/ansible/conf/judgels-client.js.j2 | 3 +++ deployment/ansible/env-example/vars.yml | 1 + judgels-client/public/var/conf/judgels-client.js.example | 1 + judgels-client/src/components/Footer/Footer.jsx | 8 +++++++- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/deployment/ansible/conf/judgels-client.js.j2 b/deployment/ansible/conf/judgels-client.js.j2 index 8f8a95ce7..bf114e1da 100644 --- a/deployment/ansible/conf/judgels-client.js.j2 +++ b/deployment/ansible/conf/judgels-client.js.j2 @@ -7,6 +7,9 @@ window.conf = { title: '{{ app_title }}', description: '{{ app_description }}', }, +{% if app_footer is defined %} + footer: '{{ app_footer }}', +{% endif %} {% if googleAnalytics_trackingId is defined %} googleAnalytics: { trackingId: '{{ googleAnalytics_trackingId }}', diff --git a/deployment/ansible/env-example/vars.yml b/deployment/ansible/env-example/vars.yml index ccbd5950d..7e84f118f 100644 --- a/deployment/ansible/env-example/vars.yml +++ b/deployment/ansible/env-example/vars.yml @@ -3,6 +3,7 @@ app_name: Judgels app_slogan: Programming Contest System app_title:

Welcome to Judgels

app_description:

This is a programming contest system.

+app_footer: © Ikatan Alumni TOKI nginx_domain_judgels_client: judgels.com nginx_domain_judgels_server_api: api.judgels.com diff --git a/judgels-client/public/var/conf/judgels-client.js.example b/judgels-client/public/var/conf/judgels-client.js.example index f78c3c5ab..e905cbedc 100644 --- a/judgels-client/public/var/conf/judgels-client.js.example +++ b/judgels-client/public/var/conf/judgels-client.js.example @@ -8,4 +8,5 @@ window.conf = { description: '

This is a programming contest system.

', }, + footer: '© Ikatan Alumni TOKI', }; diff --git a/judgels-client/src/components/Footer/Footer.jsx b/judgels-client/src/components/Footer/Footer.jsx index 20282a046..751c17f6a 100644 --- a/judgels-client/src/components/Footer/Footer.jsx +++ b/judgels-client/src/components/Footer/Footer.jsx @@ -1,11 +1,17 @@ +import HTMLReactParser from 'html-react-parser'; + +import { APP_CONFIG } from '../../conf'; + import './Footer.scss'; export function Footer() { + const footer = APP_CONFIG.footer || '© Ikatan Alumni TOKI'; + return (

-
© Ikatan Alumni TOKI
+
{HTMLReactParser(footer)}
Powered by Judgels