mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-26 03:58:45 +02:00
N°3123 - Refactor Directories
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
{# @copyright Copyright (C) 2010-2020 Combodo SARL #}
|
||||
{# @license http://opensource.org/licenses/AGPL-3.0 #}
|
||||
|
||||
<input type="hidden" name="attr_{{ oUIBlock.GetRef() }}" value="">
|
||||
|
||||
{% set columns = oUIBlock.GetColumns() %}
|
||||
<table id="{{ oUIBlock.GetId() }}" class="ibo-datatable listResults" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
{% for column in columns %}
|
||||
<th class="ibo-datatable-header" title="{{ column.description }}">{{ column.label|raw }}</th>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for oSubBlock in oUIBlock.GetRows() %}
|
||||
{{ render_block(oSubBlock, {aPage: aPage}) }}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -0,0 +1,6 @@
|
||||
$('#{{ oUIBlock.GetId() }}').DataTable({
|
||||
language: {
|
||||
emptyTable: {{ 'UI:Message:EmptyList:UseAdd'|dict_s }}
|
||||
},
|
||||
search:false
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
{# @copyright Copyright (C) 2010-2020 Combodo SARL #}
|
||||
{# @license http://opensource.org/licenses/AGPL-3.0 #}
|
||||
|
||||
<tr role="row" id="{{ oUIBlock.GetRef() }}_row_{{ oUIBlock.GetRowId() }}">
|
||||
{% for colName,column in oUIBlock.GetColumns() %}
|
||||
<td>
|
||||
{% set cellValueHtml = '' %}
|
||||
{% for cellName,cellValue in oUIBlock.GetData() %}
|
||||
{% if cellName == colName %}
|
||||
{% set cellValueHtml = cellValue %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if cellValueHtml is empty %}
|
||||
{% set cellValueHtml = ' ' %}
|
||||
{% endif %}
|
||||
{{ cellValueHtml|raw }}
|
||||
</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
48
templates/base/components/datatable/static/layout.html.twig
Normal file
48
templates/base/components/datatable/static/layout.html.twig
Normal file
@@ -0,0 +1,48 @@
|
||||
{# @copyright Copyright (C) 2010-2020 Combodo SARL #}
|
||||
{# @license http://opensource.org/licenses/AGPL-3.0 #}
|
||||
|
||||
{% set columns = oUIBlock.GetColumns() %}
|
||||
<table id="{{ oUIBlock.GetId() }}" class="ibo-datatable listResults" style="width:100%;">
|
||||
<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() %}
|
||||
{% if data['@class'] is not empty %}
|
||||
<tr role="row" class="{{ data['@class'] }}">
|
||||
{% else %}
|
||||
<tr>
|
||||
{% 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>
|
||||
47
templates/base/components/datatable/static/layout.js.twig
Normal file
47
templates/base/components/datatable/static/layout.js.twig
Normal file
@@ -0,0 +1,47 @@
|
||||
{# @copyright Copyright (C) 2010-2020 Combodo SARL #}
|
||||
{# @license http://opensource.org/licenses/AGPL-3.0 #}
|
||||
|
||||
{% if oUIBlock.GetOptions() is not empty %}
|
||||
{% set iPageSize = oUIBlock.GetOptions()["iPageSize"] %}
|
||||
{% else %}
|
||||
{% set iPageSize = 10 %}
|
||||
{% endif %}
|
||||
|
||||
$('#{{ oUIBlock.GetId() }}').DataTable({
|
||||
language: {
|
||||
processing: "{{ 'UI:Datatables:Language:Processing'|dict_s }}",
|
||||
search: "{{ 'UI:Datatables:Language:Search'|dict_s }}",
|
||||
lengthMenu: "{{ 'UI:Datatables:Language:LengthMenu'|dict_s }}",
|
||||
zeroRecords: "{{ 'UI:Datatables:Language:ZeroRecords'|dict_s }}",
|
||||
info: "{{ 'UI:Datatables:Language:Info'|dict_s }}",
|
||||
infoEmpty: "",
|
||||
infoFiltered: "({{ 'UI:Datatables:Language:InfoFiltered'|dict_s }})",
|
||||
emptyTable: "{{ 'UI:Datatables:Language:EmptyTable'|dict_s }}",
|
||||
paginate: {
|
||||
first: "<<",
|
||||
previous: "<i class=\"fas fa-angle-left\"></i>",
|
||||
next: "<i class=\"fas fa-angle-right\"></i>",
|
||||
last: ">>"
|
||||
},
|
||||
aria: {
|
||||
sortAscending: ": {{ 'UI:Datatables:Language:Sort:Ascending'|dict_s }}",
|
||||
sortDescending: ": {{ 'UI:Datatables:Language:Sort:Descending'|dict_s }}"
|
||||
}
|
||||
},
|
||||
order: [],
|
||||
rowId: "id",
|
||||
filter: false,
|
||||
{% if oUIBlock.GetData()|length <= iPageSize %}
|
||||
paging: false,
|
||||
{% endif %}
|
||||
dom: "<'ibo-datatable-toolbar'pil>t<'ibo-datatable-toolbar'pil>",
|
||||
lengthMenu: [[ {{ iPageSize }}, {{ iPageSize*2 }}, {{ iPageSize*3 }}, {{ iPageSize*4 }}, -1], [ {{ iPageSize }}, {{ iPageSize*2 }}, {{ iPageSize*3 }}, {{ iPageSize*4 }}, "{{ 'Portal:Datatables:Language:DisplayLength:All'|dict_s }}"]],
|
||||
columns: [
|
||||
{% for column in oUIBlock.GetColumns() %}
|
||||
{
|
||||
width: "auto",
|
||||
sortable: true
|
||||
},
|
||||
{% endfor %}
|
||||
]
|
||||
});
|
||||
Reference in New Issue
Block a user