joergrech / KickstartWithBootstrap

Kickstart is an extension for Grails in order to start your project with a good looking frontend. It is intended to be used in rapid application scenarios such as a Startup Weekend or a prototyping session with a customer. This plugin provides adapted scaffolding templates for standard CRUD pages using Twitter's CSS Framework Bootstrap and offers some basic pages for a web site.
65 stars 52 forks source link

bug in renderEditor.template - g:select - 'class' attribute written twice in several places #80

Open pbb6w7 opened 10 years ago

pbb6w7 commented 10 years ago

The class="form-control" is overwritten (if I may use the term as its not exactly on override) in the following places causing the g:select tag to render only the second class element. For the lines outlined below the form-control needs to be incorporated in the appropriate following line. The current code cause the g:select tag to ignore the class="form-control"

One:

private renderManyToOne(domainClass,property)
line:95
sb << '<g:select class="form-control"'
overwritten by:
line:103
sb << ' class="many-to-one"'

Two:

private renderManyToMany(domainClass, property) 
line:120
sb << '<g:select class="form-control" name="' << property.name << '"'
overwritten by:
line:127
sb << ' class="many-to-many"'

Three: a)

private renderNumberEditor(domainClass, property) 
line:153
return "<g:select class='form-control' name=\"${property.name}\" from=\"\${-128..127}\" class=\"range\" value=\"\${fieldValue(bean: ${domainInstance}, field: '${property.name}')}\" />"
class='form-control' 
overwritten by:
class=\"range\"

b)

line:160:
sb << '<g:select class="form-control" name="' << property.name << 
overwritten by:
line:162
sb << ' class="range"'
pbb6w7 commented 10 years ago

I should probably clarify - the way the renderEditor.template is right now it renders the <g:select ...> tag with two class attributes and the first one seems to be ignored (for example the many-to-many):

<g:select  class="form-control" name="name" from="form" multiple="multiple" optionKey="id" size="5" required="" value="value" class="many-to-many"/>

where the

class="form-control"

appears in the beginning of the tag, and the

class="many-to-many"

appears at the end. The browser then seems to disregard the first class attribute (granted tested only in Chrome)