Skip to content

Commit

Permalink
vertical align checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
jasony123123 committed Dec 19, 2020
1 parent 3b8fcca commit cfe8872
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 18 deletions.
2 changes: 1 addition & 1 deletion main/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class Meta:
choices=STATES, attrs={"class": "form-control"}
),
"require_user_addresses": forms.CheckboxInput(
attrs={"class": "custom-control-inline form-control"}
attrs={"class": "form-check-input"}
),
}

Expand Down
42 changes: 25 additions & 17 deletions main/templates/main/dashboard/drives/create.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,31 @@
<h5 class="card-title text-center">
Create a Drive
</h5>
<form role="form" id="CreateDrive" method="post">{% csrf_token %}

<div class="form-group">
{% for field in form %}
<div class="fieldWrapper">
{{ field.errors }}
{{ field.label_tag }}{{ field }}
{% if field.help_text %}
<p class="help">{{ field.help_text|safe }}</p>
{% endif %}
</div>
{% endfor %}
</div>
<div style="display: inline-block;">
<button id="save" form="CreateDrive" type="submit" class="btn btn-primary" value="Submit">Submit</button>
</div>
</form>
<form role="form" id="CreateDrive" method="post">
{% csrf_token %}
<div class="form-group">
{% for field in form %}
<div class="fieldWrapper">
{% if "require_user_addresses" in field.label_tag %}
<div class="form-check form-check-inline">
{{ field.label_tag }}
{{ field }}
</div>
{% else %}
{{ field.errors }}
{{ field.label_tag }}
{{ field }}
{% if field.help_text %}
<p class="help">{{ field.help_text|safe }}</p>
{% endif %}
{% endif %}
</div>
{% endfor %}
</div>
<div style="display: inline-block;">
<button id="save" form="CreateDrive" type="submit" class="btn btn-primary" value="Submit">Submit</button>
</div>
</form>
{% endif %}
{% if not verified %}
<h5 class="card-title text-center">
Expand Down

0 comments on commit cfe8872

Please sign in to comment.