Skip to content
This repository was archived by the owner on Jul 10, 2020. It is now read-only.

Fix bug using twb-row-open and column-size options inside a form without fieldset#147

Open
alejandro-fiore wants to merge 1 commit into
neilime:masterfrom
alejandro-fiore:patch-1
Open

Fix bug using twb-row-open and column-size options inside a form without fieldset#147
alejandro-fiore wants to merge 1 commit into
neilime:masterfrom
alejandro-fiore:patch-1

Conversation

@alejandro-fiore

Copy link
Copy Markdown
Contributor

If i have the following entity (it's simplify)

class Entity {

    protected $name;

    /**
     * @Form\Options({
     *      "twb-row-open"  : true,
     *      "column-size"   : "md-4"
     * })
     */
    protected $start;

    /**
     * @Form\Options({
     *      "column-size"   : "md-4"
     * })
     *
     */
    protected $end;

    /**
     * @Form\Options({
     *      "twb-row-close" : true,
     *      "column-size"   : "md-4"
     * })
     */
    protected $count;

    protected $type;
}

The form rendered is (it's simplify)

<form>
    <div class="row">
        <div class="form-group">
              <label>Name</label>
              <input name="name" class="form-control" value="" type="text">
        </div>
        <div class="form-group  col-md-4">
              <label>Start</label>
              <input name="start" class="form-control" value="" type="date">
          </div>
          ....
    </div>
</form>

With the fix, now it's rendering like this:

<form>
    <div class="form-group">
             <label>Name</label>
             <input name="name" class="form-control" value="" type="text">
    </div>
    <div class="row">
        <div class="form-group  col-md-4">
                <label>Start</label>
                <input name="start" class="form-control" value="" type="date">
          </div>
          ....
    </div>
      ....
</form>

Fix bug when using twb-row-open, twb-row-close and column-size inside a form, not a collection.
Before, was always rendered all form elements inside a <div class="row">. Now open the <div class="row"> in the element with twb-row-open, and close it in the twb-row-close element.
@neilime

neilime commented Jun 30, 2015

Copy link
Copy Markdown
Owner

Please fix the broken phpunit tests

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants