From 0f3453af9b4656a087b92b1c5a4beb585c9e1c4b Mon Sep 17 00:00:00 2001 From: Thomas JUND Date: Thu, 4 Feb 2021 13:42:39 +0100 Subject: [PATCH] isere-cd38: add calendar booking template (#50311) --- static/isere-cd38/_custom.scss | 91 +++++ .../forms/widgets/select--ens-calendar.html | 316 ++++++++++++++++++ 2 files changed, 407 insertions(+) create mode 100644 templates/variants/isere-cd38/qommon/forms/widgets/select--ens-calendar.html diff --git a/static/isere-cd38/_custom.scss b/static/isere-cd38/_custom.scss index 544eed0f..33622dba 100644 --- a/static/isere-cd38/_custom.scss +++ b/static/isere-cd38/_custom.scss @@ -575,6 +575,97 @@ div#rub_service { } } +// ENS CALENDAR WIDGET +.ens-calendar { + $max-btn-size: 4rem; + display: flex; + max-width: $max-btn-size * 7; + position: relative; + + &, &--month { + .is-hidden { + display: none !important; + } + } + + table, thead, tbody { + display: block; + } + + &--month { + flex: 0 0 100%; + } + + &--head { + min-height: 3rem; + padding-left: 3rem; + padding-right: 3rem; + text-transform: uppercase; + font-weight: 600; + display: flex; + align-items: center; + justify-content: center; + } + + &--weekday { + text-transform: uppercase; + font-weight: 500; + } + + &--weekdays, + &--week { + display: flex; + } + &--weekday, + &--day { + flex: 1 1 0; + padding: 0.15rem; + } + div.gru-content &--day-btn { + margin: 0; + display: block; + width: 100%; + padding-left: 0; + padding-right: 0; + background-color: white; + border: 1px solid; + + &[data-status=open] { + color: green; + &:hover, &.on { + background-color: green; + color: white; + } + } + &[data-status=partially-open] { + color: #D66909; + &:hover, &.on { + background-color: #D66909; + color: white; + } + } + &[data-status=close] { + color: red; + background-color: white; + border: 1px solid; + &:hover, &.on { + background-color: red; + color: white; + } + } + } + div.gru-content &--next, div.gru-content &--prev { + position: absolute; + top: 0; + margin: 0; + } + &--next { + right: 0; + } + &--prev { + left: 0; + } +} // diff --git a/templates/variants/isere-cd38/qommon/forms/widgets/select--ens-calendar.html b/templates/variants/isere-cd38/qommon/forms/widgets/select--ens-calendar.html new file mode 100644 index 00000000..a1392fdd --- /dev/null +++ b/templates/variants/isere-cd38/qommon/forms/widgets/select--ens-calendar.html @@ -0,0 +1,316 @@ +{% extends "qommon/forms/widget.html" %} +{% load qommon i18n %} +{% block widget-control %} + + + + + +{% if request.quixote_request.is_in_backoffice %} + +{% endif %} +{% endblock %} + +{% block widget-hint %} +{% if widget.hint %}
{{widget.hint}}
{% endif %} +{% endblock %}