Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
37 lines (35 sloc) 1.68 KB
<!-- TodoMVCTemplate -->
<?dart
part of todoMVC;
?>
<Template name="TodoMVCTemplate" args="list">
<View layout="type: linear; orient: vertical; spacing: 0" width="${550}"
profile="location: center top" control="app: new TodoAppControl(list)">
<TextView class="h1" text="todos" />
<View id="todo-app" layout="type: linear; orient: vertical; spacing: 0">
<View id="header-bar" />
<View tag="section" id="header">
<CheckBox id="toggle-all" value="${app.activeCount == 0}"
visible="${!app.todos.isEmpty}" on.change="selectAll" />
<TextBox id="new-todo" placeholder="What needs to be done?" on.keyUp="enterNewTodo" />
</View>
<View tag="ul" id="todo-list" layout="type: linear; orient: vertical; spacing: 0">
<Apply forEach="t in app.todos">
<View tag="li" class="${t.completed ? 'completed' : ''}" control="new TodoItemControl(app, t)">
<View class="show">
<CheckBox class="toggle" value="${t.completed}" on.change="toggleCompleted" />
<TextView class="title" text="${t.title}" on.doubleClick="editTitle" />
<Button class="destroy" on.click="destroy" />
</View>
<TextBox class="edit" profile="width: ignore; height: ignore"
value="${t.title}" on.blur="submitTitle" on.keyUp="enterTitle" />
</View>
</Apply>
</View>
</View>
<View tag="footer" id="footer">
<TextView id="todo-count" html="<strong>${app.activeCount}</strong> item${app.activeCount!=1?'s':''} left" />
<Button id="clear-completed" text="Clear completed (${app.completedCount})" on.click="clearCompleted" />
</View>
</View>
</Template>