1.1.6 upd raise and highlight function in my_routes
This commit is contained in:
@@ -367,7 +367,7 @@
|
|||||||
|
|
||||||
|
|
||||||
.info_profile>div>div>.left-part-carrier-card>.container_inf_about_moving{
|
.info_profile>div>div>.left-part-carrier-card>.container_inf_about_moving{
|
||||||
width: 100%;
|
width: 98%;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -730,7 +730,7 @@
|
|||||||
margin-bottom: 25px;
|
margin-bottom: 25px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ч
|
||||||
.arrange_subscribe{
|
.arrange_subscribe{
|
||||||
margin: 20px auto 20px auto;
|
margin: 20px auto 20px auto;
|
||||||
}
|
}
|
||||||
@@ -1114,9 +1114,12 @@
|
|||||||
.left-part-carrier-card, .inf_carrier_container{
|
.left-part-carrier-card, .inf_carrier_container{
|
||||||
width: unset;
|
width: unset;
|
||||||
float: none;
|
float: none;
|
||||||
padding: 1px 15px;
|
padding: 1px 20px;
|
||||||
border-right: unset;
|
border-right: unset;
|
||||||
}
|
}
|
||||||
|
.control_frame{
|
||||||
|
top: 3px;
|
||||||
|
}
|
||||||
.inf_carrier_container{
|
.inf_carrier_container{
|
||||||
padding-top: 70px;
|
padding-top: 70px;
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
@@ -1194,7 +1197,7 @@
|
|||||||
.from-to-city-text{
|
.from-to-city-text{
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
padding-bottom: 10px;
|
/*padding-bottom: 10px;*/
|
||||||
/*padding-top: unset;*/
|
/*padding-top: unset;*/
|
||||||
}
|
}
|
||||||
.arrow_inf_about_moving{
|
.arrow_inf_about_moving{
|
||||||
@@ -1836,6 +1839,10 @@
|
|||||||
/*.from_address_point_txt.find_route.first {*/
|
/*.from_address_point_txt.find_route.first {*/
|
||||||
/* width: 52.1%;*/
|
/* width: 52.1%;*/
|
||||||
/*}*/
|
/*}*/
|
||||||
|
.info_profile>div>div>.left-part-carrier-card>.container_inf_about_moving{
|
||||||
|
width: 98%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.container_inf_about_moving {
|
.container_inf_about_moving {
|
||||||
width: 97%;
|
width: 97%;
|
||||||
@@ -1876,6 +1883,10 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.info_profile>div>div>.left-part-carrier-card>.container_inf_about_moving{
|
||||||
|
width: 89%;
|
||||||
|
}
|
||||||
|
|
||||||
.phones_carrier{
|
.phones_carrier{
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
@@ -1901,6 +1912,7 @@
|
|||||||
|
|
||||||
.container_inf_about_moving{
|
.container_inf_about_moving{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
padding: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.arrow_inf_about_moving{
|
.arrow_inf_about_moving{
|
||||||
|
|||||||
@@ -1562,6 +1562,7 @@ a.open_inf_carrier{
|
|||||||
width: 33%;
|
width: 33%;
|
||||||
float: right;
|
float: right;
|
||||||
padding: 2%;
|
padding: 2%;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title_container_inf_carrier{
|
.title_container_inf_carrier{
|
||||||
|
|||||||
@@ -697,12 +697,13 @@ header .header-second {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
width: 272px;
|
|
||||||
height: 175px;
|
|
||||||
box-shadow: -1px 4px 10px 0px rgba(198, 199, 203, 0.20), 0px -1px 10px 0px rgba(198, 199, 203, 0.20);
|
box-shadow: -1px 4px 10px 0px rgba(198, 199, 203, 0.20), 0px -1px 10px 0px rgba(198, 199, 203, 0.20);
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
border: 1px solid #FF613A;
|
border: 1px solid #FF613A;
|
||||||
padding: 0 10px;
|
padding: 0 10px;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
margin: 0 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.control_frame.show{
|
.control_frame.show{
|
||||||
@@ -726,6 +727,28 @@ button#send_upgrade:hover {
|
|||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.success_rising{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.success_rising.show{
|
||||||
|
display: block;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.success_rising_text{
|
||||||
|
text-align: center;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
}
|
||||||
|
.close_success_rising{
|
||||||
|
cursor: pointer;
|
||||||
|
width: 100%;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upd_form.hide{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.from_address_point_txt.red_text{
|
.from_address_point_txt.red_text{
|
||||||
color: #ff0000;
|
color: #ff0000;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -616,6 +616,7 @@ function confirmUpgrade(el, routeID){
|
|||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
el.disabled = true
|
el.disabled = true
|
||||||
|
|
||||||
|
|
||||||
// let remainsRisingCount = parseInt(document.getElementById('remains_route_rising_count').innerText);
|
// let remainsRisingCount = parseInt(document.getElementById('remains_route_rising_count').innerText);
|
||||||
// let remainsHighlightCount = parseInt(document.getElementById('remains_route_highlight_count').innerText);
|
// let remainsHighlightCount = parseInt(document.getElementById('remains_route_highlight_count').innerText);
|
||||||
|
|
||||||
@@ -652,38 +653,13 @@ function confirmUpgrade(el, routeID){
|
|||||||
data: formData,
|
data: formData,
|
||||||
success: function(data){
|
success: function(data){
|
||||||
|
|
||||||
// $('#remains_route_rising_count').append(data.remains_route_rising_count)
|
el.disabled = false
|
||||||
// $('#remains_route_highlight_count').append(data.remains_route_highlight_count)
|
|
||||||
|
|
||||||
// if(url === '/routes/raise_route/' && remainsRisingCount > 0 ){
|
if (url ==='/routes/raise_route/' && data.status){
|
||||||
// remainsRisingCount -= 1;
|
// document.getElementById('upd_form_' + routeID).classList.toggle('hide')
|
||||||
// } else if(url === '/routes/highlight_route/' && remainsHighlightCount > 0){
|
// document.getElementById('success_rising_'+ routeID).classList.toggle('show')
|
||||||
// remainsHighlightCount -= 1;
|
showControlFrame(el, routeID, data.status)
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
|
||||||
// for (let i = 0; i < checkboxes.length; i++) {
|
|
||||||
//
|
|
||||||
// if (checkboxes[i].checked && remainsRisingCount > 0 ) {
|
|
||||||
// remainsRisingCount -= 1;
|
|
||||||
// }else if(checkboxes[i].checked && remainsHighlightCount > 0){
|
|
||||||
// remainsHighlightCount -= 1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// document.getElementById('remains_route_rising_count').outerHTML = data.remains_route_rising_count.toString();
|
|
||||||
// document.getElementById('remains_route_highlight_count').outerHTML = data.remains_route_highlight_count.toString();
|
|
||||||
|
|
||||||
|
|
||||||
// location.href = '/profile'
|
|
||||||
|
|
||||||
// if(!data.status){
|
|
||||||
// document.querySelector('[data-number-of-route="' + routeID + '"]').innerHTML = data.html
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
let data_route_id = data.route_id
|
let data_route_id = data.route_id
|
||||||
@@ -691,26 +667,27 @@ function confirmUpgrade(el, routeID){
|
|||||||
if (routeID){
|
if (routeID){
|
||||||
el_route = document.querySelector(`[data-number-of-route="${routeID}"]`);
|
el_route = document.querySelector(`[data-number-of-route="${routeID}"]`);
|
||||||
}
|
}
|
||||||
el_route.scrollIntoView({
|
// el_route.scrollIntoView({
|
||||||
behavior:"smooth",
|
// behavior:"smooth",
|
||||||
block:'start',
|
// block:'start',
|
||||||
inline:'start'
|
// inline:'start'
|
||||||
});
|
// });
|
||||||
|
|
||||||
let editButton = document.getElementById('edit_route_' + routeID)
|
let editButton = document.getElementById('edit_route_' + routeID)
|
||||||
|
|
||||||
if(url === '/routes/highlight_route/'){
|
if(url === '/routes/highlight_route/'){
|
||||||
el_route.classList.add('highlight-color');
|
el_route.classList.add('highlight-color');
|
||||||
editButton.classList.add('highlight-color')
|
editButton.classList.add('highlight-color')
|
||||||
|
document.getElementById('control_frame_' + routeID).classList.remove('show')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for (let i = 0; i < remainsRisingCount.length; i++){
|
for (let i = 0; i < remainsRisingCount.length; i++){
|
||||||
remainsRisingCount[i].outerHTML = data.remains_route_rising_count.toString();
|
remainsRisingCount[i].innerText = data.remains_route_rising_count.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < remainsHighlightCount.length; i++){
|
for (let i = 0; i < remainsHighlightCount.length; i++){
|
||||||
remainsHighlightCount[i].outerHTML = data.remains_route_highlight_count.toString();
|
remainsHighlightCount[i].innerText = data.remains_route_highlight_count.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -732,6 +709,7 @@ function confirmUpgrade(el, routeID){
|
|||||||
|
|
||||||
},
|
},
|
||||||
error: function (data, exception){
|
error: function (data, exception){
|
||||||
|
el.disabled = false
|
||||||
document.querySelector(".info_profile").innerHTML = data.responseJSON.html;
|
document.querySelector(".info_profile").innerHTML = data.responseJSON.html;
|
||||||
// $(el).attr('disabled', 'false')
|
// $(el).attr('disabled', 'false')
|
||||||
|
|
||||||
@@ -973,13 +951,23 @@ function showMenu(el, event) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showControlFrame(el, route_id){
|
function showControlFrame(el, route_id, raise_status){
|
||||||
let menu = document.getElementById('control_frame_'+ route_id );
|
let menu = document.getElementById('control_frame_'+ route_id );
|
||||||
|
|
||||||
if(menu.classList.contains('show')){
|
if(menu.classList.contains('show') && raise_status === 'ok'){
|
||||||
menu.classList.remove('show')
|
document.getElementById('upd_form_' + route_id).classList.toggle('hide')
|
||||||
} else {
|
document.getElementById('success_rising_'+ route_id).classList.toggle('show')
|
||||||
menu.classList.add('show')
|
if(el.classList.contains('close_success_rising')){
|
||||||
|
menu.classList.remove('show')
|
||||||
|
}
|
||||||
|
} else if(menu.classList.contains('show') && el.id === 'raise_route' || el.classList.contains('close_success_rising')) {
|
||||||
|
menu.classList.remove('show')
|
||||||
|
if(el.classList.contains('close_success_rising')){
|
||||||
|
document.getElementById('upd_form_' + route_id).classList.toggle('hide')
|
||||||
|
document.getElementById('success_rising_'+ route_id).classList.toggle('show')
|
||||||
|
}
|
||||||
|
} else{
|
||||||
|
menu.classList.add('show')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,14 @@
|
|||||||
class="control_frame"
|
class="control_frame"
|
||||||
id="control_frame_{{ route.id }}"
|
id="control_frame_{{ route.id }}"
|
||||||
>
|
>
|
||||||
<form method="post">
|
<div class="success_rising" id="success_rising_{{ route.id }}">
|
||||||
|
<div class="success_rising_text">
|
||||||
|
{% trans "Объявление поднято!" %}
|
||||||
|
</div>
|
||||||
|
<button class="close_success_rising" onclick="showControlFrame(this, {{ route.id }})">{% trans "Закрыть" %}</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form class="upd_form" id="upd_form_{{ route.id }}" method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|
||||||
<div class="checkbox_wrapper">
|
<div class="checkbox_wrapper">
|
||||||
@@ -62,19 +69,24 @@
|
|||||||
name="route_option"
|
name="route_option"
|
||||||
data-routeid="{{ route.id }}"
|
data-routeid="{{ route.id }}"
|
||||||
class="custom-checkbox round"
|
class="custom-checkbox round"
|
||||||
|
{% if remains_route_rising_count == 0%}
|
||||||
|
disabled
|
||||||
|
{% endif %}
|
||||||
id="raise_route_{{ route.id }}">
|
id="raise_route_{{ route.id }}">
|
||||||
<label for="raise_route_{{ route.id }}" class="route_label">
|
<label for="raise_route_{{ route.id }}" class="route_label">
|
||||||
<div class="label_text">{% trans "Поднять объявление" %}</div>
|
<div class="label_text">{% trans "Поднять объявление" %}</div>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="sub_label_text">{% trans "Осталось поднятий " %} <span id="remains_route_rising_count">{% if form.data.remains_route_rising_count %}{{ form.data.remains_route_rising_count }}{% else %}{{ remains_route_rising_count }}{% endif %}</span></div>
|
<div class="sub_label_text">{% trans "Осталось поднятий " %} <span id="remains_route_rising_count">{{ remains_route_rising_count }}</span></div>
|
||||||
|
|
||||||
<div class="checkbox_wrapper">
|
<div class="checkbox_wrapper">
|
||||||
<input type="radio"
|
<input type="radio"
|
||||||
name="route_option"
|
name="route_option"
|
||||||
data-routeid="{{ route.id }}"
|
data-routeid="{{ route.id }}"
|
||||||
class="custom-checkbox round"
|
class="custom-checkbox round"
|
||||||
|
{% if remains_route_highlight_count == 0%}
|
||||||
|
disabled
|
||||||
|
{% endif %}
|
||||||
{# checked="checked"#}
|
{# checked="checked"#}
|
||||||
id="highlight_route_{{ route.id }}">
|
id="highlight_route_{{ route.id }}">
|
||||||
<label for="highlight_route_{{ route.id }}" class="route_label">
|
<label for="highlight_route_{{ route.id }}" class="route_label">
|
||||||
@@ -83,7 +95,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="sub_label_text">{% trans "Осталось выделений " %}<span id="remains_route_highlight_count">{{ remains_route_highlight_count }}</span></div>
|
<div class="sub_label_text">{% trans "Осталось выделений " %}<span id="remains_route_highlight_count">{{ remains_route_highlight_count }}</span></div>
|
||||||
|
|
||||||
<button onclick="confirmUpgrade(this,{{ route.id }} )" id="send_upgrade"> {% trans "Подтвердить" %}</button>
|
<button
|
||||||
|
onclick="confirmUpgrade(this,{{ route.id }} )"
|
||||||
|
id="send_upgrade"
|
||||||
|
class="send_upgrade_{{ route.id }}">{% trans "Подтвердить" %}</button>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user