Skip to content

Commit

Permalink
add review btn to tables
Browse files Browse the repository at this point in the history
  • Loading branch information
birm committed Sep 12, 2023
1 parent c9118af commit 4e444b7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
12 changes: 10 additions & 2 deletions apps/labeling/labelingSimpleAnnotationViewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -395,14 +395,14 @@
}
});
// display the open button normally.
let btn = `<button class="btn" data-id='${rs[0]}' onclick='openView(this)'>Open</button>`;
let btn = `<button class="btn" data-id='${rs[0]}' onclick='openView(this)'>Open</button> &nbsp; <button class="btn" style="background-color:#008000" data-id='${rs[0]}' onclick='openGenericReview(this)'>Review</button>`;
if (labelingAnnotationCount >= labelingCount){
if (collectionHasFeedback){
// if there's feedback, show a review button.
btn = `<button class="btn" style="background-color:#008000" data-id='${rs[0]}' onclick='openReview(this)'>Review</button>`
} else {
// otherwise, just a check.
btn = `<div class='material-icons' style='width:48px;color:#008000;' title='Done'>check_circle</div>`;
btn = `<div class='material-icons' style='width:48px;color:#008000;' title='Done'>check_circle</div> <button class="btn" style="background-color:#008000" data-id='${rs[0]}' onclick='openGenericReview(this)'>Review</button>`;
}
}
rs.push(btn);
Expand Down Expand Up @@ -469,6 +469,14 @@
alert("No Data Id");
}
}
function openGenericReview(e) {
const oid = e.dataset.id;
if (oid) {
window.location.href = `./labelReview.html?slideId=${oid}&collectionId=${cid}`;
} else {
alert("No Data Id");
}
}

document.addEventListener("DOMContentLoaded", initialize);
</script>
Expand Down
11 changes: 10 additions & 1 deletion apps/labeling/pitfallsTable.html
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@
rs.push(slide[key]);
}
});
const btn = `<button class="btn" data-id='${rs[0]}' onclick='openView(this)'>Open</button>`;
const btn = `<button class="btn" data-id='${rs[0]}' onclick='openView(this)'>Open</button> &nbsp; <button style="background-color:#008000" class="btn" data-id='${rs[0]}' onclick='openGenericReview(this)'>Review</button>`;
rs.push(btn);
return rs;
})
Expand Down Expand Up @@ -450,6 +450,15 @@
}
}

function openGenericReview(e){
const oid = e.dataset.id;
if (oid) {
window.location.href = `./labelReview.html?slideId=${oid}&collectionId=${cid}`;
} else {
alert("No Data Id");
}
}

document.addEventListener("DOMContentLoaded", initialize);
</script>
</html>

0 comments on commit 4e444b7

Please sign in to comment.