manager: add styles for weekdays buttons group (#50560)

This commit is contained in:
Thomas Jund 2021-04-29 11:24:05 +02:00 committed by Valentin Deniaud
parent 6372afc4a5
commit da6055a90d
2 changed files with 32 additions and 1 deletions

View File

@ -446,3 +446,34 @@ $booking-colors: (
form div.widget[id^=id_recurrence] {
padding-left: 1em;
}
// weekdays buttons group
// display weeks checkboxs to buttons group
.weekdays-buttons-group {
display: table;
border-collapse: collapse;
font-size: 1.2em;
margin: 0.2em 0px;
overflow: hidden;
input {
display: none;
}
label {
display: table-cell;
border: 1px solid #386ede;
padding: 0.33em 0.66em;
color: #386ede;
cursor: pointer;
font-weight: 500;
line-height: 1;
&:hover {
background-color: #eee;
}
}
input:checked + label {
background-color: #386ede;
color: white;
border-color: #386ede white;
}
}

View File

@ -1,5 +1,5 @@
{% spaceless %}
<span id="{{ widget.attrs.id }}" class="inputs-buttons-group{% if widget.attrs.class %} {{ widget.attrs.class }}{% endif %}">
<span id="{{ widget.attrs.id }}" class="weekdays-buttons-group{% if widget.attrs.class %} {{ widget.attrs.class }}{% endif %}" role="group">
{% for group, options, index in widget.optgroups %}
{% for option in options %}
{% include "django/forms/widgets/input.html" with widget=option %}