');
liElem.append(spanElem);
@@ -215,25 +232,14 @@
}
});
- // Building tooltip for the node
- // N°4662 - Surround tooltip with div to ensure text retrival
- if ((item.tooltip !== undefined) && ($('
'+item.tooltip+'
').text() !== ''))
- {
- nameElem.attr('data-tooltip-content', item.tooltip).attr('data-tooltip-html-enabled', true);
- CombodoTooltip.InitTooltipFromMarkup(nameElem);
- }
- // Building description for the node
- if ((item.description !== undefined) && (item.description !== ''))
- {
- spanElem.append($(''+item.description+''));
- }
+
// Building actions for that node
switch(levelPrimaryAction.type)
{
case '{{ constant('Combodo\\iTop\\Portal\\Brick\\BrowseBrick::ENUM_ACTION_DRILLDOWN') }}':
spanElem.addClass('tree-toggle');
- nameElem.html(''+nameElem.text()+'');
+ nameElem.html(''+item.name+'');
break;
case '{{ constant('Combodo\\iTop\\Portal\\Brick\\BrowseBrick::ENUM_ACTION_VIEW') }}':
url = '{{ app.url_generator.generate('p_object_view', {'sObjectClass': '-objectClass-', 'sObjectId': '-objectId-'})|raw }}'.replace(/-objectClass-/, item.class).replace(/-objectId-/, item.id);
@@ -255,6 +261,19 @@
//console.log('Action "'+levelPrimaryAction.type+'" not implemented for primary action');
break;
}
+
+ // Building tooltip for the node
+ // N°4662 - Surround tooltip with div to ensure text retrival
+ if ((item.tooltip !== undefined) && ($('
'+item.tooltip+'
').text() !== ''))
+ {
+ nameElem.attr('data-tooltip-content', item.tooltip).attr('data-tooltip-html-enabled', true);
+ CombodoTooltip.InitTooltipFromMarkup(nameElem);
+ }
+ // Building description for the node
+ if ((item.description !== undefined) && (item.description !== ''))
+ {
+ nameElem.append($(''+item.description+''));
+ }
if(levelActionsKeys.length > 1)
{
@@ -269,10 +288,8 @@
var actionsElem = $('').addClass('list-group-item-actions');
liElem.append(actionsElem);
// Checking if a menu is necessary
- var actionsSSTogglerElem = $('');
- var actionsSSMenuElem = $('');
- var actionsSSMenuContainerElem = $('');
- actionsSSMenuElem.append(actionsSSMenuContainerElem);
+ var actionsSSTogglerElem = $('');
+ var actionsSSMenuElem = $('');
actionsElem.append(actionsSSTogglerElem);
actionsElem.append(actionsSSMenuElem);
@@ -281,7 +298,7 @@
{
var action = actionsButtons[j];
var actionElem = $('');
- var actionIconElem = $('').appendTo(actionElem);
+ var actionIconElem = $('').addClass('ipb-dropdown--icon').appendTo(actionElem);
switch(action.type)
{
@@ -315,7 +332,7 @@
}
actionElem.append(action.title);
- actionsSSMenuContainerElem.append( $('').append(actionElem) );
+ actionsSSMenuElem.append( $('').append(actionElem) );
}
}
diff --git a/datamodels/2.x/itop-portal-base/portal/templates/bricks/filter/tile.html.twig b/datamodels/2.x/itop-portal-base/portal/templates/bricks/filter/tile.html.twig
index 7168c6141..977264e8f 100644
--- a/datamodels/2.x/itop-portal-base/portal/templates/bricks/filter/tile.html.twig
+++ b/datamodels/2.x/itop-portal-base/portal/templates/bricks/filter/tile.html.twig
@@ -1,5 +1,6 @@
-{# itop-portal-base/portal/templates/bricks/filter/tile.html.twig #}
-{# Filter brick tile layout #}
+{% set name = 'filter' %}
+
+{% extends 'itop-portal-base/portal/templates/bricks/tile.html.twig' %}
{% if brick.GetTargetBrickClass == 'Combodo\\iTop\\Portal\\Brick\\BrowseBrick' %}
{% set sTargetBrickUrl = app['url_generator'].generate('p_browse_brick_mode', {'sBrickId': brick.GetTargetBrickId, 'sBrowseMode': brick.GetTargetBrickTab}) %}
@@ -7,30 +8,17 @@
{% set sTargetBrickUrl = app['url_generator'].generate('p_manage_brick', {'sBrickId': brick.GetTargetBrickId, 'sGroupingTab': brick.GetTargetBrickTab}) %}
{% endif %}
-
\ No newline at end of file
+{% block pTileExtraContent %}
+
+
+
+{% endblock %}
\ No newline at end of file
diff --git a/datamodels/2.x/itop-portal-base/portal/templates/bricks/layout.html.twig b/datamodels/2.x/itop-portal-base/portal/templates/bricks/layout.html.twig
index fd4b45a26..6f9b35607 100644
--- a/datamodels/2.x/itop-portal-base/portal/templates/bricks/layout.html.twig
+++ b/datamodels/2.x/itop-portal-base/portal/templates/bricks/layout.html.twig
@@ -12,29 +12,25 @@
{% block pPageBodyClass %}{{ parent() }} {% if oBrick is defined and oBrick is not null %}page_brick_of_id_{{ oBrick.GetId() }}{% endif %}{% endblock %}
{% block pMainHeader %}
-
-
-
- {% block pMainHeaderTitle %}{% endblock %}
- {% block pMainHeaderSubtitle %}
- {% if sBrickSubtitle is defined and sBrickSubtitle is not null %}
- {{ sBrickSubtitle }}
- {% endif %}
- {% endblock %}
-
+{% endblock %}
\ No newline at end of file
diff --git a/datamodels/2.x/itop-portal-base/portal/templates/bricks/object/mode_search_regular.html.twig b/datamodels/2.x/itop-portal-base/portal/templates/bricks/object/mode_search_regular.html.twig
index f42884158..04a1449a8 100644
--- a/datamodels/2.x/itop-portal-base/portal/templates/bricks/object/mode_search_regular.html.twig
+++ b/datamodels/2.x/itop-portal-base/portal/templates/bricks/object/mode_search_regular.html.twig
@@ -9,7 +9,7 @@
{##}
-
+
diff --git a/datamodels/2.x/itop-portal-base/portal/templates/bricks/tile.html.twig b/datamodels/2.x/itop-portal-base/portal/templates/bricks/tile.html.twig
index cb5fd9975..587d78db4 100644
--- a/datamodels/2.x/itop-portal-base/portal/templates/bricks/tile.html.twig
+++ b/datamodels/2.x/itop-portal-base/portal/templates/bricks/tile.html.twig
@@ -1,22 +1,155 @@
-{# itop-portal-base/portal/templates/bricks/tile.html.twig #}
-{# Base brick tile layout #}
+{#
+Brick tile base layout
+Tile base layout eather for static|link|modal usages.
+
+Extendable blocks:
+ - pTileWrapper: whole tile wrapper
+ - pTileDecoration: tile decoration
+ - pTileBody: tile body
+ - pTileTitle: tile title
+ - pTileDescription: tile description
+ - pTileExtraContent: extra content
+
+CSS classes:
+ - .ipb-tile: tile wrapper
+ - .ipb-tile--decoration: tile decoration
+ - .ipb-tile--decoration--icon: tile decoration icon
+ - .ipb-tile--body: tile body
+ - .ipb-tile--title: tile title
+ - .ipb-tile--description: tile description
+
+Options:
+ - classes: string, optional
+ - hasInlineTitle: boolean, default false
+#}
+
+{# handle brick var name compatibility #}
+{% if oBrick is not defined %}
+ {% set oBrick = brick %}
+{% endif %}
+
+{% set id = "brick-" ~ oBrick.GetId %}
+
+{# tile name #}
+{% if name is not defined %}
+ {% set name = 'name-undefined' %}
+{% endif %}
+
+{# element name #}
+{% if html_element is not defined %}
+ {% set html_element = 'ipb-tile' %}
+{% endif %}
+
+{# tile attributes #}
+{% if attr is not defined %}
+ {% set attr = '' %}
+{% endif %}
+{% set urlHash = '' %}
+
+{# inline title option #}
+{% if hasInlineTitle is not defined %}
+ {% set hasInlineTitle = false %}
+{% endif %}
+
+{# retrieve brick route data #}
+{% if app['combodo.portal.instance.routes'] is defined %}
+
+ {# brick route data #}
+ {% set routeData = app['combodo.portal.instance.routes'][oBrick.GetRouteName] %}
+
+ {# url hash #}
+ {% if routeData['hash'] is defined %}
+ {% set urlHash = '#%s'|format(routeData['hash']) %}
+ {% endif %}
+
+ {# navigation attributes #}
+ {% if routeData['navigation_menu_attr'] is defined %}
+ {% for key, value in routeData['navigation_menu_attr'] %}
+ {% set attr = attr ~ ' %s="%s"'|format(key, value) %}
+ {% endfor %}
+ {% endif %}
+
+{% endif %}
+
+{# brick route #}
+{% if oBrick.GetRouteName %}
+ {% set url = app.url_generator.generate(oBrick.GetRouteName, {sBrickId: oBrick.GetId}) %}
+ {% set attr = attr ~ ' data-role="%s" data-tile-navigation-url="%s"'|format('navigation-trigger', url ~ urlHash) %}
+{% endif %}
+
+{# modal attributes #}
+{% if oBrick.GetModal %}
+ {% set attr = attr ~ ' data-toggle="%s" data-target="%s"'|format('modal', '#modal-for-all') %}
+{% endif %}
+
+{% block pTileWrapper %}
+
+ {# wrapper #}
+ <{{ html_element }}
+ id="{{ id }}"
+ data-brick-id="{{ oBrick.GetId }}"
+ class="ipb-tile ipb-tile--{{ name }} {% if classes is defined %}{{ classes }}{% endif %}"
+ {{ attr|raw }}
+ style="width: {% if oBrick.bIsWidthPixel %}{{ oBrick.GetWidth }}px{% else %}{{ oBrick.GetWidth * 90 / 12 }}%{% endif %};"
+ >
+
+ {# body #}
+ {% block pTileBody %}
+