Skip to content

Commit

Permalink
update updater to latest stable release; refactored modal-action-butt…
Browse files Browse the repository at this point in the history
…on for UI fixed

Signed-off-by: Michael Kaufmann <[email protected]>
  • Loading branch information
d00p committed Mar 29, 2024
1 parent b49f20a commit 61ae182
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 19 deletions.
10 changes: 10 additions & 0 deletions install/updates/froxlor/update_2.1.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,13 @@
Update::showUpdateStep("Updating from 2.1.5 to 2.1.6", false);
Froxlor::updateToVersion('2.1.6');
}

if (Froxlor::isFroxlorVersion('2.1.6')) {
Update::showUpdateStep("Updating from 2.1.6 to 2.1.7", false);
Froxlor::updateToVersion('2.1.7');
}

if (Froxlor::isFroxlorVersion('2.1.7')) {
Update::showUpdateStep("Updating from 2.1.7 to 2.1.8", false);
Froxlor::updateToVersion('2.1.8');
}
2 changes: 1 addition & 1 deletion install/updates/froxlor/update_2.2.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
}
}

if (Froxlor::isFroxlorVersion('2.1.6')) {
if (Froxlor::isFroxlorVersion('2.1.8')) {
Update::showUpdateStep("Enhancing virtual email table");
Database::query("ALTER TABLE `" . TABLE_MAIL_VIRTUAL . "` ADD `spam_tag_level` float(4,1) NOT NULL DEFAULT 7.0;");
Database::query("ALTER TABLE `" . TABLE_MAIL_VIRTUAL . "` ADD `spam_kill_level` float(4,1) NOT NULL DEFAULT 14.0;");
Expand Down
46 changes: 28 additions & 18 deletions templates/Froxlor/table/macros.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,8 @@
{{ data.text }}
{% endif %}
</{% if data.href is defined %}a{% else %}span{% endif %}>
{% if data.modal is defined and data.modal is iterable %}
<div class="modal fade" data-action="{{ data.modal.action|default('') }}" data-entry="{{ data.modal.entry }}" id="{{ data.modal.id }}" aria-hidden="true" aria-labelledby="{{ data.modal.id }}Label" tabindex="-1">
<div class="modal-dialog {{ data.modal.size|default('modal-xl') }} modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="{{ data.modal.id }}Label">{{ data.modal.title }}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{{ lng('panel.modalclose') }}"></button>
</div>
<div class="modal-body text-start">
{{ data.modal.body|raw }}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">{{ lng('panel.modalclose') }}</button>
</div>
</div>
</div>
</div>
{% endif %}
{% endapply %}
{# the modal-markup if any will be generated using actions_modal()-macro after the table itself #}
{% endmacro %}

{% macro domainWithSan(data) %}
Expand All @@ -90,3 +73,30 @@
{% endif %}
{% endfor %}
{% endmacro %}

{% macro actions_modal(data) %}
{% for action in data %}
{% if action.visible is not defined or action.visible is defined and action.visible %}
{% apply spaceless %}
{% if action.modal is defined and action.modal is iterable %}
<div class="modal fade" data-action="{{ action.modal.action|default('') }}" data-entry="{{ action.modal.entry }}" id="{{ action.modal.id }}" aria-hidden="true" aria-labelledby="{{ action.modal.id }}Label" tabindex="-1">
<div class="modal-dialog {{ action.modal.size|default('modal-xl') }} modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="{{ action.modal.id }}Label">{{ action.modal.title }}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{{ lng('panel.modalclose') }}"></button>
</div>
<div class="modal-body text-start">
{{ action.modal.body|raw }}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">{{ lng('panel.modalclose') }}</button>
</div>
</div>
</div>
</div>
{% endif %}
{% endapply %}
{% endif %}
{% endfor %}
{% endmacro %}
8 changes: 8 additions & 0 deletions templates/Froxlor/table/table.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@
{{ pagination.paging(listing.pagination) }}
{% endif %}
</div>
{# handle potential modal-html if defined by actions #}
{% for tr in listing.table.tr %}
{% for td in tr.td %}
{% if td.data is iterable and td.data.macro == 'actions' %}
{{ macros.actions_modal(td.data.data) }}
{% endif %}
{% endfor %}
{% endfor %}
{% endif %}

<!-- Modal -->
Expand Down

0 comments on commit 61ae182

Please sign in to comment.