mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Default modal JS Implementation: Add title option Add buttons option Change template cloning Confirmation Modal: Add implementation Do not show again functionality Web Page: Add blocks array with twig loop insertion
51 lines
2.4 KiB
Twig
51 lines
2.4 KiB
Twig
{# @copyright Copyright (C) 2010-2021 Combodo SARL #}
|
|
{# @license http://opensource.org/licenses/AGPL-3.0 #}
|
|
|
|
{% set columns = oUIBlock.GetColumns() %}
|
|
<table id="{{ oUIBlock.GetId() }}" width="100%" class="{{ oUIBlock.GetBlocksInheritanceCSSClassesAsString() }} {{ oUIBlock.GetAdditionalCSSClassesAsString() }} listResults{% if oUIBlock.IsHidden() %} ibo-is-hidden{% endif %}" data-role="ibo-datatable" data-status="loading">
|
|
<thead>
|
|
<tr>
|
|
{% for column in columns %}
|
|
<th class="ibo-datatable-header" title="{{ column.description }}">{{ column.label }}</th>
|
|
{% endfor %}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for data in oUIBlock.GetData() %}
|
|
|
|
<tr {% if data['@id'] is not empty %}id="{{ data['@id'] }}" {% endif %}
|
|
{% if data['@class'] is not empty %} class="{{ data['@class'] }}"{% endif %}
|
|
{% if data['@meta'] is not empty %} {{ data['@meta'] | raw}}{% endif %}>
|
|
{% for name,column in columns %}
|
|
<td {% if column.class is not empty %}class="{{ column.class }}" {% endif %}
|
|
{% if column.metadata is not empty %}
|
|
{% for prop,value in column.metadata %}
|
|
data-{{ prop|replace({'_': '-'}) }}="{{ value }}"
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% set cellValueHtml = '' %}
|
|
{% for cellName,cellValue in data %}
|
|
{% if cellName == name %}
|
|
{% if cellValue.value_raw is empty %}
|
|
{% set cellValueHtml = cellValue %}
|
|
{% else %}
|
|
data-value-raw="{{ cellValue.value_raw }}"
|
|
{% if cellValue.value_html is not empty %}
|
|
{% set cellValueHtml = cellValue.value_html %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% if cellValueHtml is empty %}
|
|
{% set cellValueHtml = ' ' %}
|
|
{% endif %}
|
|
>{{ cellValueHtml|raw }}</td>
|
|
{% endfor %}
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
|
|
{% if oUIBlock.HasRowActions() %}
|
|
{{ render_block(oUIBlock.GetRowActionsTemplate()) }}
|
|
{% endif %} |