From 3f1cd5431f1e9b7769589c39f4dbba2231cb35bd Mon Sep 17 00:00:00 2001 From: ArtemB Date: Fri, 24 Nov 2023 19:35:11 +0300 Subject: [PATCH] 0.0.258 small_upd for articles --- static/css/styles.css | 12 ++++-- static/js/user_profile.js | 46 +++++++++++------------ templates/blocks/profile/b_new_route.html | 4 +- templates/pages/p_article.html | 4 +- 4 files changed, 37 insertions(+), 29 deletions(-) diff --git a/static/css/styles.css b/static/css/styles.css index 1a9e460..c859a25 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -1571,6 +1571,8 @@ form.new_route>.button_register>#registration{ } + + div.departure_arrival>div>input{ display: block; border-radius: 15px; @@ -2167,6 +2169,10 @@ button#more_button{ margin-top: 15px; } +figure{ + text-align: center; +} + .bottom_block_static{ padding: 40px 40px 0px 40px; position: relative; @@ -2185,7 +2191,7 @@ button#more_button{ .bottom_block_static>form>.inputs_l{ margin: auto; padding: 0px 10px 10px 10px; - width: 30%; + width: 40%; } .bottom_block_static>form>.button_register{ margin: auto; @@ -2705,7 +2711,7 @@ details[open] summary ~ *{ } .news_item { - width: 48%; + width: 32%; margin-bottom: 2%; background-color: white; filter: drop-shadow(-1px 4px 10px rgba(198, 199, 203, 0.20)) drop-shadow(0px -1px 10px rgba(198, 199, 203, 0.20)); @@ -2880,7 +2886,7 @@ details[open] summary ~ *{ .previous_next_news{ display: flex; - justify-content: space-between; + /*justify-content: space-between;*/ margin-top: 30px; } diff --git a/static/js/user_profile.js b/static/js/user_profile.js index b82b868..eab4757 100644 --- a/static/js/user_profile.js +++ b/static/js/user_profile.js @@ -765,29 +765,29 @@ function showLang(el) { // // } -// function checkDate() { -// let dateDeparture = document.getElementById('id_departure_DT'); -// let dateArrival = document.getElementById('id_arrival_DT'); -// let DateStart = new Date(dateDeparture.value); -// let DateEnd = new Date(dateArrival.value); -// if (DateEnd < DateStart) { -// -// // alert("End date cannot be less than Start date."); -// dateArrival.value = "" -// -// let arrivalDiv = document.getElementById('arrival_div') -// let errorMessage = document.createElement('span'); -// errorMessage.textContent = "Дата прибытия, не может быть установлена раньше даты отправки" -// errorMessage.classList.add('errorlist') -// arrivalDiv.appendChild(errorMessage); -// } -// else if (DateEnd > DateStart){ -// let arrivalDiv = document.getElementById('arrival_div'); -// let errorMessage = document.querySelector('.errorlist'); -// arrivalDiv.removeChild((errorMessage)) -// } -// -// } +function checkDate() { + let dateDeparture = document.getElementById('id_departure_DT'); + let dateArrival = document.getElementById('id_arrival_DT'); + let DateStart = new Date(dateDeparture.value); + let DateEnd = new Date(dateArrival.value); + if (DateEnd < DateStart) { + + // alert("End date cannot be less than Start date."); + dateArrival.value = "" + + let arrivalDiv = document.getElementById('arrival_div') + let errorMessage = document.createElement('span'); + errorMessage.textContent = "Дата прибытия, не может быть установлена раньше даты отправки" + errorMessage.classList.add('errorlist') + arrivalDiv.appendChild(errorMessage); + } + else if (DateEnd > DateStart){ + let arrivalDiv = document.getElementById('arrival_div'); + let errorMessage = document.querySelector('.errorlist'); + arrivalDiv.removeChild((errorMessage)) + } + +} function RequestCommercialOffer (el){ diff --git a/templates/blocks/profile/b_new_route.html b/templates/blocks/profile/b_new_route.html index ce6d457..e1aee3e 100644 --- a/templates/blocks/profile/b_new_route.html +++ b/templates/blocks/profile/b_new_route.html @@ -75,7 +75,7 @@ {# {% if form.initial.departure_DT %}value="{{ form.initial.departure_DT.date|date:"Y-m-d" }}T{{ form.initial.departure_DT.time|date:"H:i" }}"{% endif %}#} {# />#} {# boris change input #} - +
{% if not errors_off and form.errors and form.errors.departure_DT %} @@ -96,7 +96,7 @@ {# {% if form.initial.arrival_DT %}value="{{ form.initial.arrival_DT.date|date:"Y-m-d" }}T{{ form.initial.arrival_DT.time|date:"H:i" }}"{% endif %}#} {# />#} {# boris change input #} - +
{# end #} diff --git a/templates/pages/p_article.html b/templates/pages/p_article.html index 428bc75..30fa6d1 100644 --- a/templates/pages/p_article.html +++ b/templates/pages/p_article.html @@ -1,5 +1,7 @@ {% extends "tb_base.html" %} +{% load i18n %} + {% block content %}