aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/collect.py5
-rw-r--r--wqflask/wqflask/templates/collections/view.html7
2 files changed, 7 insertions, 5 deletions
diff --git a/wqflask/wqflask/collect.py b/wqflask/wqflask/collect.py
index 4fb8e69b..e8459821 100644
--- a/wqflask/wqflask/collect.py
+++ b/wqflask/wqflask/collect.py
@@ -159,13 +159,10 @@ def remove_traits():
uc_id = params['uc_id']
traits_to_remove = params.getlist('traits[]')
traits_to_remove = process_traits(traits_to_remove)
- logger.debug("\n\n after processing, traits_to_remove:", traits_to_remove)
members_now = g.user_session.remove_traits_from_collection(uc_id, traits_to_remove)
- # We need to return something so we'll return this...maybe in the future
- # we can use it to check the results
- return str(len(members_now))
+ return redirect(url_for("view_collection", uc_id=uc_id))
@app.route("/collections/delete", methods=('POST',))
diff --git a/wqflask/wqflask/templates/collections/view.html b/wqflask/wqflask/templates/collections/view.html
index 60a1a081..ec0e0220 100644
--- a/wqflask/wqflask/templates/collections/view.html
+++ b/wqflask/wqflask/templates/collections/view.html
@@ -80,7 +80,7 @@
<input type="text" id="searchbox" class="form-control" style="width: 200px; display: inline; padding-bottom: 9px;" placeholder="Search Table For ...">
<input type="text" id="select_top" class="form-control" style="width: 200px; display: inline; padding-bottom: 9px;" placeholder="Select Top ...">
<button class="btn btn-default" id="deselect_all" type="button"><span class="glyphicon glyphicon-remove"></span> Deselect</button>
- <button class="btn btn-danger" id="remove" disabled="disabled" type="button"><i class="icon-minus-sign"></i> Delete Rows</button>
+ <button id="remove" class="btn btn-danger" data-url="/collections/remove" disabled="disabled" type="button"><i class="icon-minus-sign"></i> Delete Rows</button>
<button id="delete" class="btn btn-danger submit_special" data-url="/collections/delete" title="Delete this collection" > Delete Collection</button>
</form>
<div style="margin-top: 10px; margin-bottom: 5px;">
@@ -230,6 +230,11 @@
return submit_special(url)
});
+ $("#remove").on("click", function() {
+ url = $(this).data("url")
+ return submit_special(url)
+ });
+
$("#change_collection_name").on("click", function() {
if ($('input[name=new_collection_name]').css('display') == 'none') {
$('input[name=new_collection_name]').css('display', 'inline');