From 6800ae5fecbba6007610c46a59725c26b1a56824 Mon Sep 17 00:00:00 2001 From: Nils Haagen Date: Tue, 8 Feb 2022 11:19:31 +0100 Subject: [PATCH] UI/Layout: Breadcrumbs in Content - remove, if empty --- .../default/Layout/tpl.standardpage.html | 2 + .../Layout/Page/StandardPageTest.php | 83 ++++++++++++++++++- 2 files changed, 83 insertions(+), 2 deletions(-) diff --git a/src/UI/templates/default/Layout/tpl.standardpage.html b/src/UI/templates/default/Layout/tpl.standardpage.html index dac96016bf40..2fa443950d2e 100644 --- a/src/UI/templates/default/Layout/tpl.standardpage.html +++ b/src/UI/templates/default/Layout/tpl.standardpage.html @@ -57,9 +57,11 @@
+ + {CONTENT}
diff --git a/tests/UI/Component/Layout/Page/StandardPageTest.php b/tests/UI/Component/Layout/Page/StandardPageTest.php index 98296539605f..c8971dbb3497 100644 --- a/tests/UI/Component/Layout/Page/StandardPageTest.php +++ b/tests/UI/Component/Layout/Page/StandardPageTest.php @@ -12,6 +12,10 @@ use ILIAS\UI\Implementation\Component\Layout\Page; use ILIAS\UI\Implementation\Component\Legacy\Legacy; use ILIAS\UI\Implementation\Component\SignalGenerator; +use ILIAS\UI\Implementation\Component\Breadcrumbs\Breadcrumbs as Crumbs; +use ILIAS\UI\Implementation\Component\Link\Standard as CrumbEntry; +use ILIAS\UI\Implementation\Component\Button; +use ILIAS\UI\Implementation\Component\Dropdown; /** * Tests for the Standard Page @@ -191,7 +195,7 @@ public function testRenderingWithTitle() : void
-
some content
+
some content
@@ -228,7 +232,82 @@ public function testRenderingWithRtlLanguage() : void
-
some content
+
some content
+
+ + + +'); + $this->assertEquals($exptected, $html); + } + + + public function getUIFactory() : NoUIFactory + { + return new class extends NoUIFactory { + public function button() : \ILIAS\UI\Component\Button\Factory + { + return new Button\Factory(); + } + public function dropdown() : \ILIAS\UI\Component\Dropdown\Factory + { + return new Dropdown\Factory(); + } + }; + } + + public function testRenderingWithCrumbs() : void + { + $crumbs = new Crumbs([ + new CrumbEntry("label1", '#'), + new CrumbEntry("label2", '#'), + new CrumbEntry("label3", '#') + ]); + $r = $this->getDefaultRenderer(null, [$this->metabar, $this->mainbar, $this->logo]); + + $stdpage = $this->factory->standard( + $this->contents, + $this->metabar, + $this->mainbar, + $crumbs, + $this->logo, + null, + $this->title + ); + + $html = $this->brutallyTrimHTML($r->render($stdpage)); + + $exptected = $this->brutallyTrimHTML(' + + + + + + + : + + + +
+
+
+ + MetaBar Stub +
+
+
+ + +
+
+ some content +