0.0.276
This commit is contained in:
@@ -1,16 +1,21 @@
|
|||||||
page_iterator = 2
|
page_iterator = 2
|
||||||
separator_iterator = 1
|
separator_iterator = 1
|
||||||
|
|
||||||
function load_routes (el) {
|
function load_routes (el,news=null) {
|
||||||
let number_last_route = el.id
|
let number_last_route = el.id
|
||||||
let data_d = {
|
let data_d = {
|
||||||
'from_el':parseInt(number_last_route) + 1,
|
'from_el':parseInt(number_last_route) + 1,
|
||||||
'to_el':parseInt(number_last_route) + 11
|
'to_el':parseInt(number_last_route) + 11
|
||||||
}
|
}
|
||||||
let get_url = ""
|
let get_url = ""
|
||||||
let list = forloop_func_form(data_d,"get",get_url)
|
let url_ajax = "get_articles_block/"
|
||||||
data_d = list[0]
|
if (!news){
|
||||||
get_url = list[1]
|
let list = forloop_func_form(data_d,"get",get_url)
|
||||||
|
data_d = list[0]
|
||||||
|
get_url = list[1]
|
||||||
|
url_ajax = "routes/find_routes/"
|
||||||
|
}
|
||||||
|
|
||||||
let loader = document.querySelector(".loader_f_loading_routes")
|
let loader = document.querySelector(".loader_f_loading_routes")
|
||||||
loader.classList.toggle("show")
|
loader.classList.toggle("show")
|
||||||
el.classList.toggle("hide")
|
el.classList.toggle("hide")
|
||||||
@@ -25,7 +30,7 @@ function load_routes (el) {
|
|||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
||||||
url: '/ru/routes/find_routes/',
|
url: `/ru/${url_ajax}`,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
// async: true,
|
// async: true,
|
||||||
cache: false,
|
cache: false,
|
||||||
@@ -36,8 +41,14 @@ function load_routes (el) {
|
|||||||
success: function(data){
|
success: function(data){
|
||||||
|
|
||||||
// new_el.parentNode.insertBefore(data.html, new_el.nextSibling);
|
// new_el.parentNode.insertBefore(data.html, new_el.nextSibling);
|
||||||
let url_insert = ".page_routes_" + page_iterator
|
|
||||||
let place_ins = document.querySelector(url_insert)
|
//
|
||||||
|
// let url_insert = ".page_routes_" + pasge_iterator
|
||||||
|
// let place_ins = document.querySelector(url_insert)
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
let place_ins = el.parentNode.previousElementSibling.previousElementSibling
|
||||||
place_ins.innerHTML = data.html
|
place_ins.innerHTML = data.html
|
||||||
let old_page_iterator = page_iterator
|
let old_page_iterator = page_iterator
|
||||||
page_iterator++
|
page_iterator++
|
||||||
|
|||||||
@@ -19,3 +19,4 @@
|
|||||||
{#<div>{{ art.text|safe }}</div>#}
|
{#<div>{{ art.text|safe }}</div>#}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="clear_both"></div>
|
||||||
@@ -37,12 +37,13 @@
|
|||||||
|
|
||||||
{% if last_block == False %}
|
{% if last_block == False %}
|
||||||
<div class="text-align-center w-68 f-r">
|
<div class="text-align-center w-68 f-r">
|
||||||
<button class="button-find-more-routes" id="25" onclick="load_routes(this)">{% trans "Показать ещё 10" %}</button>
|
{% csrf_token %}
|
||||||
|
<button class="button-find-more-routes" id="25" onclick="load_routes(this,'news')">{% trans "Показать ещё 10" %}</button>
|
||||||
<div class="width-100 text-align-center mb-10">
|
<div class="width-100 text-align-center mb-10">
|
||||||
<img class="loader_f_loading_routes" src="{% static "img/svg/loader.svg" %}">
|
<img class="loader_f_loading_routes" src="{% static "img/svg/loader.svg" %}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{# boris edited end#}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user