March 2018
Beginner to intermediate
336 pages
8h 22m
English
The QWeb template is added using a data file. We can use the existing todo_website/views/todo_templates.xml data file for that, and add the following:
<template id="index" name="Todo List">
<t t-call="website.layout">
<div id="wrap" class="container">
<h1>Todo Tasks</h1>
<!-- List of Tasks -->
<t t-foreach="tasks" t-as="task">
<div class="row">
<input type="checkbox" disabled="True"
t-att-checked=" 'checked' if task.is_done else None" />
<a t-attf-href="/todo/{{slug(task)}}">
<span t-field="task.name"
t-att-class="'todo-app-done' if task.is_done
else ''" />
</a>
</div>
</t>
<!-- Add a new Task -->
<div class="row">
<a href="/todo/add" class="btn btn-primary btn-lg">
Add
</a>
</div>
</div>
</t>
</template>
The ...
Read now
Unlock full access