mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Dashboard: Remove extra top margin when dashboard layout as no title or toolbar (eg. in dashboard pages)
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
@@ -2,10 +2,12 @@
|
||||
{# @license http://opensource.org/licenses/AGPL-3.0 #}
|
||||
{# Dashboard Layout #}
|
||||
{% apply spaceless %}
|
||||
<div class="ibo-dashboard--top-bar" data-role="ibo-dashboard--top-bar">
|
||||
<div class="ibo-dashboard--top-bar-title" data-role="ibo-dashboard--top-bar-title">{{ oUIBlock.GetTitle() }}</div>
|
||||
{{ render_block(oUIBlock.GetToolbar(), {aPage: aPage}) }}
|
||||
</div>
|
||||
{% if oUIBlock.HasTitle() or oUIBlock.HasToolbar() %}
|
||||
<div class="ibo-dashboard--top-bar" data-role="ibo-dashboard--top-bar">
|
||||
<div class="ibo-dashboard--top-bar-title" data-role="ibo-dashboard--top-bar-title">{{ oUIBlock.GetTitle() }}</div>
|
||||
{{ render_block(oUIBlock.GetToolbar(), {aPage: aPage}) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="ibo-dashboard--grid" data-role="ibo-dashboard--grid">
|
||||
{% for oSubBlock in oUIBlock.GetDashboardRows() %}
|
||||
{{ render_block(oSubBlock, {aPage: aPage}) }}
|
||||
|
||||
Reference in New Issue
Block a user