Revert "N°8579 - remove "spaceless" in twig files"

This reverts commit ee993ef80a.
This commit is contained in:
Anne-Cath
2025-09-03 10:37:26 +02:00
parent 0f39106b56
commit f5cce23bb4
45 changed files with 635 additions and 480 deletions

View File

@@ -1,7 +1,9 @@
{# @copyright Copyright (C) 2010-2024 Combodo SAS #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
<div style="height:250px;width:100%" class="dashboard_chart" id="my_chart_{{ oUIBlock.sChartId }}{{ oUIBlock.iChartCounter }}">
<div style="height:200px;line-height:200px;vertical-align:center;text-align:center;width:100%">
<img src="{{ get_absolute_url_app_root() }}images/indicator.gif">
{% apply spaceless %}
<div style="height:250px;width:100%" class="dashboard_chart" id="my_chart_{{ oUIBlock.sChartId }}{{ oUIBlock.iChartCounter }}">
<div style="height:200px;line-height:200px;vertical-align:center;text-align:center;width:100%">
<img src="{{ get_absolute_url_app_root() }}images/indicator.gif">
</div>
</div>
</div>
{% endapply %}

View File

@@ -1,5 +1,7 @@
{# @copyright Copyright (C) 2010-2024 Combodo SAS #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
{% apply spaceless %}
$.post('{{ oUIBlock.sUrl|escape('js') }}', {}, function (data) {
$('body').append(data);
});
});
{% endapply %}

View File

@@ -1,27 +1,29 @@
{# @copyright Copyright (C) 2010-2024 Combodo SAS #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
<div id="{{ oUIBlock.GetId() }}" class="{{ oUIBlock.GetBlockCode() }}">
<div>
<table style="width:100%" class="transparent">
<tr>
<td><a href="{{ oUIBlock.sDownloadLink }}" class="ibo-block-csv--download-link ibo-button ibo-is-alternative ibo-is-primary">{{ 'UI:Download-CSV'|dict_format(oUIBlock.sCsvFile) }}</a>{{ oUIBlock.sCharsetNotice }}</td>
<td style="text-align:right">
<input type="checkbox" {{ oUIBlock.sChecked }} onClick="window.location.href='{{ oUIBlock.sLinkToToggle }}'">
&nbsp;{{ 'UI:CSVExport:AdvancedMode'|dict_s }}
</td>
</tr>
</table>
{% if oUIBlock.bAdvancedMode %}
<p>
{{ 'UI:CSVExport:AdvancedMode+'|dict_s }}
</p>
{% endif %}
</div>
<div id="csv_content_loading">
<div style="width: 250px; height: 20px; background: url(../setup/orange-progress.gif); border: 1px #999 solid; margin-left:auto; margin-right: auto; text-align: center;">
{{ 'UI:Loading'|dict_s }}
{% apply spaceless %}
<div id="{{ oUIBlock.GetId() }}" class="{{ oUIBlock.GetBlockCode() }}">
<div>
<table style="width:100%" class="transparent">
<tr>
<td><a href="{{ oUIBlock.sDownloadLink }}" class="ibo-block-csv--download-link ibo-button ibo-is-alternative ibo-is-primary">{{ 'UI:Download-CSV'|dict_format(oUIBlock.sCsvFile) }}</a>{{ oUIBlock.sCharsetNotice }}</td>
<td style="text-align:right">
<input type="checkbox" {{ oUIBlock.sChecked }} onClick="window.location.href='{{ oUIBlock.sLinkToToggle }}'">
&nbsp;{{ 'UI:CSVExport:AdvancedMode'|dict_s }}
</td>
</tr>
</table>
{% if oUIBlock.bAdvancedMode %}
<p>
{{ 'UI:CSVExport:AdvancedMode+'|dict_s }}
</p>
{% endif %}
</div>
<div id="csv_content_loading">
<div style="width: 250px; height: 20px; background: url(../setup/orange-progress.gif); border: 1px #999 solid; margin-left:auto; margin-right: auto; text-align: center;">
{{ 'UI:Loading'|dict_s }}
</div>
</div>
<textarea id="csv_content" style="display:none;"></textarea>
</div>
<textarea id="csv_content" style="display:none;"></textarea>
</div>
{% endapply %}

View File

@@ -1,5 +1,6 @@
{# @copyright Copyright (C) 2010-2024 Combodo SAS #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
{% apply spaceless %}
$.post(
'{{ oUIBlock.sAjaxLink|escape('js') }}',
{{ oUIBlock.sJsonParams|raw }},
@@ -7,4 +8,5 @@ $.post(
$('#csv_content').html(data);
$('#csv_content_loading').hide();
$('#csv_content').show();
});
});
{% endapply %}

View File

@@ -1,21 +1,25 @@
{# @copyright Copyright (C) 2010-2024 Combodo SAS #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
{% if oUIBlock.bEmptySet or oUIBlock.bNotAuthorized %}
<div class="ibo-block-list--empty-text">{{ 'UI:NoObjectToDisplay'|dict_s }}</div>
{% endif %}
{% apply spaceless %}
{# TODO 3.1: This section should be removed if BlockList is no longer used as is, but always with a table #}
{% if oUIBlock.bCreateNew %}
<div class="ibo-block-list--create-action">
<a{{ oUIBlock.sLinkTarget }} href="{{ oUIBlock.sAbsoluteUrlAppRoot }}pages/UI.php?operation=new&class={{ oUIBlock.sClass }}&{{ oUIBlock.sParams }}{{ oUIBlock.sDefault }}">
<span class="ibo-block-list--create-icon">
<span class="fas fa-plus"></span>
</span>
<span class="ibo-block-list--create-label">{{ 'UI:ClickToCreateNew'|dict_format(oUIBlock.sClassLabel) }}</span>
</a>
</div>
{% endif %}
{% if oUIBlock.bEmptySet or oUIBlock.bNotAuthorized %}
<div class="ibo-block-list--empty-text">{{ 'UI:NoObjectToDisplay'|dict_s }}</div>
{% endif %}
{% for oSubBlock in oUIBlock.GetSubBlocks() %}
{{- render_block(oSubBlock, {aPage: aPage}) -}}
{% endfor %}
{# TODO 3.1: This section should be removed if BlockList is no longer used as is, but always with a table #}
{% if oUIBlock.bCreateNew %}
<div class="ibo-block-list--create-action">
<a{{ oUIBlock.sLinkTarget }} href="{{ oUIBlock.sAbsoluteUrlAppRoot }}pages/UI.php?operation=new&class={{ oUIBlock.sClass }}&{{ oUIBlock.sParams }}{{ oUIBlock.sDefault }}">
<span class="ibo-block-list--create-icon">
<span class="fas fa-plus"></span>
</span>
<span class="ibo-block-list--create-label">{{ 'UI:ClickToCreateNew'|dict_format(oUIBlock.sClassLabel) }}</span>
</a>
</div>
{% endif %}
{% for oSubBlock in oUIBlock.GetSubBlocks() %}
{{ render_block(oSubBlock, {aPage: aPage}) }}
{% endfor %}
{% endapply %}

View File

@@ -1,5 +1,7 @@
{# @copyright Copyright (C) 2010-2024 Combodo SAS #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
{% if oUIBlock.sEventAttachedData is not empty %}
$('body').trigger('update_history.itop', [{{ oUIBlock.sEventAttachedData|raw }}]);
{% endif %}
{% apply spaceless %}
{% if oUIBlock.sEventAttachedData is not empty %}
$('body').trigger('update_history.itop', [{{ oUIBlock.sEventAttachedData|raw }}]);
{% endif %}
{% endapply %}

View File

@@ -1,5 +1,6 @@
{# @copyright Copyright (C) 2010-2024 Combodo SAS #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
{% apply spaceless %}
oWidget{{ oUIBlock.oUILinksDirectWidget.GetInputId() }} = $('#{{ oUIBlock.oUILinksDirectWidget.GetInputId() }}').directlinks({
class_name: '{{ oUIBlock.oUILinksDirectWidget.GetClass() }}',
att_code: '{{ oUIBlock.oUILinksDirectWidget.GetAttCode() }}',
@@ -7,4 +8,5 @@ oWidget{{ oUIBlock.oUILinksDirectWidget.GetInputId() }} = $('#{{ oUIBlock.oUILin
submit_to: '{{ oUIBlock.sSubmitUrl }}',
oWizardHelper: {{ oUIBlock.sWizHelper }},
do_search: '{{ oUIBlock.sJSDoSearch }}'
});
});
{% endapply %}

View File

@@ -1,5 +1,6 @@
{# @copyright Copyright (C) 2010-2024 Combodo SAS #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
{% apply spaceless %}
oWidget{{ oUIBlock.oUILinksWidget.GetInputId() }} = new LinksWidget(
'{{ oUIBlock.oUILinksWidget.GetLinkedSetId() }}',
'{{ oUIBlock.oUILinksWidget.GetClass() }}',
@@ -13,4 +14,5 @@ oWidget{{ oUIBlock.oUILinksWidget.GetInputId() }} = new LinksWidget(
{{ oUIBlock.iMaxAddedId }},
{{ oUIBlock.aRemoved | json_encode | raw }}
);
oWidget{{ oUIBlock.oUILinksWidget.GetInputId() }}.Init();
oWidget{{ oUIBlock.oUILinksWidget.GetInputId() }}.Init();
{% endapply %}

View File

@@ -1,3 +1,5 @@
{# @copyright Copyright (C) 2010-2024 Combodo SAS #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
oWidget{{ oUIBlock.oUILinksWidget.GetInputId() }}.RegisterChange();
{% apply spaceless %}
oWidget{{ oUIBlock.oUILinksWidget.GetInputId() }}.RegisterChange();
{% endapply %}

View File

@@ -1,5 +1,7 @@
{# @copyright Copyright (C) 2010-2024 Combodo SAS #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
{% apply spaceless %}
$('#dlg_{{ oUIBlock.oUILinksWidget.GetLinkedSetId() }}').dialog({
width: $(window).width()*0.8,
height: $(window).height()*0.8,
@@ -28,4 +30,6 @@ $('#dlg_{{ oUIBlock.oUILinksWidget.GetLinkedSetId() }}').dialog({
});
$('#SearchFormToAdd_{{ oUIBlock.oUILinksWidget.GetLinkedSetId() }} form').on('submit.uilinksWizard', oWidget{{ oUIBlock.oUILinksWidget.GetInputId() }}.SearchObjectsToAdd);
$('#SearchFormToAdd_{{ oUIBlock.oUILinksWidget.GetLinkedSetId() }}').on('resize', oWidget{{ oUIBlock.oUILinksWidget.GetInputId() }}.UpdateSizes);
$('#SearchFormToAdd_{{ oUIBlock.oUILinksWidget.GetLinkedSetId() }}').on('resize', oWidget{{ oUIBlock.oUILinksWidget.GetInputId() }}.UpdateSizes);
{% endapply %}

View File

@@ -1,6 +1,8 @@
{# @copyright Copyright (C) 2010-2024 Combodo SAS #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
{% apply spaceless %}
{{ oUIBlock.GetWidgetName() }} = $('#{{ oUIBlock.GetId() }}').links_view_table({
link_class: '{{ oUIBlock.GetLinkedClass() }}',
external_key_to_me: '{{ oUIBlock.GetExternalKeyToMe() }}'
});
});
{% endapply %}

View File

@@ -1,5 +1,7 @@
{# @copyright Copyright (C) 2010-2024 Combodo SAS #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
{% apply spaceless %}
var selectionCount{{ oUIBlock.sIdShortcuts }} = $('#{{ oUIBlock.sIdShortcuts }} [name="selectionCount"]');
selectionCount{{ oUIBlock.sIdShortcuts }}.on('change',function()
{
@@ -45,4 +47,6 @@ $('#shortcut_btn_delete').on('click', function() {
});
}
return false;
});
});
{% endapply %}

View File

@@ -1,17 +1,21 @@
{# @copyright Copyright (C) 2010-2024 Combodo SAS #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
<div class="explain-printable not-printable">
<p>{{'UI:ExplainPrintable'| dict_format('<i class="fas fa-eye"></i>')| raw}}</p>
<div id="hiddeable_chapters"></div>
<button class="ibo-button ibo-is-regular ibo-is-primary action" onclick="window.print()">{{'UI:Button:GoPrint'| dict_s}}</button>&#160;&#160;
<button class="ibo-button ibo-is-regular ibo-is-secondary cancel" onclick="window.close()">{{ 'UI:Button:Cancel'| dict_s}}</button>&#160;&#160;
{% apply spaceless %}
<select name="text" onchange='$(".printable-content").width(this.value);'>
<option value='100%'>{{ 'UI:PrintResolution:FullSize'|dict_s }}</option>
<option value='19cm'>{{ 'UI:PrintResolution:A4Portrait'|dict_s }}</option>
<option value='27.7cm' selected>{{ 'UI:PrintResolution:A4Landscape'|dict_s }}</option>
<option value='19.6cm'>{{ 'UI:PrintResolution:LetterPortrait'|dict_s }}</option>
<option value='25.9cm'>{{ 'UI:PrintResolution:LetterLandscape'|dict_s }}</option>
</select>
<div class="explain-printable not-printable">
<p>{{'UI:ExplainPrintable'| dict_format('<i class="fas fa-eye"></i>')| raw}}</p>
<div id="hiddeable_chapters"></div>
<button class="ibo-button ibo-is-regular ibo-is-primary action" onclick="window.print()">{{'UI:Button:GoPrint'| dict_s}}</button>&#160;&#160;
<button class="ibo-button ibo-is-regular ibo-is-secondary cancel" onclick="window.close()">{{ 'UI:Button:Cancel'| dict_s}}</button>&#160;&#160;
</div>
<select name="text" onchange='$(".printable-content").width(this.value);'>
<option value='100%'>{{ 'UI:PrintResolution:FullSize'|dict_s }}</option>
<option value='19cm'>{{ 'UI:PrintResolution:A4Portrait'|dict_s }}</option>
<option value='27.7cm' selected>{{ 'UI:PrintResolution:A4Landscape'|dict_s }}</option>
<option value='19.6cm'>{{ 'UI:PrintResolution:LetterPortrait'|dict_s }}</option>
<option value='25.9cm'>{{ 'UI:PrintResolution:LetterLandscape'|dict_s }}</option>
</select>
</div>
{% endapply %}

View File

@@ -1,3 +1,7 @@
{# @copyright Copyright (C) 2010-2024 Combodo SAS #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
var oHiddeableChapters = {};
{% apply spaceless %}
var oHiddeableChapters = {};
{% endapply %}

View File

@@ -1,5 +1,7 @@
{# @copyright Copyright (C) 2010-2024 Combodo SAS #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
{% apply spaceless %}
var sHiddeableChapters = '<ul role="tablist" class="ibo-block-print--tablist">';
for (sId in oHiddeableChapters)
{
@@ -25,4 +27,6 @@ $('fieldset').each(function() {
$('legend').css('cursor', 'pointer').on('click', function(){
$(this).parent('fieldset').toggleClass('not-printable strikethrough');
});
});
{% endapply %}