01fe4d9ff2eff2ec2c3faf41eb8a750e199c8195
[kivitendo-erp.git] / templates / webpages / csv_import / _preview.html
1 [% USE HTML %]
2 [% USE LxERP %]
3
4 [% IF SELF.data.size %]
5  <h3>
6   [%- IF SELF.import_status == 'tested' %]
7    [%- LxERP.t8('Import preview') %]
8   [%- ELSE %]
9    [%- LxERP.t8('Import result') %]
10   [%- END %]
11  </h3>
12
13  <table>
14   <tr class="listheading">
15    [%- FOREACH column = SELF.info_headers.headers %]
16     <th>[%- HTML.escape(column) %]</th>
17    [%- END %]
18    [%- FOREACH column = SELF.headers.headers %]
19     <th>[%- HTML.escape(column) %]</th>
20    [%- END %]
21    [%- FOREACH column = SELF.raw_data_headers.headers %]
22     <th>[%- HTML.escape(column) %]</th>
23    [%- END %]
24    <th>[%- LxERP.t8('Notes') %]</th>
25   </tr>
26
27   [%- FOREACH row = SELF.data %]
28   [%- IF (SELF.profile.get('full_preview') == 2) || ((SELF.profile.get('full_preview') == 1) && (row.errors.size || row.information.size)) || ((SELF.profile.get('full_preview') == 0) && (loop.count < 21)) %]
29   <tr class="[% IF row.errors.size %]redrow[% ELSE %]listrow[% END %][% loop.count % 2 %]">
30    [%- FOREACH method = SELF.info_headers.methods %]
31     <td>[%- HTML.escape(row.info_data.$method) %]</td>
32    [%- END %]
33    [%- FOREACH method = SELF.headers.methods %]
34     <td>[%- HTML.escape(row.object.$method) %]</td>
35    [%- END %]
36    [%- FOREACH method = SELF.raw_data_headers.headers %]
37     <td>[%- HTML.escape(row.raw_data.$method) %]</td>
38    [%- END %]
39    <td>
40     [%- FOREACH error = row.errors %][%- HTML.escape(error) %][% UNLESS loop.last %]<br>[%- END %][%- END %]
41     [%- FOREACH info  = row.information %][% IF !loop.first || row.errors.size %]<br>[%- END %][%- HTML.escape(info) %][%- END %]
42    </td>
43   </tr>
44   [%- END %]
45   [%- END %]
46
47  </table>
48 [%- END %]