diff --git a/static/css/styles.css b/static/css/styles.css index fb973b5..5588f1e 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -98,25 +98,42 @@ html, body{ /*Стилизация radio button */ .form_radio_btn { - display: inline-block; - margin-right: 10px; + width: 375px; + border-radius: 14px; + background: #FFF; + display: flex; + height: 70px; + align-items: center; + margin-bottom: 40px; } .form_radio_btn input[type=radio] { display: none; } .form_radio_btn label { - display: inline-block; - cursor: pointer; - padding: 0px 15px; - line-height: 34px; - border: 1px solid #999; - border-radius: 6px; - user-select: none; + text-decoration: none; + color: black; + /* Body text 1 */ + font-family: Inter; + font-size: 16px; + font-style: normal; + font-weight: 500; + line-height: 22px; + border-radius: 10px; + display: flex; + width: 169px; + height: 44px; + padding: 8px 16px; + justify-content: center; + align-items: center; + gap: 8px; + flex-shrink: 0; + margin: 0px 3px; } /* Checked */ .form_radio_btn input[type=radio]:checked + label { - background: #ffe0a6; + background: #FF613A; + color: white; } /* Hover */ @@ -512,13 +529,12 @@ section.register>form { background: #FFF; display: flex; height: 70px; - align-items: center; margin-bottom: 40px; } -a.active { +input.active { text-decoration: none; color: #FFF; /* Body text 1 */ @@ -540,7 +556,7 @@ a.active { margin: 0px 3px; } -a.deadctive { +input.deactive { text-decoration: none; display: flex; width: 100%; @@ -631,7 +647,7 @@ section.login>h1 { margin-bottom: 40px; } -section.login>div { +section.login>form { width: 420px; margin: auto; text-align: center; @@ -651,7 +667,7 @@ section.login>div { padding-left: 10px; } -section.login>div>div:nth-child(4) { +section.login>form>div>div:nth-child(4) { color: rgba(39, 36, 36, 0.60); text-align: center; /* Body text 3 */ @@ -663,7 +679,7 @@ section.login>div>div:nth-child(4) { margin-top: 20px; } -section.login>div>div:nth-child(5) { +section.login>form>div>div:nth-child(5) { color: #272424; text-align: center; /* Heading 5 */ @@ -689,7 +705,7 @@ section.login>div>div:nth-child(5) { margin-bottom: 20px; } -section.login>div>div:nth-child(7) { +section.login>form>div>div:nth-child(7) { color: rgba(39, 36, 36, 0.60); /* Body text 1 */ font-family: Inter; @@ -699,7 +715,7 @@ section.login>div>div:nth-child(7) { line-height: 22px; } -section.login>div>div:nth-child(7)>a { +section.login>form>div>div:nth-child(7)>a { text-decoration: none; color: rgba(39, 36, 36, 0.60); } diff --git a/static/js/authorization.js b/static/js/authorization.js new file mode 100644 index 0000000..70c8b05 --- /dev/null +++ b/static/js/authorization.js @@ -0,0 +1,25 @@ +function SendLoginForm(el){ + event.preventDefault() + let form = el.form; + let formData = new FormData(form); + + $.ajax({ + headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() }, + url: '/ru/user_account/login/', + type: "POST", + // async: true, + cache: false, + processData: false, + contentType: false, + // enctype: 'json', + data: formData, + success: function(data){ + + location.href = '/profile' + }, + error: function (data, exception){ + document.querySelector(".login").innerHTML = data.responseJSON.html + } + }); +} + diff --git a/static/js/registration.js b/static/js/registration.js index 7367229..e4d731d 100644 --- a/static/js/registration.js +++ b/static/js/registration.js @@ -15,7 +15,7 @@ function SendRegistrationForm(el){ data: formData, success: function(data){ - // location.href = '/' + location.href = '/profile' }, error: function (data, exception){ document.querySelector(".register").innerHTML = data.responseJSON.html diff --git a/templates/blocks/b_login.html b/templates/blocks/b_login.html deleted file mode 100644 index a85bdf0..0000000 --- a/templates/blocks/b_login.html +++ /dev/null @@ -1,18 +0,0 @@ -
-

Войдите в профиль

-
-
- -
-
- -
-
-
Авторизуясь, вы соглашаетесь с Лицензионным соглашением Политикой конфиденциальности
-
Или
-
-
Войти через Google
-
-
Нет аккаунта? Зарегистрируйтесь
-
-
\ No newline at end of file diff --git a/templates/forms/f_login.html b/templates/forms/f_login.html new file mode 100644 index 0000000..f187c1b --- /dev/null +++ b/templates/forms/f_login.html @@ -0,0 +1,27 @@ +
+

Войдите в профиль

+
+ {% csrf_token %} +
+
+ + {% if form.username and form.errors.username %} + {{ form.errors.username }} + {% endif %} +
+
+ + {% if form.password and form.errors.password %} + {{ form.errors.password }} + {% endif %} +
+
+
Авторизуясь, вы соглашаетесь с Лицензионным соглашением Политикой конфиденциальности
+
Или
+
+
Войти через Google
+
+
Нет аккаунта? Зарегистрируйтесь
+
+
> +
\ No newline at end of file diff --git a/templates/forms/f_registration.html b/templates/forms/f_registration.html index c45c9de..01f2837 100644 --- a/templates/forms/f_registration.html +++ b/templates/forms/f_registration.html @@ -4,10 +4,22 @@
{% csrf_token %} -
-
Перевозчик
-
Отправитель
-
+{#
#} +{#
Перевозчик
#} +{#
Отправитель
#} +{#
#} +
+
+ + + +
+
+ + +
+
+
@@ -40,8 +52,11 @@ {% endif %}
- - + + + {% if form.errors and form.errors.agreement %} + {{ form.errors.agreement }} + {% endif %}
Регистрируясь, я соглашаюсь с Лицензионным соглашениеми и Политикой конфиденциальности
diff --git a/templates/inter/meta.html b/templates/inter/meta.html index ae83d63..29bc119 100644 --- a/templates/inter/meta.html +++ b/templates/inter/meta.html @@ -1,4 +1,5 @@ {% load static %} + \ No newline at end of file diff --git a/templates/pages/p_main.html b/templates/pages/p_main.html index b2a0542..ad14e2a 100644 --- a/templates/pages/p_main.html +++ b/templates/pages/p_main.html @@ -8,7 +8,6 @@
{% include 'blocks/b_header.html' %} - {% include 'blocks/b_login.html' %} {% include 'blocks/b_footer.html' %}
diff --git a/templates/pages/profile/p_login.html b/templates/pages/profile/p_login.html index b2a0542..fd24ee1 100644 --- a/templates/pages/profile/p_login.html +++ b/templates/pages/profile/p_login.html @@ -8,7 +8,7 @@
{% include 'blocks/b_header.html' %} - {% include 'blocks/b_login.html' %} + {% include 'forms/f_login.html' %} {% include 'blocks/b_footer.html' %}