0f896421e12038250d1a85809300482df42cf517
[kivitendo-erp.git] / templates / webpages / simple_system_setting / list.html
1 [%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE T8 -%]
2
3 <h1>[% HTML.escape(title) %]</h1>
4
5 [%- INCLUDE 'common/flash.html' %]
6
7 <table width="100%" id="object_list">
8  <thead>
9   <tr class="listheading">
10    [% IF SELF.supports_reordering %]
11     <th align="center" width="1%"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></th>
12    [% END %]
13    [% FOREACH attribute = SELF.list_attributes %]
14     <th[% IF attribute.align %] align="[% attribute.align %]"[% END %]>[% HTML.escape(attribute.title) %]</th>
15    [% END %]
16   </tr>
17  </thead>
18
19  <tbody>
20   [%- FOREACH object = SELF.all_objects %]
21    <tr class="listrow" id="object_id_[% object.id %]">
22    [% IF SELF.supports_reordering %]
23     <td align="center" class="dragdrop">[% L.img_tag(src="image/updown.png", alt=LxERP.t8("reorder item")) %]</td>
24    [% END %][%# IF SELF.supports_reordering %]
25    [% FOREACH attribute = SELF.list_attributes %]
26     <td[% IF attribute.align %] align="[% attribute.align %]"[% END %]>
27      [% IF loop.count == 1 %]
28       <a href="[% SELF.url_for(action='edit', type=SELF.type, id=object.id) %]">
29      [% END %][%# IF loop.count == 0 %]
30      [% SET method = attribute.method
31             value  = attribute.exists('formatter') ? attribute.formatter(object) : object.$method ;
32         HTML.escape(value) %]
33      [% IF loop.count == 1 %]
34       </a>
35      [% END %][%# IF loop.count == 0 %]
36     </td>
37    [% END %][%# FOREACH attribute… %]
38    </tr>
39   [%- END %][%# FOREACH object… %]
40  </tbody>
41 </table>
42
43 [% IF SELF.supports_reordering %]
44 [% L.sortable_element("#object_list tbody", url=SELF.url_for(action="reorder", type=SELF.type), with="object_id") %]
45 [% END %]