...
1{# A more complex template using gonja (fully django-compatible template) #}
2<!DOCTYPE html>
3<html>
4
5<head>
6 <title>My blog page</title>
7</head>
8
9<body>
10 <h1>Blogpost</h1>
11 <div id="content">
12 {{ complex.post.Text|safe }}
13 </div>
14
15 <h1>Comments</h1>
16
17 {% for comment in complex.comments %}
18 <h2>{{ loop.index }}. Comment ({{ loop.revindex}} comment{{ loop.revindex|pluralize("s") }} left)</h2>
19 <p>From: {{ comment.Author.Name }} ({{ comment.Author.Validated|yesno("validated,not validated,unknown validation status") }})</p>
20
21 {% if complex.is_admin(comment.Author) %}
22 <p>This user is an admin (verify: {{ comment.Author.IsAdmin() }})!</p>
23 {% else %}
24 <p>This user is not admin!</p>
25 {% endif %}
26
27 <p>Written {{ comment.Date }}</p>
28 <p>{{ comment.Text|striptags }}</p>
29 {% endfor %}
30</body>
31
32</html>
View as plain text