asdasd
This commit is contained in:
@@ -234,9 +234,15 @@ export async function loadList(section) {
|
||||
return;
|
||||
}
|
||||
selectEl.disabled = false;
|
||||
items.forEach(item => {
|
||||
const sorted = items.slice().sort((a, b) => {
|
||||
const aActive = Number(a.is_active) === 1 ? 1 : 0;
|
||||
const bActive = Number(b.is_active) === 1 ? 1 : 0;
|
||||
if (aActive !== bActive) return bActive - aActive;
|
||||
return Number(b.id || 0) - Number(a.id || 0);
|
||||
});
|
||||
sorted.forEach(item => {
|
||||
const opt = document.createElement('option');
|
||||
const label = `#${item.version_no} – ${formatVersionDate(item.created_at)}` + (Number(item.is_active) === 1 ? ' (aktiv)' : '');
|
||||
const label = `${Number(item.is_active) === 1 ? '✓ ' : ''}#${item.version_no} – ${formatVersionDate(item.created_at)}` + (Number(item.is_active) === 1 ? ' (aktiv)' : '');
|
||||
opt.value = String(item.id);
|
||||
opt.textContent = label;
|
||||
selectEl.appendChild(opt);
|
||||
|
||||
Reference in New Issue
Block a user