1 |
dpavlin |
37 |
package A3C::View; |
2 |
|
|
|
3 |
|
|
use strict; |
4 |
|
|
use warnings; |
5 |
|
|
|
6 |
|
|
use Jifty::View::Declare -base; |
7 |
|
|
use A3C::LDAP; |
8 |
|
|
|
9 |
|
|
use Data::Dump qw/dump/; |
10 |
|
|
|
11 |
|
|
|
12 |
|
|
template '/skole' => page { |
13 |
|
|
h1 { _('Schools in system') }; |
14 |
|
|
show 'skole_sve'; |
15 |
|
|
}; |
16 |
|
|
|
17 |
|
|
private template 'skole_sve' => sub { |
18 |
|
|
div { |
19 |
|
|
my $search = A3C::LDAP->search( |
20 |
|
|
base => 'dc=skole,dc=hr', |
21 |
|
|
filter => '(objectClass=hrEduOrg)', |
22 |
|
|
sizelimit => 10, |
23 |
|
|
); |
24 |
|
|
while ( my $entry = $search->shift_entry ) { |
25 |
|
|
#warn $entry->dump; |
26 |
|
|
ul { |
27 |
|
|
foreach my $attr ( $entry->attributes ) { |
28 |
|
|
li { |
29 |
|
|
tt { $attr } |
30 |
|
|
span { dump( $entry->get_value( $attr ) } |
31 |
|
|
} |
32 |
|
|
} |
33 |
|
|
} |
34 |
|
|
} |
35 |
|
|
} |
36 |
|
|
}; |
37 |
|
|
|