diff --git a/static/v2/css/blocks/b_search_routes.css b/static/v2/css/blocks/b_search_routes.css new file mode 100644 index 0000000..ed8ac11 --- /dev/null +++ b/static/v2/css/blocks/b_search_routes.css @@ -0,0 +1,27 @@ +.b_search_routes { + + --button-font-size: 18px; + form{ + display: grid; + grid-template-columns: repeat(3, calc(33.3% - 72px)) 215px; + align-items: end; + gap: 5px; + [data-type="location"] { + &:first-of-type{ + .w_select_country_header{--select-border-radius: 10px 0 0 10px!important;} + } + .w_select_country_header{--select-border-radius: 0!important;} + } + .w_daterangepicker{ + --range-picker-border-radius: 0 10px 10px 0!important; + } + } + button{ + padding: 17px 0; + background: #FF613A; + font-size: var(--button-font-size); + font-weight: 600; + margin: 0; + height: calc(100% - 27px); + } +} \ No newline at end of file diff --git a/static/v2/js/widgets/w_daterangepicker.js b/static/v2/js/widgets/w_daterangepicker.js index 7824c00..09c181f 100644 --- a/static/v2/js/widgets/w_daterangepicker.js +++ b/static/v2/js/widgets/w_daterangepicker.js @@ -44,7 +44,7 @@ function daterangepickerInit(el, callback, date) { $($datarangepicker).daterangepicker({ "autoapply": true, "linkedCalendars": false, - "singleDatePicker": true, + "singleDatePicker": !!el.dataset.range, "timePicker": false, "timePicker24Hour": false, "minDate": moment(date), @@ -57,6 +57,7 @@ function daterangepickerInit(el, callback, date) { if (last_opened_daterangepicker) $parent = last_opened_daterangepicker.closest('.w_daterangepicker'); let $input = $parent.querySelector(".date_range_input_cont input") $input.value = start.format('DD.MM.YYYY'); + if (end) $input.value = `${start.format('DD.MM.YYYY')} - ${end.format('DD.MM.YYYY')}` resetFieldError(el); if (callback) callback(el) }); @@ -68,3 +69,6 @@ function clickOnDateIconE(el){ $input.focus() } +$(document).ready(function () { + datarangepickerinitAll() +}) diff --git a/templates/tb_base.html b/templates/tb_base.html index 2aecbe2..a0eb2e0 100644 --- a/templates/tb_base.html +++ b/templates/tb_base.html @@ -201,16 +201,16 @@ function gtag_report_conversion(url) { {% if page_type == 'routes' %}