-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Bootstrap 5 in scaffolding templates without requiring fields template files #348
Comments
Looks like Grace Framework decided not to be backward compatible and also went straight to bootstrap class generation. <fieldset class="form">
<f:all bean="${propertyName}"/>
</fieldset> results in: <fieldset class="form">
<div class="form-group row pb-3 has-error">
<label for="prop1" class="col-3 col-form-label property-label text-end">Prop1 <span class="required-indicator">*</span></label>
<div class="col-9">
<input type="text" name="prop1" value="as" required="true" class="form-control col-8" id="widget.prop1">
<span class="help-block">Property [prop1] of class [class website.Sample] with value [as] does not fall within the valid size range from [5] to [15]</span>
</div>
</div><div class="form-group row pb-3 ">
<label for="prop2" class="col-3 col-form-label property-label text-end">Prop2 <span class="required-indicator">*</span></label>
<div class="col-9">
<input type="number" name="prop2" value="12" class="form-control col-2" max="100" step="1" id="prop2">
</div>
</div><div class="form-group row pb-3 ">
<label for="prop3" class="col-3 col-form-label property-label text-end">Prop3 <span class="required-indicator">*</span></label>
<div class="col-9">
<div class="hstack gap-3">
<input type="hidden" name="prop3" value="date.struct">
<label style="display:none;" for="prop3_month" id="label_prop3_month">Month</label>
<select name="prop3_month" id="prop3_month" aria-labelledby="prop3 prop3_month" class="form-select w-20"><option value="" selected="selected">-Choose-</option>
</select>
<label style="display:none;" for="prop3_day" id="label_prop3_day">Day</label>
<select name="prop3_day" id="prop3_day" aria-labelledby="prop3 prop3_day" class="form-select w-20"><option value="" selected="selected">-Choose-</option>
</select>
<label style="display:none;" for="prop3_year" id="label_prop3_year">Year</label>
<select name="prop3_year" id="prop3_year" aria-labelledby="prop3 prop3_year" class="form-select w-20"><option value="" selected="selected">-Choose-</option>
</select>
<label style="display:none;" for="prop3_hour" id="label_prop3_hour">Hour</label>
<select name="prop3_hour" id="prop3_hour" aria-labelledby="prop3 prop3_hour" class="form-select w-20"><option value="" selected="selected">-Choose-</option>
</select> :
<label style="display:none;" for="prop3_minute" id="label_prop3_minute">Minute</label>
<select name="prop3_minute" id="prop3_minute" aria-labelledby="prop3 prop3_minute" class="form-select w-20"></select>
</div>
</div>
</div>
</fieldset> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
src/main/templates/scaffolding/edit.gsp
generates several wrappers
grails-app/views/_fields/default/_wrapper.gsp
A bootstrap friendly version would allow modified
<f:all />
:The text was updated successfully, but these errors were encountered: