blog/list.html

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{% extends 'base.html' %}
{% load comments %}
{% block content %}
{% for entry in entries %}
{% get_comment_count for entry as comment_count %}
{% with entry.user.get_profile as profile %}
<div class="thenew">
<div class="newimg">
{% if profile.avatar %}
<img src="{{ profile.avatar.url }}" alt="img">
{% else %}
<img srv="/static/avatars/default.jpg" alt="img">
{% endif %}
<p><a href="/blog/{{ entry.user }}">{{ entry.user }}</a></p>
</div>
<p class="newtitle"><a href="/blog/{{ entry.user }}/{{ entry.slug }}">{{ entry.title }}</a></p>
<p class="newtext">{{ entry.body|striptags }}</p>
<div class="chit">&nbsp;&nbsp;&nbsp;&nbsp;<a href="/blog/{{ entry.user }}/{{ entry.slug }}">Читать полностью</a></div>
<div class="com">&nbsp;&nbsp;&nbsp;&nbsp;<a href="/blog/{{ entry.user }}/{{ entry.slug }}#">{{ comment_count }} коммента
риев</a></div>
</div>
<br><br>
{% endwith %}
{% endfor %}
{% endblock %}