Changed form-group to mb-3

* form-group is deprecated in bootstrap 5 and is replaced by utility classes.
This commit is contained in:
David Smith 2020-07-11 16:26:58 +01:00
parent 8492841ed3
commit 44c9d8f3c7
32 changed files with 35 additions and 35 deletions

View File

@ -1,7 +1,7 @@
{% load i18n %}
<h2>{% trans "Search" %}</h2>
<form class="form-inline">
<div class="form-group">
<div class="mb-3">
<div class="input-group">
<input type="text" class="form-control" style="width: 350px" name="{{ param }}" value="{{ term }}">
<span class="input-group-btn">

View File

@ -1,4 +1,4 @@
<div class="form-group horizontal-checkbox {% if field.errors %}has-error{% endif %}">
<div class="mb-3 horizontal-checkbox {% if field.errors %}has-error{% endif %}">
{% if field.label %}
<label class="col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}">
{{ field.label }}

View File

@ -1,6 +1,6 @@
{% load rest_framework %}
<div class="form-group">
<div class="mb-3">
{% if field.label %}
<label class="col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}">
{{ field.label }}

View File

@ -1,4 +1,4 @@
<div class="form-group">
<div class="mb-3">
{% if field.label %}
<label class="col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}">
{{ field.label }}

View File

@ -1,7 +1,7 @@
{% load rest_framework %}
<fieldset>
{% if field.label %}
<div class="form-group" style="border-bottom: 1px solid #e5e5e5">
<div class="mb-3" style="border-bottom: 1px solid #e5e5e5">
<legend class="control-label col-sm-2 {% if style.hide_label %}sr-only{% endif %}" style="border-bottom: 0">
{{ field.label }}
</legend>

View File

@ -1,4 +1,4 @@
<div class="form-group {% if field.errors %}has-error{% endif %}">
<div class="mb-3 {% if field.errors %}has-error{% endif %}">
{% if field.label %}
<label class="col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}">
{{ field.label }}

View File

@ -1,4 +1,4 @@
<div class="form-group">
<div class="mb-3">
{% if field.label %}
<label class="col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}">
{{ field.label }}

View File

@ -2,7 +2,7 @@
<fieldset>
{% if field.label %}
<div class="form-group" style="border-bottom: 1px solid #e5e5e5">
<div class="mb-3" style="border-bottom: 1px solid #e5e5e5">
<legend class="control-label col-sm-2 {% if style.hide_label %}sr-only{% endif %}" style="border-bottom: 0">
{{ field.label }}
</legend>

View File

@ -3,7 +3,7 @@
{% trans "None" as none_choice %}
<div class="form-group">
<div class="mb-3">
{% if field.label %}
<label class="col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}">
{{ field.label }}

View File

@ -1,6 +1,6 @@
{% load rest_framework %}
<div class="form-group">
<div class="mb-3">
{% if field.label %}
<label class="col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}">
{{ field.label }}

View File

@ -3,7 +3,7 @@
{% trans "No items to select." as no_items %}
<div class="form-group">
<div class="mb-3">
{% if field.label %}
<label class="col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}">
{{ field.label }}

View File

@ -1,4 +1,4 @@
<div class="form-group {% if field.errors %}has-error{% endif %}">
<div class="mb-3 {% if field.errors %}has-error{% endif %}">
{% if field.label %}
<label class="col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}">
{{ field.label }}

View File

@ -1,4 +1,4 @@
<div class="form-group {% if field.errors %}has-error{% endif %}">
<div class="mb-3 {% if field.errors %}has-error{% endif %}">
<div class="checkbox">
<label>
<input type="checkbox" name="{{ field.name }}" value="true" {% if field.value %}checked{% endif %}>

View File

@ -1,6 +1,6 @@
{% load rest_framework %}
<div class="form-group {% if field.errors %}has-error{% endif %}">
<div class="mb-3 {% if field.errors %}has-error{% endif %}">
{% if field.label %}
<label class="sr-only">{{ field.label }}</label>
{% endif %}

View File

@ -1,4 +1,4 @@
<div class="form-group">
<div class="mb-3">
{% if field.label %}
<label class="sr-only">
{{ field.label }}

View File

@ -1,4 +1,4 @@
<div class="form-group {% if field.errors %}has-error{% endif %}">
<div class="mb-3 {% if field.errors %}has-error{% endif %}">
{% if field.label %}
<label class="sr-only">
{{ field.label }}

View File

@ -1,4 +1,4 @@
<div class="form-group">
<div class="mb-3">
{% if field.label %}
<label class="sr-only">
{{ field.label }}

View File

@ -2,7 +2,7 @@
{% load rest_framework %}
{% trans "None" as none_choice %}
<div class="form-group {% if field.errors %}has-error{% endif %}">
<div class="mb-3 {% if field.errors %}has-error{% endif %}">
{% if field.label %}
<label class="sr-only">
{{ field.label }}

View File

@ -1,6 +1,6 @@
{% load rest_framework %}
<div class="form-group {% if field.errors %}has-error{% endif %}">
<div class="mb-3 {% if field.errors %}has-error{% endif %}">
{% if field.label %}
<label class="sr-only">
{{ field.label }}

View File

@ -2,7 +2,7 @@
{% load rest_framework %}
{% trans "No items to select." as no_items %}
<div class="form-group {% if field.errors %}has-error{% endif %}">
<div class="mb-3 {% if field.errors %}has-error{% endif %}">
{% if field.label %}
<label class="sr-only">
{{ field.label }}

View File

@ -1,4 +1,4 @@
<div class="form-group {% if field.errors %}has-error{% endif %}">
<div class="mb-3 {% if field.errors %}has-error{% endif %}">
{% if field.label %}
<label class="sr-only">
{{ field.label }}

View File

@ -19,7 +19,7 @@
<input type="hidden" name="next" value="{{ next }}" />
<div id="div_id_username" class="clearfix control-group {% if form.username.errors %}error{% endif %}">
<div class="form-group">
<div class="mb-3">
<label for="id_username">{{ form.username.label }}:</label>
<input type="text" name="username" maxlength="100"
autocapitalize="off"
@ -35,7 +35,7 @@
</div>
<div id="div_id_password" class="clearfix control-group {% if form.password.errors %}error{% endif %}">
<div class="form-group">
<div class="mb-3">
<label for="id_password">{{ form.password.label }}:</label>
<input type="password" name="password" maxlength="100" autocapitalize="off" autocorrect="off" class="form-control textinput textInput" id="id_password" required>
{% if form.password.errors %}

View File

@ -1,4 +1,4 @@
<div class="form-group {% if field.errors %}has-error{% endif %}">
<div class="mb-3 {% if field.errors %}has-error{% endif %}">
<div class="checkbox">
<label>
<input type="checkbox" name="{{ field.name }}" value="true" {% if field.value %}checked{% endif %}>

View File

@ -1,6 +1,6 @@
{% load rest_framework %}
<div class="form-group {% if field.errors %}has-error{% endif %}">
<div class="mb-3 {% if field.errors %}has-error{% endif %}">
{% if field.label %}
<label {% if style.hide_label %}class="sr-only"{% endif %}>{{ field.label }}</label>
{% endif %}

View File

@ -1,4 +1,4 @@
<div class="form-group">
<div class="mb-3">
{% if field.label %}
<label {% if style.hide_label %}class="sr-only"{% endif %}>{{ field.label }}</label>
{% endif %}

View File

@ -1,4 +1,4 @@
<div class="form-group {% if field.errors %}has-error{% endif %}">
<div class="mb-3 {% if field.errors %}has-error{% endif %}">
{% if field.label %}
<label {% if style.hide_label %}class="sr-only"{% endif %}>{{ field.label }}</label>
{% endif %}

View File

@ -1,4 +1,4 @@
<div class="form-group">
<div class="mb-3">
{% if field.label %}
<label {% if style.hide_label %}class="sr-only"{% endif %}>{{ field.label }}</label>
{% endif %}

View File

@ -2,7 +2,7 @@
{% load rest_framework %}
{% trans "None" as none_choice %}
<div class="form-group {% if field.errors %}has-error{% endif %}">
<div class="mb-3 {% if field.errors %}has-error{% endif %}">
{% if field.label %}
<label {% if style.hide_label %}class="sr-only"{% endif %}>
{{ field.label }}

View File

@ -1,6 +1,6 @@
{% load rest_framework %}
<div class="form-group {% if field.errors %}has-error{% endif %}">
<div class="mb-3 {% if field.errors %}has-error{% endif %}">
{% if field.label %}
<label {% if style.hide_label %}class="sr-only"{% endif %}>
{{ field.label }}

View File

@ -2,7 +2,7 @@
{% load rest_framework %}
{% trans "No items to select." as no_items %}
<div class="form-group {% if field.errors %}has-error{% endif %}">
<div class="mb-3 {% if field.errors %}has-error{% endif %}">
{% if field.label %}
<label {% if style.hide_label %}class="sr-only"{% endif %}>
{{ field.label }}

View File

@ -1,4 +1,4 @@
<div class="form-group {% if field.errors %}has-error{% endif %}">
<div class="mb-3 {% if field.errors %}has-error{% endif %}">
{% if field.label %}
<label {% if style.hide_label %}class="sr-only"{% endif %}>
{{ field.label }}

View File

@ -78,7 +78,7 @@ class TestSimpleBoundField:
renderer = HTMLFormRenderer()
rendered = renderer.render_field(serializer['bool_field'], {})
expected_packed = (
'<divclass="form-group">'
'<divclass="mb-3">'
'<divclass="checkbox">'
'<label>'
'<inputtype="checkbox"name="bool_field"value="true"checked>'
@ -170,12 +170,12 @@ class TestNestedBoundField:
'<legend>Nested2</legend>'
'<fieldset>'
'<legend>Nested1</legend>'
'<divclass="form-group">'
'<divclass="mb-3">'
'<label>Textfield</label>'
'<inputname="nested2.nested1.text_field"class="form-control"type="text"value="">'
'</div>'
'</fieldset>'
'<divclass="form-group">'
'<divclass="mb-3">'
'<label>Textfield</label>'
'<inputname="nested2.text_field"class="form-control"type="text"value="test">'
'</div>'