<!DOCTYPE HTML>
<html lang="en">
<head>
<title>Templ test</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="style.css">
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="../templ.js"></script>
</head>
<body>
<h2>
If-statement, true-branch
<a href="index.html" class="back">Back to tests</a>
</h2>
<script type="html/template" id="tpl_example">
<div class="user">
<strong>User: {{ user.username }}</strong>
{% if user.confirmed %}
<p>
View your <a href="/account/records/{{ user.id }}">records</a>.
</p>
{% else %}
<p class="red">
Please <a href="/account/confirm/{{ user.id }}">confirm</a> your account.
</p>
{% endif %}
</div>
</script>
<h3>Template</h3>
<pre id="template"></pre>
<h3>Data</h3>
<pre id="data">
{
user: {
id: 21,
username: 'Tomas',
confirmed: true
}
}
</pre>
<h3>Parsed result</h3>
<pre id="output"></pre>
</body>
</html> |