From fe6c2e8d0630cf2004e2af549fa265523bd38b4a Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Mon, 30 Jan 2023 09:35:01 +0100 Subject: [PATCH] fix(radiosfield): better display --- css/styles.scss | 9 +++++++++ inc/field/checkboxesfield.class.php | 5 +++-- inc/field/radiosfield.class.php | 7 +++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/css/styles.scss b/css/styles.scss index b429dddcd..76d432288 100644 --- a/css/styles.scss +++ b/css/styles.scss @@ -320,6 +320,15 @@ form#plugin_formcreator_form { padding: initial; padding-left: 40px; } + + .label-radio { + display: inline; + margin-bottom: 0.2em; + } + + .radio { + padding-bottom: 1em; + } } } diff --git a/inc/field/checkboxesfield.class.php b/inc/field/checkboxesfield.class.php index 33fe1bae8..0287b1171 100644 --- a/inc/field/checkboxesfield.class.php +++ b/inc/field/checkboxesfield.class.php @@ -100,6 +100,7 @@ public function getRenderedHtml($domain, $canEdit = true): string { foreach ($values as $value) { if ((trim($value) != '')) { $i++; + $translated_value = __($value, $domain); $html .= "
"; $html .= Html::getCheckbox([ 'title' => htmlentities($value, ENT_QUOTES), @@ -109,8 +110,8 @@ public function getRenderedHtml($domain, $canEdit = true): string { 'zero_on_empty' => false, 'checked' => in_array($value, $this->value) ]); - $html .= '
"; } diff --git a/inc/field/radiosfield.class.php b/inc/field/radiosfield.class.php index 07ec0daa1..ff3d4ca82 100644 --- a/inc/field/radiosfield.class.php +++ b/inc/field/radiosfield.class.php @@ -85,14 +85,13 @@ public function getRenderedHtml($domain, $canEdit = true): string { 'id' => $domId . '_' . $i, 'value' => $value ] + $checked); - $html .= '