mirror of https://github.com/snachodog/mybuddy.git
Update child radio for BS5
This commit is contained in:
parent
44418b2906
commit
4e98d18448
|
@ -1,10 +1,7 @@
|
|||
{% load imagekit static %}
|
||||
|
||||
{% if widget.wrap_label %}
|
||||
<label{% if widget.attrs.id %} for="{{ widget.attrs.id }}"{% endif %} class="btn btn-outline-light btn-no-hover">
|
||||
{% endif %}
|
||||
{% include "django/forms/widgets/input.html" %}
|
||||
{% if widget.wrap_label %}
|
||||
<label{% if widget.attrs.id %} for="{{ widget.attrs.id }}"{% endif %} class="btn btn-outline-light btn-no-hover">
|
||||
{% include "core/child_thumbnail.html" with child=widget %}
|
||||
{{ widget.label }}</label>
|
||||
{% endif %}
|
||||
{{ widget.label }}
|
||||
</label>
|
||||
|
|
|
@ -87,6 +87,12 @@ class ChildRadioSelect(RadioSelect):
|
|||
input_type = "radio"
|
||||
template_name = "core/child_radio.html"
|
||||
option_template_name = "core/child_radio_option.html"
|
||||
attrs = {"class": "btn-check"}
|
||||
|
||||
def build_attrs(self, base_attrs, extra_attrs=None):
|
||||
attrs = super().build_attrs(base_attrs, extra_attrs)
|
||||
attrs["class"] += " btn-check"
|
||||
return attrs
|
||||
|
||||
def create_option(
|
||||
self, name, value, label, selected, index, subindex=None, attrs=None
|
||||
|
|
Loading…
Reference in New Issue