From: Marius Gavrilescu Date: Mon, 20 Jan 2014 21:30:07 +0000 (+0200) Subject: Sort user list by name and exclude users with empty names X-Git-Url: http://git.ieval.ro/?p=gruntmaster-page.git;a=commitdiff_plain;h=f7d696bce1290f0b40dc1ee43f404eff2f71404b Sort user list by name and exclude users with empty names --- diff --git a/lib/Gruntmaster/Page/Us.pm b/lib/Gruntmaster/Page/Us.pm index 2095fd5..0a2e78a 100644 --- a/lib/Gruntmaster/Page/Us.pm +++ b/lib/Gruntmaster/Page/Us.pm @@ -9,15 +9,17 @@ our $VERSION = '0.001'; use constant TEMPLATES => { en => <<'HTML', - +
  1. +
HTML }; sub _generate{ my ($self, $htc, $path, $lang) = @_; - $htc->param(users => [ map { {id => $_, name => user_name} } users ]); + $htc->param(users => [ sort { lc $a->{name} cmp lc $b->{name} } + map { {id => $_, name => user_name} } + grep { user_name =~ /\w/ } users ]); } 1