Changeset 239
- Timestamp:
- 06/07/09 11:54:26 (15 years ago)
- Location:
- LATMOS-Accounts-Web
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Sites.pm
r138 r239 26 26 27 27 my $base = $c->model('Accounts')->db; 28 my %filter = map { 29 $c->req->params->{attr}[$_] && $c->req->params->{attrval}[$_] 30 ? ($c->req->params->{attr}[$_] => $c->req->params->{attrval}[$_]) 31 : () 32 } (0 .. $#{ $c->req->params->{attr} || []}); 33 $c->stash->{siteslist} = %filter 34 ? [ $base->search_objects('site', %filter) ] 35 : [ $base->list_objects('site') ]; 28 $c->stash->{filter}->{otype} = 'site'; 29 $c->forward('filter'); 30 $c->stash->{siteslist} = [ map { $_->id } @{ $c->stash->{objectslist} } ]; 36 31 } 37 32 -
LATMOS-Accounts-Web/root/html/includes/filter.tt
r238 r239 1 1 <!-- $Id$ --> 2 2 [% ofilter = c.model('AttrFilter', otype) %] 3 <div id="filter">4 3 <p>Filtre:</p> 5 4 <form action="[% c.action.namespace %]" method="POST"> … … 22 21 <input type="submit"> 23 22 </form> 24 </div> -
LATMOS-Accounts-Web/root/html/sites/index.tt
r151 r239 2 2 <!-- $Id --> 3 3 <div style="float: right" id="filter"> 4 <p>Filtre:</p> 5 <form action="[% c.uri_for() %]" method="POST"> 6 [% FOREACH item = [0, 1, 2 ] %] 7 [% IF loop.first %] 8 <table border="0"> 9 <tr><th>Champs</th><th>contient:</th></tr> 10 [% END %] 11 <tr> 12 <td> 13 <select name="attr"> 14 <option value=""></option> 15 [% FOREACH f = db.list_canonical_fields('site', 'r') %] 16 <option value="[% f | html %]" [% ' selected="1"' IF c.req.params.attr.$item == f %]> 17 [% c.model('AttrForms').attr_label(f) | html %] 18 </option> 19 [% END %] 20 </select> 21 </td> 22 <td><input type="text" name="attrval" value="[% c.req.params.attrval.$item | html %]"></td></tr> 23 [% IF loop.last %] 24 </table> 25 [% END %] 26 [% END %] 27 28 <input type="submit"> 29 </form> 4 [% INCLUDE 'includes/filter.tt' 5 formuri = c.uri_for() 6 otype = 'site' 7 %] 30 8 </div> 31 9 32 <table border="0">33 10 <table border="0"> 34 11 <tr><td colspan="2">[% siteslist.size %] Sites</td></tr>
Note: See TracChangeset
for help on using the changeset viewer.