]>
Commit | Line | Data |
---|---|---|
4aa8ba86 MG |
1 | package Gruntmaster::Page::Us; |
2 | ||
3 | use 5.014000; | |
4 | use strict; | |
5 | use warnings; | |
bb95f538 MG |
6 | use Gruntmaster::Page::Base us => 'Users'; |
7 | our @ISA = qw/Gruntmaster::Page::Base/; | |
4aa8ba86 MG |
8 | our $VERSION = '0.001'; |
9 | ||
bb95f538 | 10 | use constant TEMPLATES => { |
4aa8ba86 | 11 | en => <<'HTML', |
a94f8453 | 12 | <div class="list-group"><tmpl_loop users><a class="list-group-item" href="<tmpl_var id>"><tmpl_var name></a> |
f7d696bc | 13 | </tmpl_loop></ol> |
4aa8ba86 | 14 | HTML |
bb95f538 | 15 | }; |
4aa8ba86 | 16 | |
bb95f538 | 17 | sub _generate{ |
191f4979 MG |
18 | my ($self, $htc, $lang, $env) = @_; |
19 | debug $env => "language is '$lang'"; | |
4aa8ba86 | 20 | |
f7d696bc MG |
21 | $htc->param(users => [ sort { lc $a->{name} cmp lc $b->{name} } |
22 | map { {id => $_, name => user_name} } | |
23 | grep { user_name =~ /\w/ } users ]); | |
4aa8ba86 MG |
24 | } |
25 | ||
26 | 1 |