0.8.420
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
__author__ = 'SDE'
|
__author__ = 'SDE'
|
||||||
|
|
||||||
def get_paging_Dict(request, elements_count, elements_on_page, from_page, to_page=None):
|
def get_paging_Dict(request, elements_count, next_page_els_count, from_page, to_page=None):
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
pages_count = elements_count / elements_on_page
|
pages_count = elements_count / next_page_els_count
|
||||||
if elements_count % elements_on_page > 0:
|
if elements_count % next_page_els_count > 0:
|
||||||
pages_count = pages_count + 1
|
pages_count = pages_count + 1
|
||||||
|
|
||||||
pages = []
|
pages = []
|
||||||
|
|||||||
@@ -3,16 +3,16 @@ standart_page_iterator = 1
|
|||||||
separator_iterator = 1
|
separator_iterator = 1
|
||||||
iterator_f_check = 1
|
iterator_f_check = 1
|
||||||
|
|
||||||
function load_routes (el,news=null) {
|
function load_routes (el,news=null,incrase) {
|
||||||
let local_page_iterator = standart_page_iterator
|
let local_page_iterator = standart_page_iterator
|
||||||
if (!news){
|
if (!news){
|
||||||
local_page_iterator = page_iterator
|
local_page_iterator = page_iterator
|
||||||
}
|
}
|
||||||
let number_last_route = el.id
|
let number_last_route = el.id
|
||||||
let incrase = 2
|
// let incrase = 2
|
||||||
if (!news){
|
// if (!news){
|
||||||
incrase = 10
|
// incrase = 10
|
||||||
}
|
// }
|
||||||
let data_d = {
|
let data_d = {
|
||||||
'from_el':parseInt(number_last_route),
|
'from_el':parseInt(number_last_route),
|
||||||
'to_el':parseInt(number_last_route) + incrase
|
'to_el':parseInt(number_last_route) + incrase
|
||||||
@@ -58,6 +58,10 @@ function load_routes (el,news=null) {
|
|||||||
//
|
//
|
||||||
|
|
||||||
//
|
//
|
||||||
|
if (data.next_page_els_count){
|
||||||
|
document.querySelector(".col_vo_els_f_load").innerHTML = data.next_page_els_count
|
||||||
|
}
|
||||||
|
|
||||||
let place_ins_parent = el.closest(".block_w_paging")
|
let place_ins_parent = el.closest(".block_w_paging")
|
||||||
let place_ins = place_ins_parent.querySelector(`.page_paging_elements_${local_page_iterator}`)
|
let place_ins = place_ins_parent.querySelector(`.page_paging_elements_${local_page_iterator}`)
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -19,9 +19,9 @@
|
|||||||
|
|
||||||
<div class="clear_both"></div>
|
<div class="clear_both"></div>
|
||||||
|
|
||||||
{% if last_block == False %}
|
{% if last_block == False and next_page_els_count %}
|
||||||
<div class="text-align-center">
|
<div class="text-align-center">
|
||||||
<button class="button-find-more-routes" id="{{ last_el }}" onclick="load_routes(this)">{% trans "Показать ещё 10" %}</button>
|
<button class="button-find-more-routes" id="{{ last_el }}" onclick="load_routes(this,null,{{ next_page_els_count }})">{% trans "Показать ещё" %}<span class="col_vo_els_f_load">{{ next_page_els_count }}</span></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>
|
||||||
|
|||||||
@@ -36,10 +36,10 @@
|
|||||||
{% include 'blocks/articles/b_news_elements_content.html' %}
|
{% include 'blocks/articles/b_news_elements_content.html' %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{# boris edited #}
|
{# boris edited #}
|
||||||
{% if last_block == False %}
|
{% if last_block == False and next_page_els_count %}
|
||||||
<div class="text-align-center">
|
<div class="text-align-center">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<button class="button-find-more-routes" id="{{ last_el }}" onclick="load_routes(this,'news')">{% trans "Показать ещё 2" %}</button>
|
<button class="button-find-more-routes" id="{{ last_el }}" onclick="load_routes(this,'news',{{ next_page_els_count }})">{% trans "Показать ещё" %}<span class="col_vo_els_f_load">{{ next_page_els_count }}</span></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>
|
||||||
|
|||||||
Reference in New Issue
Block a user