0.0.76 add btn profile

This commit is contained in:
2023-08-09 13:41:56 +03:00
parent f8ed2b6fd2
commit a80ecaa473
4 changed files with 98 additions and 24 deletions

View File

@@ -633,22 +633,22 @@ input.deactive {
border-color: #b3d7ff; border-color: #b3d7ff;
} }
.custom-checkbox:focus+label::before { .custom-checkbox:hover+label::before {
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.12);
} }
.custom-checkbox:focus:not(:checked)+label::before {
border-color: #80bdff;
}
.custom-checkbox:checked+label::before { .custom-checkbox:checked+label::before {
border-color: #0b76ef;
background-color: #0b76ef; background-color:#FF613A;
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3e%3c/svg%3e"); box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.12);
} }
.custom-checkbox:disabled+label::before {
background-color: #e9ecef;
.custom-checkbox:disabled+label::before:hover {
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.12);
} }
section.login { section.login {
@@ -1139,17 +1139,51 @@ input#id_extra_phone
/* font-weight: 500;*/ /* font-weight: 500;*/
/* line-height: 22px;*/ /* line-height: 22px;*/
/*}*/ /*}*/
.checkbox_cargo_type{ /*.checkbox_cargo_type{*/
display: block; /* display: block;*/
/*flex-wrap: wrap;*/ /* !*flex-wrap: wrap;*!*/
/*}*/
/*.checkbox_cargo_type>div{*/
/* column-count: 2;*/
/* max-width: 330px;*/
/* width: 100%;*/
/* margin-bottom: 10px;*/
/*}*/
/*.checkbox_cargo_type>div>input{*/
/* display: block;*/
/*}*/
/*.checkbox_cargo_type>div>label{*/
/* display: block;*/
/*}*/
.real-checkbox{
} }
.checkbox_cargo_type>input{
display: block; .custom-checkbox-w{
display: inline-block;
width: 30px;
height: 30px;
/*background: white;*/
border-radius: 10px;
border: 1px solid #E6E6E6;
vertical-align: sub;
} }
.checkbox_cargo_type>label{
display: block; .custom-checkbox-w::before{
/*content: '';*/
background: #FF613A;
transition: 0.2s ease-in;
} }
.real-checkbox:checked + .custom-checkbox-w::before{
}
/*input#id_cargo_type{*/ /*input#id_cargo_type{*/
/* width: 50%;*/ /* width: 50%;*/
/*}*/ /*}*/

View File

@@ -1,8 +1,12 @@
function SendLoginForm(el){ function SendLoginForm(el){
event.preventDefault() event.preventDefault()
let form = el.form; let form = el.form;
let formData = new FormData(form); let formData = new FormData(form);
$.ajax({ $.ajax({
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() }, headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
url: '/ru/user_account/login/', url: '/ru/user_account/login/',
@@ -16,6 +20,13 @@ function SendLoginForm(el){
success: function(data){ success: function(data){
location.href = '/profile' location.href = '/profile'
// let profile_btn = document.createElement("a");
// profile_btn.classList.add("profile_button");
// profile_btn.innerText = "Профиль";
// let reg_btn = document.querySelector(".registration_button");
// let replace_btn = reg_btn.parentNode;
// replace_btn.replaceChild(profile_btn, reg_btn);
}, },
error: function (data, exception){ error: function (data, exception){
document.querySelector(".login").innerHTML = data.responseJSON.html document.querySelector(".login").innerHTML = data.responseJSON.html

View File

@@ -9,7 +9,29 @@
<div> <div>
<div><a href="#"><img src="/static/img/png/ru.png" alt=""></a></div> <div><a href="#"><img src="/static/img/png/ru.png" alt=""></a></div>
<div><img class="svg" src="/static/img/svg/Helpdesk_%20Icon.svg"><a href="#">Служба поддержки</a></div> <div><img class="svg" src="/static/img/svg/Helpdesk_%20Icon.svg"><a href="#">Служба поддержки</a></div>
<a href="{% url "registration_page" %}">Регистрация</a> {% if user.is_authenticated %}
<a href="{% url "login_profile" %}">Войти</a> <a
href="{% url "user_profile" %}">
Профиль
</a>
{% endif %}
{% if not user.is_authenticated %}
<a
class="registration_button"
href="{% url "registration_page" %}">
Регистрация
</a>
<a
class="enter_button"
href="{% url "login_profile" %}">
Войти
</a>
{% endif %}
</div> </div>
</header> </header>

View File

@@ -182,8 +182,11 @@
</div> </div>
<div class="checkbox_cargo_type"> <div class="checkbox_cargo_type">
{% for item in form.fields.cargo_type.choices %} {% for item in form.fields.cargo_type.choices %}
<input <div>
<input
class="custom-checkbox"
type="checkbox" type="checkbox"
name="cargo_type" name="cargo_type"
id="id_cargo_type_{{ forloop.counter }}" id="id_cargo_type_{{ forloop.counter }}"
@@ -191,12 +194,16 @@
value="{{ item.0 }}" value="{{ item.0 }}"
{% if form.initial.cargo_type == item.0 %} {% if form.initial.cargo_type == item.0 %}
checked="checked" checked="checked"
{% endif %}/> {% endif %}
<label for="id_cargo_type_{{ forloop.counter }}" > />
{{ item.1 }}
</label> <label for="id_cargo_type_{{ forloop.counter }}" >
{{ item.1 }}
</label>
</div>
{% endfor %} {% endfor %}
{# <lable for="">#} {# <lable for="">#}
{##} {##}
{# </lable>#} {# </lable>#}