diff options
author | Yaroslav de la Peña Smirnov <contact@yaroslavps.com> | 2018-10-07 23:20:39 +0300 |
---|---|---|
committer | Yaroslav de la Peña Smirnov <contact@yaroslavps.com> | 2018-10-07 23:20:39 +0300 |
commit | bb97581d650e2d994e7b2e63297dbb2d8784f5f3 (patch) | |
tree | 716a7612ce3467e268eba57c1cb3078383f49aec /weblog/templates | |
parent | 0eb94a690c477cc8e5b73e29805db17514128bde (diff) | |
download | w3blog-bb97581d650e2d994e7b2e63297dbb2d8784f5f3.tar.gz w3blog-bb97581d650e2d994e7b2e63297dbb2d8784f5f3.zip |
urls for ajax next page loading
Diffstat (limited to 'weblog/templates')
-rwxr-xr-x | weblog/templates/weblog/index.html | 9 | ||||
-rw-r--r-- | weblog/templates/weblog/nxtpage.html | 15 |
2 files changed, 24 insertions, 0 deletions
diff --git a/weblog/templates/weblog/index.html b/weblog/templates/weblog/index.html index 8dc1d93..b30c0ff 100755 --- a/weblog/templates/weblog/index.html +++ b/weblog/templates/weblog/index.html @@ -103,4 +103,13 @@ {% else %}
<div class="text-center"><h3>{% trans 'Nothing has been posted yet.' %}</h3></div>
{% endif %}
+ {% if dynamic_load %}
+ <script>
+ var current_page = {{ current_page }};
+ var last_page = {{ last_page }};
+ {% if infinite_load %}
+ {% else %}
+ {% endif %}
+ </script>
+ {% endif %}
{% endblock %}
diff --git a/weblog/templates/weblog/nxtpage.html b/weblog/templates/weblog/nxtpage.html new file mode 100644 index 0000000..67d244a --- /dev/null +++ b/weblog/templates/weblog/nxtpage.html @@ -0,0 +1,15 @@ +{% load i18n %} +{% for post in posts %} +<div class="blogpost"> + <h2 class="post-title"><a href="{{ post.url }}">{{ post.title }}</a></h2> + <p class="publish-info">{% blocktrans with publish_date=post.publish_date %}Published on <span class="post-publish-date">{{ publish_date }}</span>{% endblocktrans %}{% if post.author %}{% blocktrans with author=post.author context 'Written by (Author)' %}, by <span class="post-author">{{ author }}</span>{% endblocktrans %}{% endif %}</p> + <hr> + {% if post.preview_image %}<img class="img-fluid preview-img" src="{{ post.preview_image.url }}">{% endif %} + {{ post.preview_text|safe }} + <hr> + <div class="text-right read-more-wrapper"> + <a class="read-more" href="{{ post.url }}">{% trans 'Read more...' %}</a> + </div> +</div> +{% endfor %} + |