File: complex.tpl

package info (click to toggle)
golang-github-flosch-pongo2.v4 4.0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-backports, trixie
  • size: 860 kB
  • sloc: makefile: 3
file content (32 lines) | stat: -rw-r--r-- 827 bytes parent folder | download | duplicates (5)
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
26
27
28
29
30
31
32
{# A more complex template using pongo2 (fully django-compatible template) #}
<!DOCTYPE html>
<html>

<head>
	<title>My blog page</title>
</head>

<body>
	<h1>Blogpost</h1>
	<div id="content">
		{{ complex.post.Text|safe }}
	</div>

	<h1>Comments</h1>

	{% for comment in complex.comments %}
		<h2>{{ forloop.Counter }}. Comment ({{ forloop.Revcounter}} comment{{ forloop.Revcounter|pluralize:"s" }} left)</h2>
		<p>From: {{ comment.Author.Name }} ({{ comment.Author.Validated|yesno:"validated,not validated,unknown validation status" }})</p>

		{% if complex.is_admin(comment.Author) %}
			<p>This user is an admin (verify: {{ comment.Author.Is_admin }})!</p>
		{% else %}
			<p>This user is not admin!</p>
		{% endif %}

		<p>Written {{ comment.Date }}</p>
		<p>{{ comment.Text|striptags }}</p>
	{% endfor %}
</body>

</html>