From 36558cf5831d101f6a6fd9e7f490dbced33baf2d Mon Sep 17 00:00:00 2001 From: Birm Date: Tue, 19 Nov 2024 21:31:29 -0500 Subject: [PATCH 1/3] add preview button --- apps/labeling/downloadTable.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/labeling/downloadTable.html b/apps/labeling/downloadTable.html index 8d1a4fe9e..45d34ead0 100644 --- a/apps/labeling/downloadTable.html +++ b/apps/labeling/downloadTable.html @@ -382,7 +382,7 @@ keys.forEach((key, i) => { rs.push(slide[key]); }); - const btn = ``; + const btn = ` Select ROIs   `; rs.push(btn); return rs; }) From 371525595673eabc91aec922545f6d9d9e35b656 Mon Sep 17 00:00:00 2001 From: Birm Date: Tue, 19 Nov 2024 21:49:14 -0500 Subject: [PATCH 2/3] add download button for entire collection --- apps/labeling/downloadTable.html | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/apps/labeling/downloadTable.html b/apps/labeling/downloadTable.html index 45d34ead0..dbded30b5 100644 --- a/apps/labeling/downloadTable.html +++ b/apps/labeling/downloadTable.html @@ -364,6 +364,14 @@ document.getElementById("collectionName").innerText = collectionInfo[0].name document.getElementById("collectionDesc").innerText = collectionInfo[0].description } + if (collectionInfo[0].zip){ + let zipButton = document.createElement("button") + zipButton.innerText = "Download Whole Collection"; + zipButton.classList.add(["btn"]); + zipButton.dataset.zipurl = collectionInfo[0].zip; + zipButton.onclick = downloadCollection; + document.getElementById("collectionInfo").appendChild(zipButton) + } // set slides const slides = await store.findSlideLabelingStat(cid, getUserId()); if (slides && Array.isArray(slides)) { @@ -450,6 +458,19 @@ } } + async function downloadCollection(evt) { + console.log(evt) + let e = evt.target + let store = new Store("../../data/"); + const zipUrl = e.dataset.zipurl; + const a = document.createElement('a'); + a.href = zipUrl; + a.download = ''; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + } + function openGenericReview(e){ const oid = e.dataset.id; if (oid) { From 72d15410d58c30d066214764a348aab0ad065dc2 Mon Sep 17 00:00:00 2001 From: Birm Date: Tue, 19 Nov 2024 21:52:12 -0500 Subject: [PATCH 3/3] add download as user type in management --- apps/managment/editUser.html | 4 ++++ apps/managment/editUser.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/apps/managment/editUser.html b/apps/managment/editUser.html index 35cf22ee6..3c081ec98 100644 --- a/apps/managment/editUser.html +++ b/apps/managment/editUser.html @@ -154,6 +154,10 @@

Editing User

+
+ + +
diff --git a/apps/managment/editUser.js b/apps/managment/editUser.js index 5944f3f2e..49fb5da4b 100644 --- a/apps/managment/editUser.js +++ b/apps/managment/editUser.js @@ -22,6 +22,8 @@ async function populateUserEdit(){ } else if (user.userType == "Expert"){ document.getElementById('expert-select').checked=true; + } else if (user.userType == "Download"){ + document.getElementById('download-select').checked=true; } else { document.getElementById('public-select').checked=true; } @@ -80,6 +82,8 @@ async function updateUser(e){ user.userType = "Admin" } else if (document.getElementById('participant-select').checked){ user.userType = "Participant" + } else if (document.getElementById('download-select').checked){ + user.userType = "Download" } else { user.userType = "Public" }