github.com/insionng/yougam@v0.0.0-20170714101924-2bc18d833463/libraries/flosch/pongo2.v3/template_tests/complex.tpl (about) 1 {# A more complex template using pongo2 (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>{{ forloop.Counter }}. Comment ({{ forloop.Revcounter}} comment{{ forloop.Revcounter|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.Is_admin }})!</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>