From b313d7c0fdf5d72f9bfc08b44e24ee76aa165ade Mon Sep 17 00:00:00 2001 From: John BOTELLA <68917336+thersane-john@users.noreply.github.com> Date: Sat, 14 Feb 2026 14:51:33 +0100 Subject: [PATCH] Fix in card css modal display (#36569) * Fix display of cards in a modal * fix php stan * fix php stan * Try a change to force CI --------- Co-authored-by: Laurent Destailleur --- htdocs/public/webportal/css/card.css | 5 ++ htdocs/public/webportal/css/dialog.css | 51 +++++++++++++++++++ .../webportal/tpl/card-edit-footer.tpl.php | 3 +- htdocs/public/webportal/tpl/card-edit.tpl.php | 6 +-- .../tpl/card-view-actions-buttons.tpl.php | 26 ++++------ .../webportal/tpl/card-view-footer.tpl.php | 3 +- .../tpl/card-view-properties.tpl.php | 2 +- htdocs/public/webportal/tpl/card-view.tpl.php | 8 ++- 8 files changed, 76 insertions(+), 28 deletions(-) diff --git a/htdocs/public/webportal/css/card.css b/htdocs/public/webportal/css/card.css index 9bce48fbe03..c8e6470c391 100644 --- a/htdocs/public/webportal/css/card.css +++ b/htdocs/public/webportal/css/card.css @@ -59,3 +59,8 @@ grid-row: 2; } } + +:is(.object-card-view__footer, .object-card-edit__footer):empty, +:is(.object-card-view__footer, .object-card-edit__footer):has(#actions_buttons:empty){ + display: none; +} diff --git a/htdocs/public/webportal/css/dialog.css b/htdocs/public/webportal/css/dialog.css index 6c67fb50006..6cafb44a2c4 100644 --- a/htdocs/public/webportal/css/dialog.css +++ b/htdocs/public/webportal/css/dialog.css @@ -107,3 +107,54 @@ dialog article .dialog-header-btn.close { margin-top: 0; margin-bottom: 0; } + +body.--is-modal { + background: var(--colorbackbody); +} + +body.--is-modal .modal-hidden, +body:not(.--is-modal) .modal-displayed { + display: none; +} + + +body.--is-modal .card-view-container, +body.--is-modal main.container { + margin-top: 0; + margin-bottom: 0; + padding-top: 0; + padding-bottom: 0; +} + +body.--is-modal article.card-view-container { + box-shadow: none; +} + +body.--is-modal article.card-view-container > header { + margin-top: 0; +} +body.--is-modal article.card-view-container > footer { + margin-bottom: 0; + margin-bottom: 0; +} + +@media (min-width: 576px) { + body.--is-modal .container { + max-width: 100%; + } +} +@media (min-width: 768px) { + body.--is-modal .container { + max-width: 100%; + } +} +@media (min-width: 992px) { + body.--is-modal .container { + max-width: 100%; + } +} +@media (min-width: 1200px) { + body.--is-modal .container { + max-width: 100%; + } +} diff --git a/htdocs/public/webportal/tpl/card-edit-footer.tpl.php b/htdocs/public/webportal/tpl/card-edit-footer.tpl.php index e603787c00f..b8d6b092afe 100644 --- a/htdocs/public/webportal/tpl/card-edit-footer.tpl.php +++ b/htdocs/public/webportal/tpl/card-edit-footer.tpl.php @@ -22,5 +22,4 @@ $formCard = $this->formCard; ?> - + diff --git a/htdocs/public/webportal/tpl/card-edit.tpl.php b/htdocs/public/webportal/tpl/card-edit.tpl.php index b2d848c16e7..d68b76bff9b 100644 --- a/htdocs/public/webportal/tpl/card-edit.tpl.php +++ b/htdocs/public/webportal/tpl/card-edit.tpl.php @@ -38,9 +38,9 @@ $formCard = $this->formCard; loadTemplate('card-edit-properties') ?> loadTemplate('card-edit-lines') ?> + + + loadTemplate('card-edit-footer') ?> - loadTemplate('card-edit-actions-buttons') ?> - - loadTemplate('card-edit-footer') ?> diff --git a/htdocs/public/webportal/tpl/card-view-actions-buttons.tpl.php b/htdocs/public/webportal/tpl/card-view-actions-buttons.tpl.php index 1c9e6ea6546..af6f1477219 100644 --- a/htdocs/public/webportal/tpl/card-view-actions-buttons.tpl.php +++ b/htdocs/public/webportal/tpl/card-view-actions-buttons.tpl.php @@ -22,21 +22,17 @@ $formCard = $this->formCard; $url = $context->getControllerUrl($context->controller). '&id=' . $formCard->object->id; -?> - -action != 'presend' && $formCard->action != 'editline') { ?> -
- action != 'presend' && $formCard->action != 'editline') { ?> +
executeHooks('addMoreActionsButtons', $parameters, $context); - if ($reshook < 0) { - $context->setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - } elseif (empty($reshook)) { - // Edit card - if ($formCard->permissiontoadd) { ?> +if ($reshook < 0) { + $context->setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} elseif (empty($reshook)) { + // Edit card + if ($formCard->permissiontoadd) { ?> " role="button">trans('Modify') ?> - -
- +
+formCard; ?> - + diff --git a/htdocs/public/webportal/tpl/card-view-properties.tpl.php b/htdocs/public/webportal/tpl/card-view-properties.tpl.php index c77592ea6b1..118b132c9f9 100644 --- a/htdocs/public/webportal/tpl/card-view-properties.tpl.php +++ b/htdocs/public/webportal/tpl/card-view-properties.tpl.php @@ -24,7 +24,7 @@ $fieldShowList = $formCard->fieldsmanager->getAllFieldsInfos($formCard->object, ?> -
+
$fields) { diff --git a/htdocs/public/webportal/tpl/card-view.tpl.php b/htdocs/public/webportal/tpl/card-view.tpl.php index bea429cdae7..bbdf3fd9699 100644 --- a/htdocs/public/webportal/tpl/card-view.tpl.php +++ b/htdocs/public/webportal/tpl/card-view.tpl.php @@ -36,14 +36,12 @@ print $formconfirm; ?> -
+
loadTemplate('card-view-header') ?> loadTemplate('card-view-properties') ?> loadTemplate('card-view-lines') ?> + + loadTemplate('card-view-footer') ?>
- -loadTemplate('card-view-actions-buttons') ?> - -loadTemplate('card-view-footer') ?>