Skip to content

Commit

Permalink
add bmlt title setting (#1117)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjaudiomv authored Nov 5, 2024
1 parent 1755b5c commit 1640a9d
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docker/write-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ sed -i '/dbPrefix/d' /var/www/html/auto-config.inc.php
sed -i '/do_not_force_port/d' /var/www/html/auto-config.inc.php
sed -i '/default_duration_time/d' /var/www/html/auto-config.inc.php
sed -i '/g_enable_language_selector/d' /var/www/html/auto-config.inc.php
sed -i '/bmlt_title/d' /var/www/html/auto-config.inc.php

if [ ! -z $GKEY ]
then
Expand Down Expand Up @@ -69,6 +70,7 @@ then
fi

echo "\$default_duration_time = \"${DEFAULT_DURATION_TIME:-01:00:00}\";" >> /var/www/html/auto-config.inc.php
echo "\$bmlt_title = \"${BMLT_TITLE:-BMLT Administration}\";" >> /var/www/html/auto-config.inc.php

if [ "$ENABLE_LANGUAGE_SELECTOR" == "false" ]; then
echo "\$g_enable_language_selector = false;" >> /var/www/html/auto-config.inc.php
Expand Down
1 change: 1 addition & 0 deletions src/app/Http/Controllers/CatchAllController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public static function handle(Request $request): Response
return response()->view('frontend', [
'autoGeocodingEnabled' => legacy_config('auto_geocoding_enabled'),
'baseUrl' => $request->getBaseurl(),
'bmltTitle' => legacy_config('bmlt_title'),
'centerLongitude' => legacy_config('search_spec_map_center_longitude'),
'centerLatitude' => legacy_config('search_spec_map_center_latitude'),
'centerZoom' => legacy_config('search_spec_map_center_zoom'),
Expand Down
1 change: 1 addition & 0 deletions src/app/LegacyConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ private static function loadConfig()
$config['aggregator_mode_enabled'] = $aggregator_mode_enabled ?? false;
$config['aggregator_max_geo_width_km'] = isset($aggregator_max_geo_width_km) && is_numeric($aggregator_max_geo_width_km) ? floatval($aggregator_max_geo_width_km) : 1000;
$config['include_service_body_email_in_semantic'] = $g_include_service_body_email_in_semantic ?? false;
$config['bmlt_title'] = $bmlt_title ?? '';

self::$config = $config;
self::$configLoaded = true;
Expand Down
5 changes: 5 additions & 0 deletions src/resources/js/components/LoginForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@
</script>

<div class="mx-auto flex flex-col items-center justify-center px-6 py-8 md:h-screen lg:py-0">
{#if globalSettings.bmltTitle}
<div class="mb-4 text-4xl font-bold text-black dark:text-white">
{globalSettings.bmltTitle}
</div>
{/if}
<div class="mb-6 flex items-center text-2xl font-semibold text-gray-900 dark:text-white">
{$translations.rootServerTitle} ({globalSettings.version})
</div>
Expand Down
1 change: 1 addition & 0 deletions src/resources/js/globals.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
declare const settings: {
apiBaseUrl: string;
bmltTitle: string;
autoGeocodingEnabled: true;
centerLongitude: number;
centerLatitude: number;
Expand Down
1 change: 1 addition & 0 deletions src/resources/js/tests/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import '@testing-library/jest-dom/vitest';
// @ts-expect-error set from backend
global.settings = {
apiBaseUrl: '/',
bmltTitle: '',
autoGeocodingEnabled: true,
centerLongitude: -118.563659,
centerLatitude: 34.235918,
Expand Down
1 change: 1 addition & 0 deletions src/resources/views/frontend.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
const settings = {
apiBaseUrl: '{{ $baseUrl }}',
autoGeocodingEnabled: {{ $autoGeocodingEnabled ? 'true' : 'false' }},
bmltTitle: '{{ $bmltTitle }}',
centerLongitude: '{{ $centerLongitude }}',
centerLatitude: '{{ $centerLatitude }}',
centerZoom: '{{ $centerZoom }}',
Expand Down

0 comments on commit 1640a9d

Please sign in to comment.