iris/_examples/view/template_jet_0/views/todos/index.jet
Gerasimos (Makis) Maropoulos 076d9121f1 Implement a new View Engine for the Jet template parser as requested at: https://github.com/kataras/iris/issues/1281
Former-commit-id: 3e00bdfbf1f3998a1744c390c12fd70430ac0320
2019-06-22 21:34:19 +03:00

31 lines
791 B
Plaintext

{{extends "layouts/application.jet"}}
{{block button(label, href="javascript:void(0)")}}
<a href="{{ href }}">{{ label }}</a>
{{end}}
{{block ul()}}
<ul>
{{yield content}}
</ul>
{{end}}
{{block documentBody()}}
<h1>List of TODOs</h1>
{{if isset(showingAllDone) && showingAllDone}}
<p>Showing only TODOs that are done</p>
{{else}}
<p><a href="/all-done">Show only TODOs that are done</a></p>
{{end}}
{{yield ul() content}}
{{range id, value := .}}
<li {{if value.Done}}style="color:red;text-decoration: line-through;"{{end}}>
<a href="/todo?id={{ id }}">{{ value.Text }}</a>
{{yield button(label="UP", href="/update/?id="+base64(id))}} - {{yield button(href="/delete/?id="+id, label="DL")}}
</li>
{{end}}
{{end}}
{{end}}