diff --git a/sources/application/UI/Base/Layout/Dashboard/DashboardLayout.php b/sources/application/UI/Base/Layout/Dashboard/DashboardLayout.php index 2e28dd971..45a334adc 100644 --- a/sources/application/UI/Base/Layout/Dashboard/DashboardLayout.php +++ b/sources/application/UI/Base/Layout/Dashboard/DashboardLayout.php @@ -53,6 +53,15 @@ class DashboardLayout extends UIBlock return array_merge($this->aDashboardRows, [$this->oToolbar]); } + /** + * @see static::$sTitle + * @return bool + */ + public function HasTitle(): bool + { + return strlen($this->sTitle) > 0; + } + /** * @return string */ @@ -61,6 +70,15 @@ class DashboardLayout extends UIBlock return $this->sTitle; } + /** + * @see static::$oToolbar + * @return bool + */ + public function HasToolbar(): bool + { + return $this->oToolbar->HasSubBlocks(); + } + /** * @return \Combodo\iTop\Application\UI\Base\Layout\UIContentBlock */ diff --git a/templates/base/layouts/dashboard/layout.html.twig b/templates/base/layouts/dashboard/layout.html.twig index 085ba886a..ed2ff8c32 100644 --- a/templates/base/layouts/dashboard/layout.html.twig +++ b/templates/base/layouts/dashboard/layout.html.twig @@ -2,10 +2,12 @@ {# @license http://opensource.org/licenses/AGPL-3.0 #} {# Dashboard Layout #} {% apply spaceless %} -
-
{{ oUIBlock.GetTitle() }}
- {{ render_block(oUIBlock.GetToolbar(), {aPage: aPage}) }} -
+ {% if oUIBlock.HasTitle() or oUIBlock.HasToolbar() %} +
+
{{ oUIBlock.GetTitle() }}
+ {{ render_block(oUIBlock.GetToolbar(), {aPage: aPage}) }} +
+ {% endif %}
{% for oSubBlock in oUIBlock.GetDashboardRows() %} {{ render_block(oSubBlock, {aPage: aPage}) }}