diff options
author | zsloan | 2021-04-14 20:25:15 +0000 |
---|---|---|
committer | zsloan | 2021-04-14 20:25:15 +0000 |
commit | af652da915ae263eac56c3b7ea255be31a7fccaa (patch) | |
tree | 0f84c091d96be3618671de3484a56a829332b5ed | |
parent | 6919d7cf68555d9ea3a260d328815cd66e3be1d7 (diff) | |
download | genenetwork2-af652da915ae263eac56c3b7ea255be31a7fccaa.tar.gz |
Added option to set default collection to collections/view.html
-rw-r--r-- | wqflask/wqflask/templates/collections/view.html | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/wqflask/wqflask/templates/collections/view.html b/wqflask/wqflask/templates/collections/view.html index 8d5e3616..9ec98ab1 100644 --- a/wqflask/wqflask/templates/collections/view.html +++ b/wqflask/wqflask/templates/collections/view.html @@ -14,6 +14,7 @@ <span id="collection_name">{{ uc.name }}</span> <input type="text" name="new_collection_name" style="font-size: 20px; display: none; width: 500px;" class="form-control" placeholder="{{ uc.name }}"> <button class="btn btn-default" style="display: inline;" id="change_collection_name">Change Collection Name</button> + <button class="btn btn-default" style="display: inline;" id="make_default">Make Default</button> </h1> <h3>This collection has {{ '{}'.format(numify(trait_obs|count, "record", "records")) }}</h3> @@ -231,6 +232,21 @@ $('#collection_name').css('display', 'inline'); } }); + + make_default = function() { + alert("The current collection is now your default collection.") + let uc_id = $('#uc_id').val(); + $.cookie('default_collection', uc_id, { + expires: 365, + path: '/' + }); + + let default_collection_id = $.cookie('default_collection'); + }; + + $("#make_default").on("click", function(){ + make_default(); + }); }); </script> |