source: trunk/LATMOS-Accounts-Web/root/html/request/default.tt @ 1107

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

Add filter to object list

  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1<!-- $Id$ -->
2
3<h2>[% accreq.get_attributes('description') | html %]</h2>
4
5[% IF select_object %]
6<form action="[% c.uri_for('/request', accreq.id) %]">
7<input name=q value="[% c.req.param('q') | html %]" id="q"><br>
8
9<span style="display:none" id="list_objects_ind">Searching...</span>
10[% c.prototype.observe_field('q', {
11    url => c.uri_for('/ajax', 'select_objects_list', ofilter.otype),
12    with   => "'q='+value",
13    update => 'list_objects',
14    frequency => 1,
15    before => "document.getElementById('list_objects_ind').style.display='block';",
16    loaded => "document.getElementById('list_objects_ind').style.display='none';",
17}) %]
18
19<div id="list_objects">
20[% INCLUDE 'includes/select_objects_list.tt' %]
21</div>
22
23[% c.prototype.observe_field( 'obj',
24    {
25        update => "obj_span",
26        url => c.uri_for('/ajax', 'rawattr', accreq.get_attributes('oType')),
27        frequency => 1,
28        with   => "'attr=displayName&id=' + element.options[element.selectedIndex].text",
29    }
30) %]
31
32<span id="obj_span" style="margin-left: 1em"></span>
33<br>
34<input type="submit">
35</form>
36[% ELSE %]
37
38[% IF accreq.get_attributes('requireObject') %]
39<h3>[% datarequest.get_attributes('displayName') || datarequest.id %]</h3>
40[% END %]
41
42<form action="[% c.uri_for('/request', accreq.id, object.id) %]">
43[% FOREACH attr = datarequest.attributes %]
44[% IF loop.first %]
45<table>
46[% END %]
47<tr>
48[% attrinfo = datarequest.attribute_info(attr) %]
49<th>[% form.attr_label(attr, attrinfo.label) %]</th>
50<td>[% form.attr_field(attr) %]</td>
51</tr>
52[% IF loop.last %]
53<tr>
54<th>Date d'application</th>
55<td>
56[% form.attr_field('apply', { formtype => 'date', _noacl => 1, default => default_apply_date } ) %]
57</td>
58</tr>
59<tr><td></td><td>
60<input type="submit" name="send">
61</td></tr>
62</table>
63[% END %]
64[% END %]
65</form>
66
67[% END %]
Note: See TracBrowser for help on using the repository browser.