From c462a41d50f748741220adf5b125d26849c9fd4f Mon Sep 17 00:00:00 2001 From: zsloan Date: Mon, 9 Mar 2020 15:02:41 -0500 Subject: Added the option to change collection names Remooved a couple imports that weren't used --- wqflask/wqflask/collect.py | 14 +++++++++++- wqflask/wqflask/templates/collections/list.html | 1 - wqflask/wqflask/templates/collections/view.html | 30 +++++++++++++++++++++---- wqflask/wqflask/user_session.py | 7 ++++-- 4 files changed, 44 insertions(+), 8 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/collect.py b/wqflask/wqflask/collect.py index e5c24873..2a94e63d 100644 --- a/wqflask/wqflask/collect.py +++ b/wqflask/wqflask/collect.py @@ -225,4 +225,16 @@ def view_collection(): else: return render_template("collections/view.html", **collection_info - ) \ No newline at end of file + ) + +@app.route("/collections/change_name", methods=('POST',)) +def change_collection_name(): + params = request.form + + collection_id = params['collection_id'] + new_name = params['new_name'] + + g.user_session.change_collection_name(collection_id, new_name) + + return new_name + diff --git a/wqflask/wqflask/templates/collections/list.html b/wqflask/wqflask/templates/collections/list.html index eb3fc061..a2f1a1f7 100644 --- a/wqflask/wqflask/templates/collections/list.html +++ b/wqflask/wqflask/templates/collections/list.html @@ -2,7 +2,6 @@ {% block title %}Your Collections{% endblock %} {% block css %} - {% endblock %} diff --git a/wqflask/wqflask/templates/collections/view.html b/wqflask/wqflask/templates/collections/view.html index fd0025d9..e5188ed8 100644 --- a/wqflask/wqflask/templates/collections/view.html +++ b/wqflask/wqflask/templates/collections/view.html @@ -9,8 +9,11 @@