отображается паджинатор страниц
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
{% load static %}<html lang="ru">
|
||||
<!DOCTYPE html>{% load static %}<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
@@ -15,7 +14,7 @@
|
||||
<meta name="copyright" lang="ru" content="Sergei Erjemin{% block CopyrightAuthor4Meta %}{% endblock %}." />
|
||||
<meta name="robots" content="index,follow" />
|
||||
<meta name="document-state" content="{{ META_DOCUMENT_STATE|default:'Dynamic' }}" />
|
||||
<meta name="generator" content="CADPOINT.RU-- 0.01β by Python/Django" />
|
||||
<meta name="generator" content="CADPOINT.RU 0.1β by Python/Django" />
|
||||
<meta name="format-detection" content="telephone=no" />
|
||||
<meta name="twitter:dnt" content="on" />
|
||||
<title>CADPOINT.RU: {% block Title %}{% endblock %}</title>
|
||||
|
||||
@@ -70,7 +70,30 @@
|
||||
{{ i.szContentIntro|safe }}
|
||||
<p class="next"><a href="/item/{{ i.id }}-{{ i.szContentHead|safe_html_ss|slug_ru:'50' }}?p={{ PAGE_OF_LIST }}&n={{ forloop.counter }}">Читать дальше →</a></p>
|
||||
</div>
|
||||
</div>{% endfor %}
|
||||
</div>{% endfor %}{% if LENTA %}{# НАВИГАЦИЯ ПО СТРАНИЦАМ СО СПИСКАМИ КОНТЕНТА ИЗ ПРОИЗВОЛЬНОЙ КАТЕГОРИИ: НАЧАЛО #}
|
||||
<div class="row">
|
||||
<nav class="col-12" aria-label="Навигация по страницам">
|
||||
<ul class="pagination justify-content-center">
|
||||
{% if PAGE_OF_LIST == 0 %}<li class="page-item disabled">
|
||||
<a class="page-link" href="#" tabindex="-1" aria-disabled="true"><i class="bi bi-arrow-left px-2" title="Назад"></i> 1</a>
|
||||
</li>{% else %}<li class="page-item">
|
||||
<a class="page-link" href="/p0"><i class="bi bi-arrow-left px-2" title="Назад"></i> 1</a>
|
||||
</li>
|
||||
{% endif %}{% if PAGE_OF_LIST|add:'-3' > 0 and PAGE_OF_LIST|add:'-2' <= TOTAL_PAGE %}<li class="page-item"><a class="page-link" href="/p{{ PAGE_OF_LIST|add:'-3' }}">…</a></li>
|
||||
{% endif %}{% if PAGE_OF_LIST|add:'-2' > 0 and PAGE_OF_LIST|add:'-1' <= TOTAL_PAGE %}<li class="page-item"><a class="page-link" href="/p{{ PAGE_OF_LIST|add:'-2' }}">{{ PAGE_OF_LIST|add:'-1' }}</a></li>
|
||||
{% endif %}{% if PAGE_OF_LIST|add:'-1' > 0 and PAGE_OF_LIST <= TOTAL_PAGE %}<li class="page-item"><a class="page-link" href="/p{{ PAGE_OF_LIST|add:'-1' }}">{{ PAGE_OF_LIST }}</a></li>
|
||||
{% endif %}{% if PAGE_OF_LIST != 0 and PAGE_OF_LIST != TOTAL_PAGE %}<li class="page-item disabled"><a class="page-link" href="#" aria-disabled="true">{{ PAGE_OF_LIST|add:'1' }}</a></li>
|
||||
{% endif %}{% if PAGE_OF_LIST|add:'1' > 0 and PAGE_OF_LIST|add:'2' <= TOTAL_PAGE %}<li class="page-item"><a class="page-link" href="/p{{ PAGE_OF_LIST|add:'1' }}">{{ PAGE_OF_LIST|add:'2' }}</a></li>
|
||||
{% endif %}{% if PAGE_OF_LIST|add:'2' > 0 and PAGE_OF_LIST|add:'3' <= TOTAL_PAGE %}<li class="page-item"><a class="page-link" href="/p{{ PAGE_OF_LIST|add:'2' }}">{{ PAGE_OF_LIST|add:'3' }}</a></li>
|
||||
{% endif %}{% if PAGE_OF_LIST|add:'3' > 0 and PAGE_OF_LIST|add:'4' <= TOTAL_PAGE %}<li class="page-item"><a class="page-link" href="/p{{ PAGE_OF_LIST|add:'3' }}">…</a></li>
|
||||
{% endif %}{% if PAGE_OF_LIST < TOTAL_PAGE %}<li class="page-item">
|
||||
<a class="page-link" href="/p{{ TOTAL_PAGE }}">{{ TOTAL_PAGE|add:'1' }} <i class="bi bi-arrow-right px-2" title="Дальше"></i></a>
|
||||
</li>{% else %}<li class="page-item disabled">
|
||||
<a class="page-link" href="#" tabindex="-1" aria-disabled="true">{{ TOTAL_PAGE|add:'1' }} <i class="bi bi-arrow-right px-2" title="Дальше"></i></a>
|
||||
</li>{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>{# НАВИГАЦИЯ ПО СТРАНИЦАМ СО СПИСКАМИ КОНТЕНТА ИЗ ПРОИЗВОЛЬНОЙ КАТЕГОРИИ: КОНЕЦ #}{% endif %}
|
||||
|
||||
|
||||
</div>
|
||||
@@ -79,10 +102,7 @@
|
||||
{% include "blocks/tags-cloud.jinja2" %}
|
||||
</nav>{#<!-- боковая навигация: конец-->#}
|
||||
</div>
|
||||
</div>{#<!-- POINT-СРАНИЦА: КОНЕЦ -->#}
|
||||
|
||||
|
||||
{% endblock %}
|
||||
</div>{#<!-- POINT-СРАНИЦА: КОНЕЦ -->#}{% endblock %}
|
||||
|
||||
{% block Top_JS1 %}<script type="text/javascript">
|
||||
</script>{% endblock %}
|
||||
|
||||
@@ -79,6 +79,15 @@ def index(request,
|
||||
" tTotalInfo.NumTotal DESC" % (query,))
|
||||
to_template.update({"LENTA": q_content, "TAGS_IN_PAGE": q_tags})
|
||||
to_template.update({"PAGE_OF_LIST": int(ppage)})
|
||||
query_count = "SELECT 1 AS id," \
|
||||
" COUNT(web_tbcontent.id) AS tot_item " \
|
||||
"FROM web_tbcontent " \
|
||||
"WHERE (web_tbcontent.tdContentPublishDown IS NULL" \
|
||||
" OR web_tbcontent.tdContentPublishDown > NOW())" \
|
||||
" AND web_tbcontent.bContentPublish"
|
||||
q_count = TbContent.objects.raw(query_count)
|
||||
# print("--", (q_count[0].tot_item - 1) // 7, q_count[0].tot_item)
|
||||
to_template.update({"TOTAL_PAGE": (q_count[0].tot_item - 1) // 7})
|
||||
return render(request, template, to_template)
|
||||
|
||||
|
||||
|
||||
@@ -114,14 +114,9 @@ div.lenta > div.row > div[class^="col"] > div.row > div[class^="col"] > p > ifra
|
||||
border-bottom: solid white 12px;
|
||||
border-image: url('/static/svgs/logo_cadpoint-2021-border.svg') 0 0 600 0 round;
|
||||
}
|
||||
div.lenta > div.row > div[class^="col"] > div.row > div[class^="col"] > p.next > a {
|
||||
letter-spacing: 0.2ex;
|
||||
}
|
||||
div.lenta > div.row > div[class^="col"] > div.row {
|
||||
border-bottom: 1px gray dashed;
|
||||
margin-bottom: 1em;
|
||||
padding-bottom: 1em;
|
||||
}
|
||||
div.lenta > div.row > div[class^="col"] > div.row > div[class^="col"] > p.next > a { letter-spacing: 0.2ex; }
|
||||
div.lenta > div.row > div[class^="col"] > div.row { margin-bottom: 1em; padding-bottom: 1em; }
|
||||
div.lenta > div.row > div[class^="col"] > div.row:not(:last-child) { border-bottom: 1px gray dashed; }
|
||||
|
||||
@keyframes scaleUpDown {
|
||||
0% { transform: scale(1); }
|
||||
|
||||
Reference in New Issue
Block a user