Skip to content

Commit e242f92

Browse files
authored
Fix checkboxes (#84)
The bootstrap 5 upgrade broke checkboxes styling this fixes that. Related to #82
1 parent 1596f52 commit e242f92

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

media/commitfest/css/commitfest.css

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,6 @@ div.form-group div.controls ul li label input {
3939
display: inline;
4040
vertical-align: middle;
4141
}
42-
div.form-group div.controls input[type="checkbox"] {
43-
width: 10px;
44-
height: unset;
45-
display: inline-block;
46-
}
47-
div.form-group div.controls > div.form-control:has(input[type="checkbox"]) {
48-
display: flex;
49-
gap: 8px;
50-
}
5142

5243
div.form-group div.controls input.threadpick-input {
5344
width: 80%;

pgcommitfest/commitfest/templates/base_form.html

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,21 @@
1515
{%for field in form%}
1616
{%if not field.is_hidden%}
1717
<div class="form-group">
18-
{{field|label_class:"control-label col-lg-1"}}
19-
<div class="col-lg-11 controls">
18+
{{field|label_class:"control-label"}}
19+
<div class="col-lg-12 controls">
2020
{%if field.errors %}
2121
{%for e in field.errors%}
2222
<div class="alert alert-danger">{{e}}</div>
2323
{%endfor%}
2424
{%endif%}
25-
{%if not field.name in form.selectize_fields%}{{field|field_class:"form-control"}}{%else%}{{field}}{%endif%}
25+
{%if field.name|slice:":7" == 'review_' %}
26+
{%for choice in field %}
27+
<div class="form-check form-check-inline">
28+
<input type="checkbox" class="form-check-input" name="{{field.name}}" value="{{choice.data.value}}" id="{{choice.id_for_label}}" {% if choice.data.selected %}checked{% endif %}>
29+
<label class="form-check-label" for="{{choice.id_for_label}}">{{choice.choice_label}}</label>
30+
</div>
31+
{%endfor%}
32+
{%elif not field.name in form.selectize_fields%}{{field|field_class:"form-control"}}{%else%}{{field}}{%endif%}
2633
{%if field.help_text%}<br/>{{field.help_text|safe}}{%endif%}</div>
2734
</div>
2835
{%else%}
@@ -31,7 +38,7 @@
3138
{%endfor%}
3239
<div class="form-group">
3340
<div class="col-lg-12">
34-
<div class="control"><input type="submit" class="btn btn-primary" value="{{savebutton|default:"Save"}}"></div>
41+
<input type="submit" class="btn btn-primary" value="{{savebutton|default:"Save"}}">
3542
</div>
3643
</div>
3744
</form>

0 commit comments

Comments
 (0)