1 | <html xmlns="http://www.w3.org/1999/xhtml" |
---|
2 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
---|
3 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
---|
4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
---|
5 | i18n:domain="plone"> |
---|
6 | |
---|
7 | <!-- DataGridWidget row renderer |
---|
8 | |
---|
9 | Render one row in DataGridWidget edit mode. |
---|
10 | By overriding this file, one can custom and provide different |
---|
11 | styles for rows in same DataGridWidget |
---|
12 | (condition logic is to be added by the customer). |
---|
13 | |
---|
14 | Author: Mikko Ohtamaa, 2006 |
---|
15 | |
---|
16 | --> |
---|
17 | |
---|
18 | <body> |
---|
19 | |
---|
20 | <!-- EDIT --> |
---|
21 | <metal:define define-macro="edit_row"> |
---|
22 | |
---|
23 | <tr id="datagridwidget-row" class="datagridwidget-row" |
---|
24 | tal:define="oddrow repeat/rows/odd" |
---|
25 | tal:condition="python: rows.get('orderindex_') != 'template_row_marker'" |
---|
26 | tal:attributes="class python:field.allow_oddeven and (oddrow and 'odd' or 'even') or nothing;"> |
---|
27 | |
---|
28 | <tal:vars define="fieldId string:${fieldName}_${repeat/rows/number};"> |
---|
29 | <tal:block tal:repeat="columnd columns"> |
---|
30 | <td tal:attributes="class python:not columnd['visible'] and 'dgw-hidden-column datagridwidget-cell' or 'datagridwidget-cell';"> |
---|
31 | <tal:cell tal:define=" |
---|
32 | column columnd/id; |
---|
33 | column_definition python: widget.getColumnDefinition(field, column); |
---|
34 | cell_macro python: path('here/%s/macros' % column_definition.getMacro()); |
---|
35 | edit_macro cell_macro/edit_cell; |
---|
36 | cell_value python:rows.get(column);"> |
---|
37 | <span metal:use-macro="edit_macro"/> |
---|
38 | </tal:cell> |
---|
39 | </td> |
---|
40 | </tal:block> |
---|
41 | |
---|
42 | <tal:comment replace="nothing"> |
---|
43 | Following code renders DataGridWidget manipulation buttons |
---|
44 | </tal:comment> |
---|
45 | |
---|
46 | <tal:call metal:use-macro="here/referencedatagridwidget_manipulators/macros/edit_manipulators"/> |
---|
47 | |
---|
48 | </tal:vars> |
---|
49 | </tr> |
---|
50 | |
---|
51 | </metal:define> |
---|
52 | |
---|
53 | <metal:define define-macro="edit_empty_row"> |
---|
54 | <tr id="datagridwidget-empty-row" |
---|
55 | class="datagridwidget-empty-row" |
---|
56 | tal:define="fieldId string:${fieldName}_new;"> |
---|
57 | <tal:block tal:repeat="columnd columns"> |
---|
58 | <td tal:attributes="class python:not columnd['visible'] and 'dgw-hidden-column datagridwidget-cell' or 'datagridwidget-cell';"> |
---|
59 | <span tal:define=" |
---|
60 | column columnd/id; |
---|
61 | column_definition python: widget.getColumnDefinition(field, column); |
---|
62 | cell_macro python: path('here/%s/macros' % column_definition.getMacro()); |
---|
63 | edit_empty_macro cell_macro/edit_empty_cell;"> |
---|
64 | <span metal:use-macro="edit_empty_macro"/> |
---|
65 | </span> |
---|
66 | </td> |
---|
67 | </tal:block> |
---|
68 | |
---|
69 | <tal:comment replace="nothing"> |
---|
70 | Following code renders DataGridWidget manipulation buttons |
---|
71 | </tal:comment> |
---|
72 | |
---|
73 | <tal:call metal:use-macro="here/referencedatagridwidget_manipulators/macros/edit_manipulators"/> |
---|
74 | |
---|
75 | </tr> |
---|
76 | </metal:define> |
---|
77 | </body> |
---|
78 | |
---|
79 | </html> |
---|