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

@ -571,6 +571,8 @@ code {
.card-badges {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 4px;
}
@ -623,20 +625,40 @@ code {
border: 1px solid #cbd5e1;
}
.btn-exclude,
.btn-disinclude {
background: transparent;
border: 1px solid #cbd5e1;
color: var(--text-muted);
font-size: 0.7rem;
font-family: inherit;
font-size: 0.725rem;
font-weight: 600;
line-height: inherit;
display: inline-flex;
align-items: center;
padding: 1px 6px;
border-radius: 4px;
background: #f1f5f9;
color: #64748b;
border: 1px solid #e2e8f0;
cursor: pointer;
transition: all 0.15s ease;
user-select: none;
}
.btn-exclude:hover,
.btn-disinclude:hover {
background: #f1f5f9;
color: var(--text-main);
border-color: #94a3b8;
background: #e2e8f0;
color: #334155;
border-color: #cbd5e1;
}
.btn-exclude:active,
.btn-disinclude:active {
background: #cbd5e1;
}
.btn-exclude:focus-visible,
.btn-disinclude:focus-visible {
outline: 2px solid var(--primary);
outline-offset: 1px;
}
.assignment-card.is-excluded {

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;
}