1 | <tal:block define="global creation python:1" /> |
---|
2 | <metal:block define-macro="default_edit" |
---|
3 | tal:define="layout options/layout; |
---|
4 | ds options/datastructure; |
---|
5 | creation creation|nothing; |
---|
6 | metadata metadata|nothing; |
---|
7 | type_name request/type_name|nothing; |
---|
8 | ti python:type_name and getattr(here.portal_types,type_name,None) or getattr(here.portal_types,here.portal_type,None); |
---|
9 | creation_form python:ti and ti.getActionById('create', 'cpsdocument_create_form') or 'cpsdocument_create_form' ; |
---|
10 | edit_form python:ti and ti.getActionById('edit', 'cpsdocument_edit_form') or 'cpsdocument_edit_form'; |
---|
11 | metadata_form python:ti and ti.getActionById('metadata', 'cpsdocument_metadata') or 'cpsdocument_metadata'; |
---|
12 | formaction options/formaction; |
---|
13 | first_layout options/first_layout|python:0; |
---|
14 | last_layout options/last_layout|python:0; |
---|
15 | is_flexible options/is_flexible; |
---|
16 | cpsmcat nocall:here/translation_service; |
---|
17 | results options/items; |
---|
18 | " |
---|
19 | > |
---|
20 | <span tal:content="structure layout" tal:condition="python: 0" /> |
---|
21 | <form tal:condition="python: 1" action='tobereplaced' method='post' tal:attributes="action formaction" |
---|
22 | enctype='multipart/form-data' class='workflow'> |
---|
23 | <div class=''> |
---|
24 | <div class='documentFields'> |
---|
25 | <table width="100%" cellpadding="2" cellspacing="2" summary="Form layout"> |
---|
26 | <tr tal:repeat="item results" valign="top"> |
---|
27 | <td> |
---|
28 | <table width="100%" cellpadding="2" cellspacing="2" summary="Form layout"> |
---|
29 | <tr tal:repeat="row layout/rows" valign="top"> |
---|
30 | <td tal:repeat="cell row" |
---|
31 | tal:attributes="colspan cell/ncols"> |
---|
32 | <tal:block define="widget cell/widget; |
---|
33 | wid widget/getWidgetId; |
---|
34 | dm options/datastructure/getDataModel; |
---|
35 | err python:ds.getError(wid); |
---|
36 | err_mapping python:ds.getErrorMapping(wid); |
---|
37 | is_required widget/is_required|nothing; |
---|
38 | tooltip_id python:wid + '_help'; |
---|
39 | widget_css_class cell/widget_css_class|nothing; |
---|
40 | widget_css_class python:test(is_flexible, 'group', widget_css_class); |
---|
41 | css_class python:test(err, 'row error', |
---|
42 | test(is_flexible, 'group', 'row'))" |
---|
43 | > |
---|
44 | <div tal:attributes="class widget_css_class; |
---|
45 | id python:widget.getHtmlWidgetId()+'_widget';" |
---|
46 | > |
---|
47 | <div class="label" tal:condition="widget/label_edit" |
---|
48 | tal:attributes="class python:test(is_required, 'label required','label')"> |
---|
49 | <label i18n:translate="" tal:condition="widget/is_i18n" |
---|
50 | tal:content="widget/label_edit" |
---|
51 | tal:attributes="for cell/widget_input_area_id|nothing;">label</label> |
---|
52 | <label tal:condition="not:widget/is_i18n" |
---|
53 | tal:content="widget/label_edit" |
---|
54 | tal:attributes="for cell/widget_input_area_id|nothing;">label</label> |
---|
55 | </div> |
---|
56 | <button type="button" class="tooltipControl" |
---|
57 | tal:condition="widget/help" |
---|
58 | tal:attributes="onclick python:'toggleElementVisibility(\'%s\')' % tooltip_id;"> ? </button> |
---|
59 | <div class="field"> |
---|
60 | <div tal:replace="structure cell/widget_rendered"/> |
---|
61 | </div> |
---|
62 | <div class="tooltipArea" style="visibility: hidden;" |
---|
63 | tal:condition="widget/help" |
---|
64 | tal:attributes="id tooltip_id; |
---|
65 | onclick python:'showElement(false, \'%s\')' % tooltip_id;" |
---|
66 | > |
---|
67 | <tal:block i18n:translate="" tal:condition="widget/is_i18n" |
---|
68 | tal:content="widget/help">i18_key-help_for_this_field</tal:block> |
---|
69 | <tal:block tal:condition="not:widget/is_i18n" |
---|
70 | tal:content="widget/help">This is the help for this field</tal:block> |
---|
71 | </div> |
---|
72 | <tal:block condition="err"> |
---|
73 | <tal:block define="msg python:cpsmcat(err, mapping=err_mapping)"> |
---|
74 | <br /><em style="color: red" |
---|
75 | tal:content="msg">err</em> |
---|
76 | </tal:block> |
---|
77 | </tal:block> |
---|
78 | </div> |
---|
79 | </tal:block> |
---|
80 | </td> |
---|
81 | </tr> |
---|
82 | </table> |
---|
83 | </td> |
---|
84 | </tr> |
---|
85 | <tr> |
---|
86 | <td align="left" colspan="3"> |
---|
87 | <input class="standalone" type="submit" name="change" value=" Change " /> |
---|
88 | <input class="standalone" type="submit" name="delete" value=" Delete " /> |
---|
89 | </td> |
---|
90 | </tr> |
---|
91 | </table> |
---|
92 | <table cellspacing="0" cellpadding="2" border="0" width="100%" tal:condition="nothing"> |
---|
93 | <tr> |
---|
94 | <td align="left" valign="top"> |
---|
95 | |
---|
96 | </td> |
---|
97 | <td align="left" valign="top"> |
---|
98 | <div class="label">Type</div> |
---|
99 | </td> |
---|
100 | <td align="left" valign="top"> |
---|
101 | <div class="label">Subject</div> |
---|
102 | </td> |
---|
103 | <td align="left" valign="top"> |
---|
104 | <div class="label">Result</div> |
---|
105 | </td> |
---|
106 | </tr> |
---|
107 | <span tal:repeat="row results" tal:condition="python: 0" tal:omit-tag=""> |
---|
108 | <tr tal:define="rindex repeat/row/index"> |
---|
109 | <td align="left" valign="top"> |
---|
110 | <input type="checkbox" name="keys:list" value="100" tal:attributes="value string:${repeat/row/index}"/> |
---|
111 | </td> |
---|
112 | <td align="left" valign="top"> |
---|
113 | <div class="field"> |
---|
114 | <input type="text" name="key_0" value="100" size="20" |
---|
115 | tal:attributes="name string:type_${rindex};value python:row[0]" /> |
---|
116 | </div> |
---|
117 | </td> |
---|
118 | <td align="left"> |
---|
119 | <div class="field"> |
---|
120 | <input type="text" name="label_0" value="Year 1 (100 Level)" size="40" |
---|
121 | tal:attributes="name string:subject_${rindex};value python:row[1]" /> |
---|
122 | </div> |
---|
123 | </td> |
---|
124 | <td align="left"> |
---|
125 | <div class="field"> |
---|
126 | <input type="text" name="msgid_0" value="" size="10" |
---|
127 | tal:attributes="name string:result_${rindex};value python:row[2]" /> |
---|
128 | </div> |
---|
129 | </td> |
---|
130 | </tr> |
---|
131 | </span> |
---|
132 | <tr> |
---|
133 | <td align="left" colspan="3"> |
---|
134 | <input class="standalone" type="submit" name="change" value=" Change " /> |
---|
135 | <input class="standalone" type="submit" name="delete" value=" Delete " /> |
---|
136 | </td> |
---|
137 | </tr> |
---|
138 | </table> |
---|
139 | <table tal:condition="python:0" cellspacing="0" cellpadding="2" border="0" width="100%"> |
---|
140 | <tr> |
---|
141 | <td align="left" valign="top" colspan="2"> |
---|
142 | <div>Add a new post-primary school result:</div> |
---|
143 | </td> |
---|
144 | </tr> |
---|
145 | <tr> |
---|
146 | <td align="left" valign="top"> |
---|
147 | |
---|
148 | </td> |
---|
149 | <td align="left" valign="top"> |
---|
150 | <div class="label">Type</div> |
---|
151 | </td> |
---|
152 | <td align="left" valign="top"> |
---|
153 | <div class="label">Subject</div> |
---|
154 | </td> |
---|
155 | <td align="left" valign="top"> |
---|
156 | <div class="label">Result</div> |
---|
157 | </td> |
---|
158 | </tr> |
---|
159 | <tr> |
---|
160 | <td align="left" valign="top"> |
---|
161 | |
---|
162 | </td> |
---|
163 | <td align="left" valign="top"> |
---|
164 | <div class="field"> |
---|
165 | <input type="text" name="type" value="" size="20" /> |
---|
166 | </div> |
---|
167 | </td> |
---|
168 | <td align="left"> |
---|
169 | <div class="field"> |
---|
170 | <input type="text" name="subject" value="" size="40" /> |
---|
171 | </div> |
---|
172 | </td> |
---|
173 | <td align="left"> |
---|
174 | <div class="field"> |
---|
175 | <input type="text" name="result" value="" size="10" /> |
---|
176 | </div> |
---|
177 | </td> |
---|
178 | </tr> |
---|
179 | <tr> |
---|
180 | <td align="left" colspan="3"> |
---|
181 | <input class="standalone" type="submit" name="add" value=" Change/Add " /> |
---|
182 | </td> |
---|
183 | </tr> |
---|
184 | </table> |
---|
185 | </form> |
---|
186 | </metal:block> |
---|
187 | |
---|