File tree Expand file tree Collapse file tree 5 files changed +18
-2
lines changed Expand file tree Collapse file tree 5 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 1
1
regressionTest {
2
2
FILE_PATH = "app.py"
3
- LINE_NUM = "114 "
4
- SHA = "6833c3840a3542adddde98bceaa1aa715d49cf29b5295b6b3e84817a0b967129 "
3
+ LINE_NUM = "118 "
4
+ SHA = "5fcb058ac94ae67512e5c48d720980c6796152fd6f822aea80dfd7cf3c6008cd "
5
5
LANG = "Python"
6
6
BACKGROUND_IMAGE_CMD = "python /app/app.py &"
7
7
URL_FOR_TRIGGER = "http://localhost:5000/todos"
Original file line number Diff line number Diff line change @@ -74,6 +74,10 @@ def clear_completed():
74
74
todo = [t for t in todos if not t ['completed' ]]
75
75
return '' , 204
76
76
77
+ @app .route ('/todos/remove_all' , methods = ['DELETE' ])
78
+ def remove_all ():
79
+ Store .getInstance ().todos = []
80
+ return '' , 204
77
81
78
82
@app .route ('/todos' , methods = ['UPDATE' ])
79
83
def update_todo ():
Original file line number Diff line number Diff line change @@ -373,6 +373,11 @@ html .clear-completed:active {
373
373
text-decoration : underline;
374
374
}
375
375
376
+ .clear-all-items {
377
+ cursor : pointer;
378
+ }
379
+
380
+
376
381
/*
377
382
Hack to remove background from Mobile Safari.
378
383
Can't use it globally since it destroys checkboxes in Firefox
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ <h1>todos</h1>
42
42
</ section >
43
43
< footer class ="info ">
44
44
< p > Double-click to edit a todo</ p >
45
+ < p v-on:click ="removeAll " class ="clear-all-items "> Click here to remove all items</ p >
45
46
</ footer >
46
47
47
48
</ div >
Original file line number Diff line number Diff line change @@ -61,6 +61,12 @@ $().ready(() => {
61
61
method : 'DELETE'
62
62
} ) ;
63
63
this . reloadOnFinish ( action ) ;
64
+ } ,
65
+ removeAll ( ) {
66
+ const action = $ . ajax ( '/todos/remove_all' , {
67
+ method : 'DELETE'
68
+ } ) ;
69
+ this . reloadOnFinish ( action ) ;
64
70
} ,
65
71
updateTodo ( todo ) {
66
72
const action = $ . ajax ( '/todos' , {
You can’t perform that action at this time.
0 commit comments