Ignore:
Timestamp:
07/28/12 09:20:21 (12 years ago)
Author:
nanardon
Message:

Use a generic filter to list objects

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts-Web/root/html/netzones/index.tt

    r1064 r1081  
    1 [% db = c.model('Accounts').db %] 
    2 <!-- $Id --> 
    3 <div style="float: right" id="filter"> 
     1<!-- $Id$ --> 
     2<div id="filter"> 
    43[% INCLUDE 'includes/filter.tt' 
    54   formuri = c.uri_for() 
    6    otype = 'netzone' 
    75%] 
    86</div> 
    97 
    10 [% IF c.req.param('attrval') %] 
    11 [% FOREACH netzonename = netzonelist.sort %] 
    12 [% IF loop.first %] 
    13 <table> 
    14 <tr><th colspan="2">[% netztype | html %]</th></tr> 
    15 [% END %] 
    16 <tr> 
    17     <td>[% netzonename | html %]</td> 
    18     <td> 
    19     <a href="[% c.uri_for('/netzones', netzonename) %]"> 
    20         <img src="[% c.uri_for('/static', 'icons', 'icon_edit.png') %]" 
    21             height="16" width="16" 
    22             alt="[% "edit " _ netzonename | html %]"></a> 
    23     </td> 
    24 </tr> 
    25 [% IF loop.last %] 
    26 </table> 
    27 [% END %] 
    28 [% END %] 
    29 [% ELSE %] 
    30  
    31 <table border="0"> 
    32 [% FOREACH netztype = [ 'dns', 'reverse', 'dhcp', 'puppet' ] %] 
    33 [% netzonelist = db.search_objects('netzone', 'type=' _ netztype) %] 
    34 [% FOREACH netzonename = netzonelist.sort %] 
    35 [% netzone = db.get_object('netzone', netzonename) %] 
    36 [% IF loop.first %] 
    37 <tr><th colspan="2">[% netztype | ucfirst | html %]</th></tr> 
    38 <tr><th>Nom</th><th>Description</th></tr> 
    39 [% END %] 
    40 <tr> 
    41     <td> 
    42     <a href="[% c.uri_for('/netzones', netzonename) %]"> 
    43         <img src="[% c.uri_for('/static', 'icons', 'icon_edit.png') %]" 
    44             height="16" width="16" 
    45             alt="[% "edit " _ netzonename | html %]"></a> 
    46         [% netzonename | html %] 
    47     </td> 
    48     <td> 
    49         <span title="[% netzone.get_c_field('description') | html %]"> 
    50         [% netzone.get_c_field('description') | truncate(20) | html %] 
    51         </span> 
    52     </td> 
    53 </tr> 
    54 [% IF loop.last %] 
    55 [% END %] 
    56 [% END %] 
    57 [% END %] 
    58 [% END %] [%# IF %] 
    59 </table> 
     8<div id="list_objects"> 
     9[% INCLUDE 'includes/list_objects.tt' %] 
     10</div> 
Note: See TracChangeset for help on using the changeset viewer.