diff --git a/ArticlesApp/funcs.py b/ArticlesApp/funcs.py index 6c5af77..84be830 100644 --- a/ArticlesApp/funcs.py +++ b/ArticlesApp/funcs.py @@ -21,7 +21,7 @@ def get_articles(art_kwargs, request_Data=None, from_el=None, to_el=None): arts = arts[:to_el] else: to_el = 3 - arts = arts[:3] + arts = arts[:to_el] last_block = False if not to_el or to_el >= el_count: diff --git a/templates/blocks/static_pages_blocks/b_news_elements.html b/templates/blocks/static_pages_blocks/b_news_elements.html index 4e086a5..95eefe0 100644 --- a/templates/blocks/static_pages_blocks/b_news_elements.html +++ b/templates/blocks/static_pages_blocks/b_news_elements.html @@ -2,18 +2,20 @@
{% for art in articles %} -
-
-
-
{{ art.name }}
-
- {{ art.description|truncatechars:400 }} -{#
#} -
-
-
+ {% if from_el and forloop.counter > from_el %} +
+
+
+
{{ art.name }}
+
+ {{ art.description|truncatechars:400 }} + {#
#} +
+
+
-
+
+ {% endif %} {#
{{ art.text|safe }}
#} {% endfor %}
\ No newline at end of file diff --git a/templates/pages/p_articles.html b/templates/pages/p_articles.html index 47685cf..868c386 100644 --- a/templates/pages/p_articles.html +++ b/templates/pages/p_articles.html @@ -29,8 +29,9 @@ {% endfor %} - - {% include 'blocks/static_pages_blocks/b_news_elements.html' %} + {% with from_el=3 %} + {% include 'blocks/static_pages_blocks/b_news_elements.html' %} + {% endwith %} {% if last_block == False %}