Save night mode enabled state and apply night mode class to <body> on server side (references #71)

This commit is contained in:
Bernd Bestel
2018-09-30 11:25:07 +02:00
parent d4227d2e41
commit 176333df5b
2 changed files with 24 additions and 4 deletions

View File

@@ -47,10 +47,18 @@
@else
Grocy.AutoReloadOnDatabaseChangeEnabled = true;
@endif
@if(array_key_exists('night_mode_enabled', $userSettings))
@php $nightModeEnabled = boolval($userSettings['night_mode_enabled']); @endphp
Grocy.NightModeEnabled = {{ BoolToString($userSettings['night_mode_enabled']) }};
@else
@php $nightModeEnabled = false; @endphp
Grocy.NightModeEnabled = false;
@endif
</script>
</head>
<body class="fixed-nav">
<body class="fixed-nav @if($nightModeEnabled == true) night-mode @endif">
<nav id="mainNav" class="navbar navbar-expand-lg navbar-light fixed-top">
<a class="navbar-brand py-0" href="{{ $U('/') }}"><img src="{{ $U('/img/grocy_logo.svg?v=', true) }}{{ $version }}" height="30"></a>