diff --git a/controllers/administration.js b/controllers/administration.js index 828fffce9f..36f50e2fcf 100644 --- a/controllers/administration.js +++ b/controllers/administration.js @@ -2678,6 +2678,13 @@ router.all('/teams', async (req, res, next) => { baseUrl: `/administration/teams/?p={{page}}${sortQuery}${limitQuery}`, }; + const compare = (a, b) => (a > b) - (a < b); + + users.sort((a, b) => ( + compare(a.lastName.toLowerCase(), b.lastName.toLowerCase()) + || compare(a.firstName.toLowerCase(), b.firstName.toLowerCase()) + )); + users = users.filter((user) => !isUserHidden(user, res.locals.currentSchoolData)); res.render('administration/teams', { diff --git a/views/administration/forms/form-teams.hbs b/views/administration/forms/form-teams.hbs index d9930e2241..cb1cc7e01e 100644 --- a/views/administration/forms/form-teams.hbs +++ b/views/administration/forms/form-teams.hbs @@ -3,15 +3,11 @@
{{{course.name}}} - {{#each users}} {{/each}}