diff options
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/collect.py | 7 | ||||
-rw-r--r-- | wqflask/wqflask/static/new/javascript/get_traits_from_collection.js | 8 | ||||
-rw-r--r-- | wqflask/wqflask/templates/collections/view.html | 10 |
3 files changed, 10 insertions, 15 deletions
diff --git a/wqflask/wqflask/collect.py b/wqflask/wqflask/collect.py index a04e4b13..eb0e2726 100644 --- a/wqflask/wqflask/collect.py +++ b/wqflask/wqflask/collect.py @@ -181,6 +181,10 @@ def store_traits_list(): def collections_add(): if g.user_session.logged_in: collections = g.user_session.user_collections + if len(collections) < 1: + collection_name = "Default Collection" + uc_id = g.user_session.add_collection(collection_name, set()) + collections = g.user_session.user_collections else: anon_collections = user_manager.AnonUser().get_collections() collections = [] @@ -229,7 +233,8 @@ def collections_new(): collection_id = params['existing_collection'].split(":")[0] collection_name = params['existing_collection'].split(":")[1] if g.user_session.logged_in: - traits = list(process_traits(params['traits'])) + unprocessed_traits = Redis.get(params['hash']) + traits = list(process_traits(unprocessed_traits)) g.user_session.add_traits_to_collection(collection_id, traits) return redirect(url_for('view_collection', uc_id=collection_id)) else: diff --git a/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js b/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js index bed3eb9e..d89264c6 100644 --- a/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js +++ b/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js @@ -44,12 +44,12 @@ $('#trait_table').dataTable( { $('#collection_table').dataTable( { "createdRow": function ( row, data, index ) { if ($('td', row).eq(1).text().length > 40) { - $('td', row).eq(1).text($('td', row).eq(2).text().substring(0, 40)); - $('td', row).eq(1).text($('td', row).eq(2).text() + '...') + $('td', row).eq(1).text($('td', row).eq(1).text().substring(0, 40)); + $('td', row).eq(1).text($('td', row).eq(1).text() + '...') } if ($('td', row).eq(3).text().length > 50) { - $('td', row).eq(3).text($('td', row).eq(4).text().substring(0, 50)); - $('td', row).eq(3).text($('td', row).eq(4).text() + '...') + $('td', row).eq(3).text($('td', row).eq(3).text().substring(0, 50)); + $('td', row).eq(3).text($('td', row).eq(3).text() + '...') } }, "order": [[0, "asc" ]], diff --git a/wqflask/wqflask/templates/collections/view.html b/wqflask/wqflask/templates/collections/view.html index a000b07d..c9c44796 100644 --- a/wqflask/wqflask/templates/collections/view.html +++ b/wqflask/wqflask/templates/collections/view.html @@ -172,16 +172,6 @@ console.time("Creating table"); $('#trait_table').dataTable( { - "createdRow": function ( row, data, index ) { - if ($('td', row).eq(2).text().length > 40) { - $('td', row).eq(2).text($('td', row).eq(2).text().substring(0, 40)); - $('td', row).eq(2).text($('td', row).eq(2).text() + '...') - } - if ($('td', row).eq(4).text().length > 50) { - $('td', row).eq(4).text($('td', row).eq(4).text().substring(0, 50)); - $('td', row).eq(4).text($('td', row).eq(4).text() + '...') - } - }, "columns": [ { "type": "natural", "width": 10 }, { "type": "natural", "width": 50 }, |