diff --git a/lib/src/settings.dart b/lib/src/settings.dart index 5bae0b1..9ec16d9 100644 --- a/lib/src/settings.dart +++ b/lib/src/settings.dart @@ -67,6 +67,8 @@ __Package repositories__: ${docsPackages.map((packageName) => '- $packageName: ').join('\n')} '''); +final String webServerAlertContent = getEnv('WEB_SERVER_ALERT_CONTENT', 'Experimental version'); + /// The GitHub account to use when no other account is specified. final String githubAccount = getEnv('ROD_GITHUB_ACCOUNT', 'nyxx-discord'); diff --git a/lib/src/web_app/api_server.dart b/lib/src/web_app/api_server.dart index 4d62384..fc0b3a7 100644 --- a/lib/src/web_app/api_server.dart +++ b/lib/src/web_app/api_server.dart @@ -51,10 +51,21 @@ class WebServer { return shelf.Response.badRequest(); } + final additionalParameters = switch (templateName) { + 'navigation' => { + 'clientId': clientId, + 'redirectUri': clientRedirectUri, + }, + 'alert' => { + 'inner_content': webServerAlertContent, + }, + _ => {}, + }; + + return createTwigResponse('component/$templateName.html', parameters: { ...getCustomDataFromSession(request), - 'clientId': clientId, - 'redirectUri': clientRedirectUri, + ...additionalParameters, }); } diff --git a/templates/component/alert.html b/templates/component/alert.html new file mode 100644 index 0000000..9cbd30e --- /dev/null +++ b/templates/component/alert.html @@ -0,0 +1,3 @@ + diff --git a/templates/guilds.html b/templates/guilds.html index 749a508..1639251 100644 --- a/templates/guilds.html +++ b/templates/guilds.html @@ -11,9 +11,7 @@
- +
diff --git a/templates/index.html b/templates/index.html index 5f2e8e0..0b78969 100644 --- a/templates/index.html +++ b/templates/index.html @@ -11,9 +11,7 @@
- +