Tables: initial ФИО order, click-to-sort columns, substring search
- identity group detail (and thus every student list) is ordered by full name; defense rows on the group page sorted by name + lab number - tablekit.js: click a header to sort (numeric-aware, ru locale), second click flips direction (▲/▼ indicator); search input with data-target filters rows by substring live - tables wired: group matrix (with data-sort on variant cells), defense table (data-sort on status/date), students table, lab assignment lists per group, groups list and labs list; name/number columns pre-marked ascending - non-sortable columns marked data-nosort (checkbox/actions)
This commit is contained in:
@@ -222,7 +222,7 @@ class GroupService(
|
||||
mustChangePassword = account.mustChangePassword,
|
||||
tempPassword = account.tempPassword,
|
||||
)
|
||||
}.sortedWith(Comparator { a, b -> studentNoComparator.compare(a.studentNo, b.studentNo) })
|
||||
}.sortedWith(compareBy({ it.fullName.lowercase() }, { it.studentNo }))
|
||||
return GroupDetail(group.id.toString(), group.name, group.taskDurationMin, rows)
|
||||
}
|
||||
|
||||
@@ -264,17 +264,4 @@ class GroupService(
|
||||
studentCount = enrollments.countByGroup_Id(group.id),
|
||||
taskDurationMin = group.taskDurationMin,
|
||||
)
|
||||
|
||||
private companion object {
|
||||
val studentNoComparator = Comparator<String> { a, b ->
|
||||
val left = a.toIntOrNull()
|
||||
val right = b.toIntOrNull()
|
||||
when {
|
||||
left != null && right != null -> left.compareTo(right)
|
||||
left != null -> -1
|
||||
right != null -> 1
|
||||
else -> a.compareTo(b)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user