diff --git a/css/backoffice/components/_all.scss b/css/backoffice/components/_all.scss index b9088fd41..6f084276a 100644 --- a/css/backoffice/components/_all.scss +++ b/css/backoffice/components/_all.scss @@ -31,4 +31,5 @@ @import "formtablerow"; @import "search-form"; @import "field-badge"; -@import "file-select"; \ No newline at end of file +@import "file-select"; +@import "medallion-icon"; \ No newline at end of file diff --git a/css/backoffice/components/_medallion-icon.scss b/css/backoffice/components/_medallion-icon.scss new file mode 100644 index 000000000..6c72cce02 --- /dev/null +++ b/css/backoffice/components/_medallion-icon.scss @@ -0,0 +1,21 @@ +/*! + * copyright Copyright (C) 2010-2021 Combodo SARL + * license http://opensource.org/licenses/AGPL-3.0 + */ +.ibo-medallion-icon{ + display: flex; + padding: 13px 0px +} +.ibo-medallion--image{ + border-radius: $ibo-border-radius-full; + background-color: $ibo-color-blue-200; + + height: 48px; + width: 48px; + padding: 2px; +} + +.ibo-medallion-icon--description{ + display: inline-block; + padding-left: 8px; +} \ No newline at end of file diff --git a/lib/composer/autoload_classmap.php b/lib/composer/autoload_classmap.php index 2d8641a3f..0b4616e8f 100644 --- a/lib/composer/autoload_classmap.php +++ b/lib/composer/autoload_classmap.php @@ -199,6 +199,7 @@ return array( 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Input\\Select\\SelectOption' => $baseDir . '/sources/application/UI/Base/Component/Input/Select/SelectOption.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Input\\Select\\SelectOptionUIBlockFactory' => $baseDir . '/sources/application/UI/Base/Component/Input/Select/SelectOptionUIBlockFactory.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Input\\TextArea' => $baseDir . '/sources/application/UI/Base/Component/Input/TextArea.php', + 'Combodo\\iTop\\Application\\UI\\Base\\Component\\MedallionIcon\\MedallionIcon' => $baseDir . '/sources/application/UI/Base/Component/MedallionIcon/MedallionIcon.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Panel\\Panel' => $baseDir . '/sources/application/UI/Base/Component/Panel/Panel.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Panel\\PanelEnhanced' => $baseDir . '/sources/application/UI/Base/Component/Panel/PanelEnhanced.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Panel\\PanelUIBlockFactory' => $baseDir . '/sources/application/UI/Base/Component/Panel/PanelUIBlockFactory.php', diff --git a/lib/composer/autoload_static.php b/lib/composer/autoload_static.php index a6a6e5c06..3e1269f93 100644 --- a/lib/composer/autoload_static.php +++ b/lib/composer/autoload_static.php @@ -429,6 +429,7 @@ class ComposerStaticInit0018331147de7601e7552f7da8e3bb8b 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Input\\Select\\SelectOption' => __DIR__ . '/../..' . '/sources/application/UI/Base/Component/Input/Select/SelectOption.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Input\\Select\\SelectOptionUIBlockFactory' => __DIR__ . '/../..' . '/sources/application/UI/Base/Component/Input/Select/SelectOptionUIBlockFactory.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Input\\TextArea' => __DIR__ . '/../..' . '/sources/application/UI/Base/Component/Input/TextArea.php', + 'Combodo\\iTop\\Application\\UI\\Base\\Component\\MedallionIcon\\MedallionIcon' => __DIR__ . '/../..' . '/sources/application/UI/Base/Component/MedallionIcon/MedallionIcon.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Panel\\Panel' => __DIR__ . '/../..' . '/sources/application/UI/Base/Component/Panel/Panel.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Panel\\PanelEnhanced' => __DIR__ . '/../..' . '/sources/application/UI/Base/Component/Panel/PanelEnhanced.php', 'Combodo\\iTop\\Application\\UI\\Base\\Component\\Panel\\PanelUIBlockFactory' => __DIR__ . '/../..' . '/sources/application/UI/Base/Component/Panel/PanelUIBlockFactory.php', diff --git a/sources/application/UI/Base/Component/MedallionIcon/MedallionIcon.php b/sources/application/UI/Base/Component/MedallionIcon/MedallionIcon.php new file mode 100644 index 000000000..ea503f623 --- /dev/null +++ b/sources/application/UI/Base/Component/MedallionIcon/MedallionIcon.php @@ -0,0 +1,102 @@ +sImageUrl = $sImageUrl; + $this->sIconClass= $sIconClass; + } + + /** + * @return string + */ + public function GetImageUrl() + { + return $this->sImageUrl; + } + + /** + * @param string $sImageUrl + * + * @return \Combodo\iTop\Application\UI\Base\Component\MedallionIcon\MedallionIcon + */ + public function SetImageUrl($sImageUrl) + { + $this->sImageUrl = $sImageUrl; + return $this; + } + + /** + * @return string + */ + public function GetIconClass() + { + return $this->sIconClass; + } + + /** + * @param string $sIconClass + * + * @return \Combodo\iTop\Application\UI\Base\Component\MedallionIcon\MedallionIcon + */ + public function SetIconClass($sIconClass) + { + $this->sIconClass = $sIconClass; + return $this; + } + + /** + * @return string + */ + public function GetDescription(): string + { + return $this->sDescription; + } + + /** + * @param string $sDescription + * + * @return \Combodo\iTop\Application\UI\Base\Component\MedallionIcon\MedallionIcon + */ + public function SetDescription(string $sDescription) + { + $this->sDescription = $sDescription; + return $this; + } + +} \ No newline at end of file diff --git a/templates/base/components/medallion-icon/layout.html.twig b/templates/base/components/medallion-icon/layout.html.twig new file mode 100644 index 000000000..6afaa08c2 --- /dev/null +++ b/templates/base/components/medallion-icon/layout.html.twig @@ -0,0 +1,15 @@ +{# @copyright Copyright (C) 2010-2021 Combodo SARL #} +{# @license http://opensource.org/licenses/AGPL-3.0 #} +{% apply spaceless %} +
+ {% if oUIBlock.GetImageUrl() != '' %} + + {% endif %} + {% if oUIBlock.GetIconClass() != '' %} + + {% endif %} + {% if oUIBlock.GetDescription() != '' %} +
{{ oUIBlock.GetDescription() }}
+ {% endif %} +
+{% endapply %} \ No newline at end of file