|
|
@@ -594,7 +594,7 @@ def add_todo_item():
|
|
|
@requires_login
|
|
|
def cross(item_id):
|
|
|
todolist_items = current_app.config['LIST']
|
|
|
- if 0 <= item_id < len(todolist_items):
|
|
|
+ if 0 <= item_id < len(todolist_items): # Make sure the item exists
|
|
|
todolist_items[item_id]['crossed'] = 'yes'
|
|
|
if save_todolist(todolist_items): # Save todo list
|
|
|
current_app.logger.info('Saved to-do list.')
|
|
|
@@ -612,6 +612,19 @@ def uncross(item_id):
|
|
|
return redirect(url_for('web_panels.mgmt', activeTab='todolist'))
|
|
|
|
|
|
|
|
|
+@ocb.route('/mgmt/remtodoitem/<int:item_id>')
|
|
|
+@requires_login
|
|
|
+def rem_todo_item(item_id):
|
|
|
+ todolist_items = current_app.config['LIST']
|
|
|
+ item_item_id = name
|
|
|
+ if 0 <= item_id < len(todolist_items): # Make sure the item exists
|
|
|
+ removed = todolist_items.pop([item_id])
|
|
|
+ current_app.logger.info(f'Removed \"{removed}\" from the to-do list.')
|
|
|
+ if save_todolist(todolist_items): # Save todo list
|
|
|
+ current_app.logger.info('Saved to-do list.')
|
|
|
+ return redirect(url_for('web_panels.mgmt', activeTab='todolist'))
|
|
|
+
|
|
|
+
|
|
|
@ocb.route('/mgmt/clearlist')
|
|
|
@requires_login
|
|
|
def clear_list():
|