codeconsole opened a new issue, #14202:
URL: https://github.com/apache/grails-core/issues/14202
All generated Grails apps use Bootstrap. So why have a lot of unnecessary
css rules and custom classes that cause nothing more that confusion for the
developer? I have created new templates for Bootstrap 5 that have virtually
no css rules, but require updates to the fields plugin so that fields templates
are not also required.
There are also some general things that the fields plugin should change such
as:
1. Constantly render double quotes.
2. User wrapper attributes when rendering the default wrapper.
`src/main/templates/scaffolding/edit.gsp`
```gsp
<f:all bean="domain" />
```
generates several wrappers
`grails-app/views/_fields/default/_wrapper.gsp`
```gsp
<div class='fieldcontain'>
<label for='${(prefix?:'')}${property}'>
<g:if test="${required}"><span class="required-indicator">
*</span></g:if>${label}
</label>
${wdiget}
</div>
```
A bootstrap friendly version would allow modified `<f:all />`:
```gsp
<f:all bean="domain" class="row" requiredClass="mb-3 required"
labelClass="col-sm-2 col-form-label text-sm-end" divClass="col-sm-10"
widget-class="form-control" widget-invalidClass="is-invalid" />
```
```gsp
<f:all bean="domain" class="row" requiredClass="mb-3 required"
labelClass="col-sm-2 col-form-label text-sm-end" divClass="col-sm-10"
widget-class="form-control" />
```
```gsp
<div class="row${required?' mb-3 required':''}${invalid?' invalid':''}">
<label class="col-sm-2 col-form-label text-sm-end"
for="${(prefix?:'')}${property}">${label}<g:if test="${required}"><span
class="required-indicator"> *</span></g:if>
</label>
<div class="col-sm-10">${wdiget}</div>
</div>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]