N°3567 - Migrate backoffice pages to new UIBlock system : App. upgrade (use ibo-is-hidden class to hide blocks)

This commit is contained in:
Eric
2021-01-20 10:41:04 +01:00
parent 392cdf6058
commit 9b67f7beba
20 changed files with 27 additions and 33 deletions

View File

@@ -2,7 +2,7 @@
{# @license http://opensource.org/licenses/AGPL-3.0 #}
$("#do-update").on("click", function() {
$("#submit-wait").show();
$("#submit-wait").removeClass("ibo-is-hidden");
$(this).prop("disabled", true);
$("#cancel-update").prop("disabled", true);
$(this).parents('form').submit();

View File

@@ -46,7 +46,7 @@
{% UIAlert ForFailure {'sId':'header-file-size', 'IsHidden':true} %}
{% UIContentBlock Standard {'sContainerClass':'ibo-file-size-error'} %}
{{ 'iTopUpdate:Error:FileUploadMaxSizeTooStandard'|dict_s }}
{{ 'iTopUpdate:Error:FileUploadMaxSizeTooSmall'|dict_s }}
{% EndUIContentBlock %}
{% UIContentBlock Standard {'sContainerClass':'ibo-file-size-error'} %}
{{ 'iTopUpdate:UI:PostMaxSize'|dict_format(sPostMaxSize) }}

View File

@@ -58,7 +58,7 @@ $.when(oGetItopDiskSpace, oGetDBDiskSpace).then(
var iDBDiskSpace = data2[0].iDBDiskSpace;
if ((2 * (iItopDiskSpace + iDBDiskSpace)) > iDiskFreeSpace)
{
$("#dobackup-warning").show();
$("#dobackup-warning").removeClass("ibo-is-hidden");
}
}
);
@@ -71,17 +71,17 @@ $("#file").on("change", function(e) {
{
if (selectedFile.size > {{ iFileUploadMaxSize }})
{
errorMsg.show();
errorMsg.removeClass("ibo-is-hidden");
submitButton.prop("disabled", true);
return;
}
}
errorMsg.hide();
errorMsg.addClass("ibo-is-hidden");
submitButton.prop("disabled", false);
});
$("#check-update").on("click", function(e) {
$("#submit-wait").show();
$("#submit-wait").removeClass("ibo-is-hidden");
$(this).prop("disabled", true);
$(".ajax-spin").removeClass("fa-spinner").removeClass("fa-spin").addClass("fa-times");
$(this).parents('form').submit();

View File

@@ -98,10 +98,10 @@ function ExecNextStep() {
{
$("#setup_error").html({{ 'iTopUpdate:Error:UpdateFailed'|dict_s|json_encode|raw }});
}
$('#progress').hide();
$("#setup_error_outer").show();
$("#run_setup").show();
$("#setup_continue").hide();
$('#progress').addClass("ibo-is-hidden");
$("#setup_error_outer").removeClass("ibo-is-hidden");
$("#run_setup").removeClass("ibo-is-hidden");
$("#setup_continue").addClass("ibo-is-hidden");
});
}
else
@@ -114,7 +114,7 @@ function ExecNextStep() {
$.ajax(oGetCurrentVersion);
$("#setup_continue").removeAttr("disabled");
$('#installation_progress').hide(300);
$('#new_version').show();
$('#new_version').removeClass("ibo-is-hidden");
$("#current_version").removeClass("message-info").addClass("message-valid");
}
}

View File

@@ -1,6 +1,5 @@
<div id="{{ oUIBlock.GetId() }}"
class="ibo-alert ibo-is-{{ oUIBlock.GetColor() }}{% if oUIBlock.IsOpenedByDefault() %} ibo-is-opened{% endif %}"
{% if oUIBlock.IsHidden() %}style="display: none;"{% endif %}>
class="ibo-alert ibo-is-{{ oUIBlock.GetColor() }}{% if oUIBlock.IsOpenedByDefault() %} ibo-is-opened{% endif %}{% if oUIBlock.IsHidden() %} ibo-is-hidden{% endif %}">
{% if oUIBlock.IsCollapsible() %}
<div class="ibo-alert--action-button ibo-alert--maximize-button" data-role="ibo-alert--collapse-toggler">
<i class="fas fa-caret-down"></i>

View File

@@ -1,5 +1,5 @@
<button id="{{ oUIBlock.GetId() }}"
class="ibo-button ibo-is-{{ oUIBlock.GetActionType() }} ibo-is-{{ oUIBlock.GetColor() }} {{ oUIBlock.GetAdditionalCSSClass() }}"
class="ibo-button ibo-is-{{ oUIBlock.GetActionType() }} ibo-is-{{ oUIBlock.GetColor() }} {{ oUIBlock.GetAdditionalCSSClass() }}{% if oUIBlock.IsHidden() %} ibo-is-hidden{% endif %}"
{% if oUIBlock.GetDataAttributes() %}
{% for sName, sValue in oUIBlock.GetDataAttributes() %}
data-{{ sName }}="{{ sValue }}"
@@ -10,7 +10,6 @@
value="{{ oUIBlock.GetValue() }}"
{% if oUIBlock.IsDisabled() is same as(true) %} disabled {% endif %}
{% if oUIBlock.GetTooltip() is not empty %} data-tooltip-content="{{ oUIBlock.GetTooltip() }}" {% endif %}
{% if oUIBlock.IsHidden() %}style="display: none;"{% endif %}
>
{% if oUIBlock.GetIconClass() is not empty %}
<span class="ibo-button--icon {{ oUIBlock.GetIconClass() }}"></span>

View File

@@ -1,6 +1,5 @@
<div id="{{ oUIBlock.GetId() }}"
class="ibo-collapsible-section {{ oUIBlock.GetCSSClasses() }}{% if oUIBlock.IsOpenedByDefault() %} ibo-is-opened{% endif %}"
{% if oUIBlock.IsHidden() %}style="display: none;"{% endif %}>
class="ibo-collapsible-section {{ oUIBlock.GetCSSClasses() }}{% if oUIBlock.IsOpenedByDefault() %} ibo-is-opened{% endif %}{% if oUIBlock.IsHidden() %} ibo-is-hidden{% endif %}">
<div class="ibo-collapsible-section--header" data-role="ibo-collapsible-section--collapse-toggler">
<div class="ibo-collapsible-section--action-button ibo-collapsible-section--maximize-button"><i
class="fas fa-caret-down"></i></div>

View File

@@ -1,7 +1,7 @@
{# @copyright Copyright (C) 2010-2020 Combodo SARL #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
{% apply spaceless %}
<div class="ibo-dashlet-badge--body" id="{{ oUIBlock.GetId() }}" {% if oUIBlock.IsHidden() %}style="display: none;"{% endif %}>
<div class="ibo-dashlet-badge--body{% if oUIBlock.IsHidden() %} ibo-is-hidden{% endif %}" id="{{ oUIBlock.GetId() }}">
<div class="ibo-dashlet-badge--icon-container">
<img class="ibo-dashlet-badge--icon" src="{{ oUIBlock.GetClassIconUrl() }}">
</div>

View File

@@ -1,7 +1,7 @@
{# @copyright Copyright (C) 2010-2020 Combodo SARL #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
{% apply spaceless %}
<div class="ibo-dashlet-header-static" id="{{ oUIBlock.GetId() }}" {% if oUIBlock.IsHidden() %}style="display: none;"{% endif %}>
<div class="ibo-dashlet-header-static{% if oUIBlock.IsHidden() %} ibo-is-hidden{% endif %}" id="{{ oUIBlock.GetId() }}">
<div class="ibo-dashlet-header-static--body">
{% if oUIBlock.GetIconUrl() is not empty %}
<div class="ibo-dashlet-header-static--icon-container">

View File

@@ -12,7 +12,7 @@
{% endif %}
{% endif %}
<table id="{{ oUIBlock.GetId() }}" width="100%" class="{{ oUIBlock.GetBlockCode() }}" {% if oUIBlock.IsHidden() %}style="display: none;"{% endif %}>
<table id="{{ oUIBlock.GetId() }}" width="100%" class="{{ oUIBlock.GetBlockCode() }}{% if oUIBlock.IsHidden() %} ibo-is-hidden{% endif %}">
<thead>
{% if oUIBlock.GetOption("select_mode") is not empty %}
<th></th>

View File

@@ -4,7 +4,7 @@
<input type="hidden" name="attr_{{ oUIBlock.GetRef() }}" value="">
{% set columns = oUIBlock.GetColumns() %}
<table id="{{ oUIBlock.GetId() }}" class="ibo-datatable listResults" style="width:100%; {% if oUIBlock.IsHidden() %}display: none;{% endif %}">
<table id="{{ oUIBlock.GetId() }}" class="ibo-datatable listResults{% if oUIBlock.IsHidden() %} ibo-is-hidden{% endif %}" style="width:100%;">
<thead>
<tr>
{% for column in columns %}

View File

@@ -2,7 +2,7 @@
{# @license http://opensource.org/licenses/AGPL-3.0 #}
{% set columns = oUIBlock.GetColumns() %}
<table id="{{ oUIBlock.GetId() }}" class="ibo-datatable listResults" style="width:100%; {% if oUIBlock.IsHidden() %} display: none;{% endif %}">
<table id="{{ oUIBlock.GetId() }}" class="ibo-datatable listResults{% if oUIBlock.IsHidden() %} ibo-is-hidden{% endif %}" style="width:100%;">
<thead>
<tr>
{% for column in columns %}

View File

@@ -1,5 +1,5 @@
{% set aParams = oUIBlock.GetParams() %}
<div id="{{ oUIBlock.GetId() }}" class="ibo-field ibo-field-{{ oUIBlock.GetLayout() }}"
<div id="{{ oUIBlock.GetId() }}" class="ibo-field ibo-field-{{ oUIBlock.GetLayout() }}{% if oUIBlock.IsHidden() %} ibo-is-hidden{% endif %}"
data-role="ibo-field"
data-attribute-code="{{ oUIBlock.GetAttCode() }}"
data-attribute-type="{{ oUIBlock.GetAttType() }}"
@@ -14,7 +14,6 @@
data-attribute-flag-must-prompt="{{ oUIBlock.IsMustPrompt()|var_export }}"
data-attribute-flag-slave="{{ oUIBlock.IsSlave()|var_export }}"
data-value-raw="{{ aParams.value_raw }}"
{% if oUIBlock.IsHidden() %}style="display: none;"{% endif %}
>
<div class="ibo-field--label">{{ oUIBlock.GetLabel()|raw }}</div>
<div class="ibo-field--value" {% if oUIBlock.GetValueId() %}id="{{ oUIBlock.GetValueId() }}"{% endif %}>

View File

@@ -1,5 +1,5 @@
{% if oUIBlock.GetSubBlocks() %}
<fieldset class="ibo-fieldset" id="{{ oUIBlock.GetId() }}" {% if oUIBlock.IsHidden() %}style="display: none;"{% endif %}>
<fieldset class="ibo-fieldset{% if oUIBlock.IsHidden() %} ibo-is-hidden{% endif %}" id="{{ oUIBlock.GetId() }}">
<legend class="ibo-fieldset-legend">{{ oUIBlock.GetLegend() }}</legend>
{% for oSubBlock in oUIBlock.GetSubBlocks() %}
{{ render_block(oSubBlock, {aPage: aPage}) }}

View File

@@ -1,11 +1,11 @@
<form method="post" enctype="multipart/form-data" id="{{ oUIBlock.GetId() }}"
class="{% if oUIBlock.IsHidden() %} ibo-is-hidden{% endif %}"
{% if oUIBlock.GetOnSubmitJsCode() %}
onSubmit="{{ oUIBlock.GetOnSubmitJsCode() }}"
{% endif %}
{% if oUIBlock.GetAction() %}
action="{{ oUIBlock.GetAction() }}"
{% endif %}
{% if oUIBlock.IsHidden() %}style="display: none;"{% endif %}
>
{% apply spaceless %}
{% block iboContentBlockContainer %}

View File

@@ -2,7 +2,7 @@
{% endblock %}
{% block iboInput %}
<input type="{{ oUIBlock.GetType() }}" id="{{ oUIBlock.GetId() }}" name="{{ oUIBlock.GetName() }}" value="{{ oUIBlock.GetValue()|raw }}"
class="{% if oUIBlock.IsHidden() %} ibo-is-hidden{% endif %}"
{% if oUIBlock.IsChecked() %}checked="checked"{% endif %}
{% if oUIBlock.IsHidden() %}style="display: none;"{% endif %}
>
{% endblock %}

View File

@@ -1,8 +1,7 @@
{# @copyright Copyright (C) 2010-2020 Combodo SARL #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
{% apply spaceless %}
<div id="{{ oUIBlock.GetId() }}" class="ibo-panel ibo-is-{{ oUIBlock.GetColor() }} {{ oUIBlock.GetCSSClasses() }}" {% block iboPanelMetaData %}{% endblock %}
{% if oUIBlock.IsHidden() %}style="display: none;"{% endif %}>
<div id="{{ oUIBlock.GetId() }}" class="ibo-panel ibo-is-{{ oUIBlock.GetColor() }} {{ oUIBlock.GetCSSClasses() }}{% if oUIBlock.IsHidden() %} ibo-is-hidden{% endif %}" {% block iboPanelMetaData %}{% endblock %}>
<div class="ibo-panel--header">
{% block iboPanelHeader %}
<div class="ibo-panel--header-left">

View File

@@ -1,5 +1,5 @@
{# @copyright Copyright (C) 2010-2021 Combodo SARL #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
{% apply spaceless %}
<i id="{{ oUIBlock.GetId() }}" {% if oUIBlock.IsHidden() %}style="display: none;"{% endif %} class="fas fa-spinner fa-spin" aria-hidden="true"></i>
<i id="{{ oUIBlock.GetId() }}" class="fas fa-spinner fa-spin{% if oUIBlock.IsHidden() %} ibo-is-hidden{% endif %}" aria-hidden="true"></i>
{% endapply %}

View File

@@ -1,5 +1,5 @@
{% apply spaceless %}
<div id="{{ oUIBlock.GetId() }}" class="ibo-title {% if oUIBlock.HasIcon() %}ibo-has-icon{% endif %}" {% if oUIBlock.IsHidden() %}style="display: none;"{% endif %}>
<div id="{{ oUIBlock.GetId() }}" class="ibo-title {% if oUIBlock.HasIcon() %}ibo-has-icon{% endif %}{% if oUIBlock.IsHidden() %} ibo-is-hidden{% endif %}">
{% if oUIBlock.HasIcon() %}
<div class="ibo-title--medallion">
<img class="ibo-title--icon ibo-title--icon--must-{{ oUIBlock.GetIconCoverMethod() }}" src="{{ oUIBlock.GetIconUrl() }}">

View File

@@ -8,13 +8,12 @@
{% block iboContentBlockContainer %}
{% if bHasDiv %}
<div id="{{ oUIBlock.GetId() }}"
{% if oUIBlock.GetCSSClasses() %}class="{{ oUIBlock.GetCSSClasses() }}"{% endif %}
class="{% if oUIBlock.GetCSSClasses() %}{{ oUIBlock.GetCSSClasses() }}{% endif %}{% if oUIBlock.IsHidden() %} ibo-is-hidden{% endif %}"
{% if oUIBlock.GetDataAttributes() %}
{% for sName, sValue in oUIBlock.GetDataAttributes() %}
data-{{ sName }}="{{ sValue }}"
{% endfor %}
{% endif %}
{% if oUIBlock.IsHidden() %}style="display: none;"{% endif %}
>
{% endif %}