aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/collect.py2
-rw-r--r--wqflask/wqflask/static/new/javascript/search_results.js34
-rw-r--r--wqflask/wqflask/templates/collections/view.html5
3 files changed, 6 insertions, 35 deletions
diff --git a/wqflask/wqflask/collect.py b/wqflask/wqflask/collect.py
index e8459821..42a09fed 100644
--- a/wqflask/wqflask/collect.py
+++ b/wqflask/wqflask/collect.py
@@ -157,7 +157,7 @@ def remove_traits():
params = request.form
uc_id = params['uc_id']
- traits_to_remove = params.getlist('traits[]')
+ traits_to_remove = params['trait_list']
traits_to_remove = process_traits(traits_to_remove)
members_now = g.user_session.remove_traits_from_collection(uc_id, traits_to_remove)
diff --git a/wqflask/wqflask/static/new/javascript/search_results.js b/wqflask/wqflask/static/new/javascript/search_results.js
index 115dac13..39aae113 100644
--- a/wqflask/wqflask/static/new/javascript/search_results.js
+++ b/wqflask/wqflask/static/new/javascript/search_results.js
@@ -137,40 +137,6 @@ $(function() {
}
};
- remove = function() {
- var traits, uc_id;
- checked_traits = $("#trait_table input:checked");
- traits = checked_traits.map(function() {
- return $(this).val();
- }).get();
- console.log("checked length is:", traits.length);
- console.log("checked is:", traits);
- if ( $("#uc_id").length ) {
- uc_id = $("#uc_id").val();
- return $.ajax({
- type: "POST",
- url: "/collections/remove",
- data: {
- uc_id: uc_id,
- traits: traits
- },
- success: removed_traits
- });
- }
- else {
- collection_name = $("#collection_name").val();
- return $.ajax({
- type: "POST",
- url: "/collections/remove",
- data: {
- collection_name: collection_name,
- traits: traits
- },
- success: removed_traits
- });
- }
- };
-
submit_bnw = function() {
trait_data = get_traits_from_table("trait_table", "submit_bnw")
}
diff --git a/wqflask/wqflask/templates/collections/view.html b/wqflask/wqflask/templates/collections/view.html
index ec0e0220..b56a89da 100644
--- a/wqflask/wqflask/templates/collections/view.html
+++ b/wqflask/wqflask/templates/collections/view.html
@@ -232,6 +232,11 @@
$("#remove").on("click", function() {
url = $(this).data("url")
+ traits = $("#trait_table input:checked").map(function() {
+ return $(this).val();
+ }).get();
+ $("#trait_list").val(traits)
+
return submit_special(url)
});