Skip to content

Commit 555803d

Browse files
Merge pull request #3292 from Leantime/fix/phase0-misc-improvements
fix: accessibility, view system, and composer improvements from phase-0
2 parents 7cdc2c7 + 74068db commit 555803d

4 files changed

Lines changed: 13 additions & 5 deletions

File tree

app/Core/UI/ViewsServiceProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,10 @@ public function registerFactory()
6262

6363
$factory = $this->createFactory($resolver, $finder, $app['events']);
6464

65-
// Backwards compatible view engine resolver
65+
// Legacy template extensions — still needed for plugins with .tpl.php/.sub.php/.inc.php
6666
array_map(fn ($ext) => $factory->addExtension($ext, 'php'), ['inc.php', 'sub.php', 'tpl.php']);
6767

68-
// reprioritize blade
69-
// Use blade engine for all things blade
68+
// Use blade engine for all things blade (registered last to take priority)
7069
$factory->addExtension('blade.php', 'blade');
7170

7271
// We will also set the container instance on this view environment since the
@@ -411,6 +410,7 @@ private function discoverViewPaths()
411410

412411
$storePaths = $domainPaths
413412
->merge($pluginPaths)
413+
->merge(['globals' => APP_ROOT.'/app/Views/Templates'])
414414
->merge(['global' => APP_ROOT.'/app/Views/Templates'])
415415
->merge(['__components' => $this->app['config']->get('view.compiled')])
416416
->all();

app/Views/Composers/App.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Leantime\Core\Controller\Frontcontroller as FrontcontrollerCore;
77
use Leantime\Core\Events\DispatchesEvents;
88
use Leantime\Core\UI\Composer;
9+
use Leantime\Core\UI\Theme;
910
use Leantime\Domain\Menu\Repositories\Menu;
1011

1112
class App extends Composer
@@ -18,9 +19,12 @@ class App extends Composer
1819

1920
private Menu $menuRepo;
2021

21-
public function init(Menu $menuRepo): void
22+
private Theme $themeCore;
23+
24+
public function init(Menu $menuRepo, Theme $themeCore): void
2225
{
2326
$this->menuRepo = $menuRepo;
27+
$this->themeCore = $themeCore;
2428
}
2529

2630
/**
@@ -39,8 +43,10 @@ public function with(): array
3943
$announcement = self::dispatch_filter('appAnnouncement', $announcement);
4044

4145
return [
46+
'module' => strtolower(FrontcontrollerCore::getModuleName()),
4247
'section' => $menuType,
4348
'appAnnouncement' => $announcement,
49+
'themeBgUrl' => $this->themeCore->getBackgroundImage(),
4450
];
4551
}
4652
}

app/Views/Composers/Header.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ public function with(): array
8585
'accents' => [
8686
$this->themeCore->getPrimaryColor(),
8787
$this->themeCore->getSecondaryColor(),
88+
false, // accent3 uses CSS default
89+
false, // accent4 uses CSS default
8890
],
8991
'themeBg' => $this->themeCore->getBackgroundImage(),
9092
'themeOpacity' => $backgroundOpacity,

app/Views/Templates/sections/header.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<meta name="requestId" content="{{ \Illuminate\Support\Str::random(4) }}">
44
<meta name="description" content="{{ $sitename }}">
55
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<meta name="mobile-web-app-capable" content="yes">
88
<meta name="apple-touch-fullscreen" content="yes">
99
<meta name="theme-color" content="{{ $primaryColor }}">

0 commit comments

Comments
 (0)