Rename disinclude to exclude and style as soft badge

This commit is contained in:
tyuXX 2026-10-21 18:51:26 +00:00
parent d0fd394fbd
commit 573a249580
3 changed files with 39 additions and 17 deletions

View file

@ -23,8 +23,8 @@ document.addEventListener('DOMContentLoaded', () => {
assignmentList.addEventListener('click', async (e) => {
const target = e.target;
// Disinclude / Restore button
if (target.classList.contains('btn-disinclude')) {
// Exclude / Restore button
if (target.classList.contains('btn-exclude') || target.classList.contains('btn-disinclude')) {
const assignmentId = target.dataset.id;
const card = target.closest('.assignment-card');
if (!card) return;
@ -43,8 +43,8 @@ document.addEventListener('DOMContentLoaded', () => {
if (data.success && data.stats) {
card.dataset.excluded = newExcluded ? 'true' : 'false';
card.classList.toggle('is-excluded', newExcluded);
target.textContent = newExcluded ? 'Restore' : 'Disinclude';
target.title = newExcluded ? 'Restore this homework to your active list' : 'Disinclude this homework (e.g. from another class)';
target.textContent = newExcluded ? 'Restore' : 'Exclude';
target.title = newExcluded ? 'Restore this homework to your active list' : 'Exclude this homework (e.g. from another class)';
const checkbox = card.querySelector('.assignment-toggle');
if (checkbox) checkbox.disabled = newExcluded;
@ -55,7 +55,7 @@ document.addEventListener('DOMContentLoaded', () => {
if (badgesContainer) {
const b = document.createElement('span');
b.className = 'badge badge-excluded';
b.textContent = 'Disincluded';
b.textContent = 'Excluded';
badgesContainer.insertBefore(b, target);
}
} else if (!newExcluded && badgeExcluded) {
@ -66,7 +66,7 @@ document.addEventListener('DOMContentLoaded', () => {
applyFilters();
}
} catch (err) {
console.error('Failed to toggle disinclude:', err);
console.error('Failed to toggle exclude:', err);
} finally {
target.disabled = false;
}