Commit 663ebe4f authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Aide de vue FormControlGroup : correction du rendu particulier des checkbox...

Aide de vue FormControlGroup :  correction du rendu particulier des checkbox simple : utilisation du marquage fourni par bootstrap (unicaen.css modifié).
parent 497dbba6
Loading
Loading
Loading
Loading
+5 −6
Changes for public/css/unicaen.css: 5 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -195,13 +195,12 @@ div.multicheckbox label input[type=radio] {



.form-group input[type="checkbox"] {
    display: inline;
    vertical-align: text-bottom;
    margin-right: 5px;
.checkbox label {
    border: 1px red dotted;
}
.form-group label {
    display: inline;
.checkbox input[type="checkbox"] {
    margin-left: -25px;
    margin-top: 2px;
}


+14 −5
Changes for src/UnicaenApp/Form/View/Helper/FormControlGroup.php: 14 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -124,9 +124,14 @@ EOT;
        $html = '';

        if ($this->includeLabel && $element->getLabel() && !$element instanceof Button) {
            if ($element instanceof Checkbox && ! $element instanceof MultiCheckbox) {
                $html = $element->getLabel();
            }
            else {
                $helper = $this->getView()->plugin('formLabel');
                $html = $helper($element);
            }
        }

        if ($element->hasAttribute('info_icon')) {
            $info = $element->getAttribute('info_icon');
@@ -180,14 +185,18 @@ EOT;
        return $html;
    }

    private function assembleDivContent(ElementInterface $element, $label, $helpContentBefore, $input, $button, $helpContentAfter, $errors)
    private function assembleDivContent(ElementInterface $element, $label, $helpContentBefore, $input, $clearButton, $helpContentAfter, $errors)
    {
        if ($element instanceof Checkbox && ! $element instanceof MultiCheckbox) {
            $clearButton = ''; // n'a pas de sens
            $html = <<<EOT
    $helpContentBefore
    $input
    $label
    $button
    <div class="checkbox">
        <label>
            $input $label
        </label>
    </div>
    $clearButton
    $helpContentAfter
    $errors
EOT;
@@ -197,7 +206,7 @@ EOT;
    $label
    $helpContentBefore
    $input
    $button
    $clearButton
    $helpContentAfter
    $errors
EOT;