diff --git a/ArticlesApp/funcs.py b/ArticlesApp/funcs.py index 84be830..ec356b5 100644 --- a/ArticlesApp/funcs.py +++ b/ArticlesApp/funcs.py @@ -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 diff --git a/ArticlesApp/js_urls.py b/ArticlesApp/js_urls.py index fa8b0f6..59756d8 100644 --- a/ArticlesApp/js_urls.py +++ b/ArticlesApp/js_urls.py @@ -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'), + ] \ No newline at end of file diff --git a/ArticlesApp/js_views.py b/ArticlesApp/js_views.py index 8869b51..e770ea4 100644 --- a/ArticlesApp/js_views.py +++ b/ArticlesApp/js_views.py @@ -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, diff --git a/ArticlesApp/urls_translate.py b/ArticlesApp/urls_translate.py index 0bd0ae9..50456fa 100644 --- a/ArticlesApp/urls_translate.py +++ b/ArticlesApp/urls_translate.py @@ -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//', ArticlesPageView, name=u'articles_by_year'), path('article//', ArticlesOnePageView, name=u'article_one'), path('info_page//', UserPageView, name=u'user_page'), + + path('get_articles_block/', get_articles_block_ajax, name='get_articles_block_ajax'), ] \ No newline at end of file diff --git a/RoutesApp/funcs.py b/RoutesApp/funcs.py index 21c4bed..4015fbf 100644 --- a/RoutesApp/funcs.py +++ b/RoutesApp/funcs.py @@ -200,7 +200,7 @@ def get_routes_Dict(user=None, data=None): routes = routes[:to_el] else: to_el = 25 - routes = routes[:25] + routes = routes[:to_el] last_block_routes = False if not to_el or to_el >= routes_count: @@ -231,7 +231,8 @@ def get_routes_Dict(user=None, data=None): res_Dict.update({ 'routes': routes, - 'last_block_routes': last_block_routes + 'last_block_routes': last_block_routes, + 'last_el': to_el }) return res_Dict diff --git a/templates/blocks/static_pages_blocks/b_news_elements.html b/templates/blocks/articles/b_news_elements.html similarity index 100% rename from templates/blocks/static_pages_blocks/b_news_elements.html rename to templates/blocks/articles/b_news_elements.html diff --git a/templates/pages/p_articles.html b/templates/pages/p_articles.html index 1dc5636..c914e8b 100644 --- a/templates/pages/p_articles.html +++ b/templates/pages/p_articles.html @@ -32,7 +32,7 @@ {% with from_el=3 %} - {% include 'blocks/static_pages_blocks/b_news_elements.html' %} + {% include 'blocks/articles/b_news_elements.html' %} {% endwith %} {# boris edited #} {% if last_block == False %}