Skip to content

Commit 8526adb

Browse files
authored
Merge pull request #18 from Human-Augment-Analytics/rz/recruit1
Add Active vs New project statuses
2 parents 3f4c8d7 + 69b505f commit 8526adb

2 files changed

Lines changed: 33 additions & 3 deletions

File tree

index.html

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@
375375
let activeTag = '';
376376
let selectedFaculties = []; // multi-select faculty
377377
let selectedTags = []; // multi-select categories/tags
378+
let selectedStatus = ''; // filter by project status
378379
let recruitFilter = null; // null = any, true = open, false = closed
379380

380381
function normalizeText(value) {
@@ -595,8 +596,35 @@
595596
closedBtn.addEventListener('click', () => { recruitFilter = recruitFilter === false ? null : false; updateAndRender(); });
596597
recruitList.appendChild(closedBtn);
597598

598-
// Categories (tags) - derived from projects after applying faculty & recruit filters
599-
const tagPool = projects.filter(p => (!selectedFaculties.length || p.faculty.some(f => selectedFaculties.includes(f))) && (recruitFilter === null || p.recruiting === recruitFilter));
599+
const statusSection = document.createElement('div');
600+
statusSection.className = 'filter-section';
601+
statusSection.innerHTML = `<div class="filter-title">Project Status</div><div class="filter-list" id="status-list"></div>`;
602+
sidebar.appendChild(statusSection);
603+
604+
const statusList = statusSection.querySelector('#status-list');
605+
const statusAllBtn = document.createElement('button');
606+
statusAllBtn.type = 'button';
607+
statusAllBtn.className = `filter-item ${selectedStatus === '' ? 'active' : ''}`;
608+
statusAllBtn.textContent = 'All';
609+
statusAllBtn.addEventListener('click', () => { selectedStatus = ''; updateAndRender(); });
610+
statusList.appendChild(statusAllBtn);
611+
612+
const activeStatusBtn = document.createElement('button');
613+
activeStatusBtn.type = 'button';
614+
activeStatusBtn.className = `filter-item ${selectedStatus === 'active' ? 'active' : ''}`;
615+
activeStatusBtn.textContent = 'Active';
616+
activeStatusBtn.addEventListener('click', () => { selectedStatus = selectedStatus === 'active' ? '' : 'active'; updateAndRender(); });
617+
statusList.appendChild(activeStatusBtn);
618+
619+
const newStatusBtn = document.createElement('button');
620+
newStatusBtn.type = 'button';
621+
newStatusBtn.className = `filter-item ${selectedStatus === 'new' ? 'active' : ''}`;
622+
newStatusBtn.textContent = 'New';
623+
newStatusBtn.addEventListener('click', () => { selectedStatus = selectedStatus === 'new' ? '' : 'new'; updateAndRender(); });
624+
statusList.appendChild(newStatusBtn);
625+
626+
// Categories (tags) - derived from projects after applying faculty, status, & recruit filters
627+
const tagPool = projects.filter(p => (!selectedFaculties.length || p.faculty.some(f => selectedFaculties.includes(f))) && (recruitFilter === null || p.recruiting === recruitFilter) && (!selectedStatus || p.status.toLowerCase() === selectedStatus));
600628
const tags = [...new Set(tagPool.flatMap(p => p.tags))].sort();
601629

602630
const tagSection = document.createElement('div');
@@ -636,6 +664,7 @@
636664
if (selectedTags.length && !project.tags.some(t => selectedTags.includes(t))) return false;
637665
if (selectedFaculties.length && !project.faculty.some(f => selectedFaculties.includes(f))) return false;
638666
if (recruitFilter !== null && project.recruiting !== recruitFilter) return false;
667+
if (selectedStatus && project.status.toLowerCase() !== selectedStatus) return false;
639668
return true;
640669
});
641670
}
@@ -774,6 +803,7 @@ <h2 id="modal-title">${project.name}</h2>
774803
// initialize filters and render
775804
selectedFaculties = [];
776805
selectedTags = [];
806+
selectedStatus = '';
777807
recruitFilter = null;
778808
activeTag = '';
779809
updateAndRender();

projects/annotating-tool.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ faculty:
88
researchers: null
99
advisors: null
1010
summary: >
11-
This project will develop an open-source annotation tool for use by the McGrath Lab. The lab studies the genomic and neural basis of the evolution of social and feeding behaviors using *C. elegans* and East African cichlid fishes, and its research methods include machine learning and automated behavioral analysis.
11+
This project will develop an open-source annotation tool for use by the McGrath Lab. The lab studies the genomic and neural basis of the evolution of social and feeding behaviors using C. elegans and East African cichlid fishes, and its research methods include machine learning and automated behavioral analysis.
1212
The project will use the Computer Vision Annotation Tool (CVAT) as a reference, a platform for annotating visual datasets, including images, video, and 3D data.
1313
tags:
1414
- Open-Source

0 commit comments

Comments
 (0)