|
2 | 2 | <htmllang="en">
|
3 | 3 | <head>
|
4 | 4 | <metacharset="utf-8"/>
|
5 |
| -<metaname="viewport"content="width=device-width,initial-scale=1"/> |
6 | 5 |
|
7 | 6 | <title>Todo App</title>
|
8 | 7 |
|
|
14 | 13 | - paths:
|
15 | 14 | - /utils.py
|
16 | 15 | </py-env>
|
17 |
| -<py-register-widgetsrc="/pylist.py"name="py-list"klass="PyList"></py-widget> |
| 16 | +<py-register-widgetsrc="/pylist.py"name="py-list"klass="PyList"></py-register-widget> |
18 | 17 | </head>
|
19 | 18 |
|
20 | 19 | <body>
|
21 | 20 | <py-title>To Do List</py-title>
|
22 |
| -<py-boxwidths="2/3;1/3"> |
| 21 | +<py-boxwidths="4/5;1/5"> |
23 | 22 | <py-inputboxid="new-task-content">
|
24 | 23 | def on_keypress(e):
|
25 | 24 | if (e.code == "Enter"):
|
26 | 25 | add_task()
|
27 | 26 | </py-inputbox>
|
28 | 27 | <py-buttonid="new-task-btn"label="Add Task!">
|
29 | 28 | def on_click(evt):
|
30 |
| - task = { "content": new_task_content.value, "done": False, "created_at": dt.now() } |
31 |
| - myList.add(PyItem(task, labels=['content'], state_key="done")) |
32 |
| - new_task_content.clear() |
| 29 | + add_task() |
33 | 30 | </button>
|
34 | 31 | </py-box>
|
35 |
| -
|
| 32 | + |
36 | 33 | <py-listid="myList"></py-list>
|
37 | 34 | <py-replid="my-repl"auto-generate="true"></py-repl>
|
38 | 35 | </body>
|
|