Fix class icon being too big in displaybarerelations

This commit is contained in:
Stephen Abello
2021-02-23 10:48:42 +01:00
parent defa1e40e1
commit b0a1371122
6 changed files with 69 additions and 11 deletions

View File

@@ -628,8 +628,11 @@ EOF
{
$sTargetClass = $sLinkedClass;
}
$oPage->p(MetaModel::GetClassIcon($sTargetClass)."&nbsp;".$oAttDef->GetDescription().'<span id="busy_'.$sInputId.'"></span>');
$oClassIcon = new Combodo\iTop\Application\UI\Base\Component\MedallionIcon\MedallionIcon(MetaModel::GetClassIcon($sTargetClass, false));
$oClassIcon->SetDescription($oAttDef->GetDescription())->AddCSSClass('ibo-blocklist--medallion');
$oPage->AddUiBlock($oClassIcon);
$sDisplayValue = ''; // not used
$sHTMLValue = "<span id=\"field_{$sInputId}\">".self::GetFormElementForField($oPage, $sClass, $sAttCode,
$oAttDef, $oLinkSet, $sDisplayValue, $sInputId, '', $iFlags, $aArgs).'</span>';
@@ -663,8 +666,7 @@ EOF
'table_id' => $sClass.'_'.$sAttCode,
);
}
else
{
else {
// n:n links
$oLinkingAttDef = MetaModel::GetAttributeDef($sLinkedClass, $oAttDef->GetExtKeyToRemote());
$sLinkingAttCode = $oLinkingAttDef->GetCode();
@@ -678,8 +680,7 @@ EOF
},
$aLnkAttDefsToDisplay
);
if (!in_array(ormLinkSet::LINK_ALIAS.'.'.$sLinkingAttCode, $aLnkAttCodesToDisplay))
{
if (!in_array(ormLinkSet::LINK_ALIAS.'.'.$sLinkingAttCode, $aLnkAttCodesToDisplay)) {
// we need to display a link to the remote class instance !
$aLnkAttCodesToDisplay[] = ormLinkSet::LINK_ALIAS.'.'.$sLinkingAttCode;
}
@@ -706,7 +707,9 @@ EOF
'extra_fields' => $sAttCodesToDisplay,
);
}
$oPage->p(MetaModel::GetClassIcon($sTargetClass)."&nbsp;".$oAttDef->GetDescription());
$oClassIcon = new Combodo\iTop\Application\UI\Base\Component\MedallionIcon\MedallionIcon(MetaModel::GetClassIcon($sTargetClass, false));
$oClassIcon->SetDescription($oAttDef->GetDescription())->AddCSSClass('ibo-blocklist--medallion');
$oPage->AddUiBlock($oClassIcon);
$oBlock = new DisplayBlock($oLinkSet->GetFilter(), 'list', false);
$oBlock->Display($oPage, 'rel_'.$sAttCode, $aParams);
}
@@ -777,7 +780,10 @@ EOF
foreach($aNotificationClasses as $sNotifClass)
{
$oPage->p(MetaModel::GetClassIcon($sNotifClass, true).'&nbsp;'.MetaModel::GetName($sNotifClass));
$oClassIcon = new Combodo\iTop\Application\UI\Base\Component\MedallionIcon\MedallionIcon(MetaModel::GetClassIcon($sTargetClass, false));
$oClassIcon->SetDescription($oAttDef->GetDescription())->AddCSSClass('ibo-blocklist--medallion');
$oPage->AddUiBlock($oClassIcon);
$oBlock = new DisplayBlock($aNotifSearches[$sNotifClass], 'list', false);
$oBlock->Display($oPage, 'notifications_'.$sNotifClass, array('menu' => false));
}

View File

@@ -0,0 +1,19 @@
/*!
* Copyright (C) 2013-2020 Combodo SARL
*
* This file is part of iTop.
*
* iTop is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* iTop is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
*/
@import "display-block/all";

View File

@@ -0,0 +1,19 @@
/*!
* Copyright (C) 2013-2020 Combodo SARL
*
* This file is part of iTop.
*
* iTop is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* iTop is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
*/
@import "block-list";

View File

@@ -0,0 +1,13 @@
.ibo-blocklist--empty-text, .ibo-blocklist--create-new{
text-align: center;
}
.ibo-blocklist--medallion{
> .ibo-medallion--image{
margin: 0 auto;
}
> .ibo-medallion-icon--description{
text-align: center;
}
}

View File

@@ -22,5 +22,6 @@
@import "components/all";
@import "layout/all";
@import "pages/all";
@import "application/all";
@import "themes/all";
@import "shame";

View File

@@ -3,15 +3,15 @@
{% apply spaceless %}
{% if oUIBlock.bEmptySet or oUIBlock.bNotAuthorized %}
<p>{{ 'UI:NoObjectToDisplay'|dict_s }}</p>
<div class="ibo-blocklist--empty-text">{{ 'UI:NoObjectToDisplay'|dict_s }}</div>
{% endif %}
{% if oUIBlock.bCreateNew %}
<p>
<div class="ibo-blocklist--create-new">
<a{{ oUIBlock.sLinkTarget }} href="{{ oUIBlock.sAbsoluteUrlAppRoot }}pages/UI.php?operation=new&class={{ oUIBlock.sClass }}&{{ oUIBlock.sParams }}{{ oUIBlock.sDefault }}">
{{ 'UI:ClickToCreateNew'|dict_format(oUIBlock.sClassLabel) }}
</a>
</p>
</a>
</div>
{% endif %}
{% for oSubBlock in oUIBlock.GetSubBlocks() %}