source: trunk/LATMOS-Accounts-Web/root/html/includes/list_objects.tt @ 1082

Last change on this file since 1082 was 1082, checked in by nanardon, 12 years ago

Instanciate object only if need (big speedup)

File size: 1.1 KB
Line 
1
2[% IF objectslist.size > 20 %]
3
4[% FOREACH initial = initials %]
5[% IF c.req.param('start') == initial %]
6< [% initial %] >
7[% ELSE %]
8[% uparams.start = initial %]
9<a href="[% c.uri_for('', uparams) %]">[% initial %]</a>
10[% END %]
11[% END %]
12
13[% END %]
14
15[% otype = ofilter.otype %]
16[% attrs = c.config.objects.$otype.list %]
17[% IF NOT attrs %][% attrs = [ 'cn' ] %][% END %]
18
19<table border=0>
20<tr>
21<td></td>
22<th>Nom</th>
23[% FOREACH attr = attrs %]
24<th>[% attr | html %]</th>
25[% END %]
26</tr>
27
28[% IF c.req.param('start') %]
29[% objectslist = sublist %]
30[% END %]
31
32[% IF objectslist.size < 20 %]
33[% FOREACH name = objectslist %]
34[% object = db.get_object(ofilter.otype, name) %]
35<tr>
36    <td>
37    [% INCLUDE object_flag object = object %]
38    </td>
39    <td><a href="[% c.uri_for(object.id) %]">
40        <img src="[% c.uri_for('/static', 'icons', 'icon_edit.png') %]"
41            height="16" width="16"
42            alt="[% "edit " _ object.id | html %]"></a>
43    [% object.id | html %]</td>
44
45[% FOREACH attr = attrs %]
46<td>[% object.get_attributes(attr) | html %]</td>
47[% END %]
48</tr>
49[% END %]
50[% END %]
51
52</table>
53
Note: See TracBrowser for help on using the repository browser.