N°2847 - Add Html component

- Fix icons on buttons
- Comment some rules from legacy css
This commit is contained in:
Stephen Abello
2020-08-20 11:07:06 +02:00
parent dd81c76aaa
commit 11f27019e4
6 changed files with 96 additions and 20 deletions

View File

@@ -63,25 +63,25 @@
padding: 0.25em;
margin-top: 1em;
}
h1 {
font-family: Tahoma, Verdana, Arial, Helvetica;
color: $text-color;
font-weight: bold;
font-size: 12pt;
}
h2 {
font-family: Tahoma, Verdana, Arial, Helvetica;
color: $text-color;
font-weight: normal;
font-size: 12pt;
}
h3 {
font-family: Tahoma, Verdana, Arial, Helvetica;
color: $text-color;
font-weight: normal;
font-size: 10pt;
}
//
//h1 {
// font-family: Tahoma, Verdana, Arial, Helvetica;
// color: $text-color;
// font-weight: bold;
// font-size: 12pt;
//}
//h2 {
// font-family: Tahoma, Verdana, Arial, Helvetica;
// color: $text-color;
// font-weight: normal;
// font-size: 12pt;
//}
//h3 {
// font-family: Tahoma, Verdana, Arial, Helvetica;
// color: $text-color;
// font-weight: normal;
// font-size: 10pt;
//}
label {
cursor: pointer;

View File

@@ -154,6 +154,7 @@ return array(
'Combodo\\iTop\\Application\\UI\\Component\\GlobalSearch\\GlobalSearch' => $baseDir . '/sources/application/UI/Component/GlobalSearch/GlobalSearch.php',
'Combodo\\iTop\\Application\\UI\\Component\\GlobalSearch\\GlobalSearchFactory' => $baseDir . '/sources/application/UI/Component/GlobalSearch/GlobalSearchFactory.php',
'Combodo\\iTop\\Application\\UI\\Component\\GlobalSearch\\GlobalSearchHelper' => $baseDir . '/sources/application/UI/Component/GlobalSearch/GlobalSearchHelper.php',
'Combodo\\iTop\\Application\\UI\\Component\\Html\\Html\\Html' => $baseDir . '/sources/application/UI/Component/Html/Html.php',
'Combodo\\iTop\\Application\\UI\\Component\\Panel\\Panel\\Panel' => $baseDir . '/sources/application/UI/Component/Panel/Panel.php',
'Combodo\\iTop\\Application\\UI\\Component\\PopoverMenu\\NewsroomMenu\\NewsroomMenu' => $baseDir . '/sources/application/UI/Component/PopoverMenu/NewsroomMenu/NewsroomMenu.php',
'Combodo\\iTop\\Application\\UI\\Component\\PopoverMenu\\NewsroomMenu\\NewsroomMenuFactory' => $baseDir . '/sources/application/UI/Component/PopoverMenu/NewsroomMenu/NewsroomMenuFactory.php',

View File

@@ -384,6 +384,7 @@ class ComposerStaticInit0018331147de7601e7552f7da8e3bb8b
'Combodo\\iTop\\Application\\UI\\Component\\GlobalSearch\\GlobalSearch' => __DIR__ . '/../..' . '/sources/application/UI/Component/GlobalSearch/GlobalSearch.php',
'Combodo\\iTop\\Application\\UI\\Component\\GlobalSearch\\GlobalSearchFactory' => __DIR__ . '/../..' . '/sources/application/UI/Component/GlobalSearch/GlobalSearchFactory.php',
'Combodo\\iTop\\Application\\UI\\Component\\GlobalSearch\\GlobalSearchHelper' => __DIR__ . '/../..' . '/sources/application/UI/Component/GlobalSearch/GlobalSearchHelper.php',
'Combodo\\iTop\\Application\\UI\\Component\\Html\\Html\\Html' => __DIR__ . '/../..' . '/sources/application/UI/Component/Html/Html.php',
'Combodo\\iTop\\Application\\UI\\Component\\Panel\\Panel\\Panel' => __DIR__ . '/../..' . '/sources/application/UI/Component/Panel/Panel.php',
'Combodo\\iTop\\Application\\UI\\Component\\PopoverMenu\\NewsroomMenu\\NewsroomMenu' => __DIR__ . '/../..' . '/sources/application/UI/Component/PopoverMenu/NewsroomMenu/NewsroomMenu.php',
'Combodo\\iTop\\Application\\UI\\Component\\PopoverMenu\\NewsroomMenu\\NewsroomMenuFactory' => __DIR__ . '/../..' . '/sources/application/UI/Component/PopoverMenu/NewsroomMenu/NewsroomMenuFactory.php',

View File

@@ -0,0 +1,71 @@
<?php
/**
* 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
*/
namespace Combodo\iTop\Application\UI\Component\Html\Html;
use Combodo\iTop\Application\UI\UIBlock;
/**
* Class Html
*
* @author Stephen Abello <stephen.abello@combodo.com>
* @package Combodo\iTop\Application\UI\Component\Html\Html
* @since 2.8.0
*/
class Html extends UIBlock
{
// Overloaded constants
const BLOCK_CODE = 'ibo-html';
const HTML_TEMPLATE_REL_PATH = 'components/html/layout';
const JS_TEMPLATE_REL_PATH = 'components/html/layout';
/** @var string $sHtml */
protected $sHtml;
/**
* Html constructor.
*
* @param string $sHtml
*/
public function __construct($sHtml = '')
{
$this->sHtml = $sHtml;
parent::__construct();
}
/**
* @return string
*/
public function GetHtml()
{
return $this->sHtml;
}
/**
* @param string $sHtml
* @return $this
*/
public function SetHtml($sHtml)
{
$this->sHtml = $sHtml;
return $this;
}
}

View File

@@ -1,4 +1,6 @@
<button id="{{ oUIBlock.GetId() }}" class="ibo-button ibo-is-{{ oUIBlock.ActionType}} ibo-is-{{ oUIBlock.Color }}" type="{{ oUIBlock.Type }}" name="{{ oUIBlock.Name }}" value="{{ oUIBlock.Value }}">
<span class="ibo-button-icon {{ oUIBlock.IconClass }}"></span>
{% if oUIBlock.IconClass is not empty %}
<span class="ibo-button-icon {{ oUIBlock.IconClass }}"></span>
{% endif %}
{{ oUIBlock.Label }}
</button>

View File

@@ -0,0 +1 @@
{{ oUIBlock.GetHtml()|raw }}