articles paging
This commit is contained in:
SDE
2023-10-05 19:42:13 +03:00
parent 63d3ffddd4
commit 32f65de458
7 changed files with 11 additions and 6 deletions

View File

@@ -29,7 +29,8 @@ def get_articles(art_kwargs, request_Data=None, from_el=None, to_el=None):
Dict = {
'articles': arts,
'last_block': last_block
'last_block': last_block,
'last_el': to_el
}
return Dict

View File

@@ -5,6 +5,6 @@ from django.urls import path
from .js_views import *
urlpatterns = [
path('get_articles_block/', get_articles_block_ajax, name='get_articles_block_ajax'),
]

View File

@@ -33,7 +33,7 @@ def get_articles_block_ajax(request):
if 'errors' in Dict:
return JsonResponse(Dict, status=400)
html = render_to_string('blocks/b_news_elements.html', Dict, request=request)
html = render_to_string('blocks/articles/b_news_elements.html', Dict, request=request)
res_Dict = {
'html': html,

View File

@@ -1,9 +1,12 @@
from django.urls import path
from .views import *
from .js_views import *
urlpatterns = [
path('articles/', ArticlesPageView, name=u'articles'),
path('articles/<int:year>/', ArticlesPageView, name=u'articles_by_year'),
path('article/<str:art_url>/', ArticlesOnePageView, name=u'article_one'),
path('info_page/<str:page_url>/', UserPageView, name=u'user_page'),
path('get_articles_block/', get_articles_block_ajax, name='get_articles_block_ajax'),
]