1 | <tal:block define="mode options/mode; |
---|
2 | id here/getWidgetId; |
---|
3 | id_s string:${id}_s; |
---|
4 | id_g string:${id}_g; |
---|
5 | results options/datastructure/?id; |
---|
6 | subject options/datastructure/?id_s; |
---|
7 | grade options/datastructure/?id_g; |
---|
8 | grade_voc context/portal_vocabularies/exam_grades; |
---|
9 | subjects_voc context/portal_vocabularies/exam_subjects; |
---|
10 | "> |
---|
11 | <tal:block condition="python: mode == 'view'"> |
---|
12 | <div tal:repeat="res results"> |
---|
13 | <span tal:content="python:subjects_voc.get(res[0])" />: <span tal:content="python:grade_voc.get(res[1])" /> |
---|
14 | </div> |
---|
15 | </tal:block> |
---|
16 | <tal:block define="name here/getHtmlWidgetId;" |
---|
17 | condition="python: mode == 'edit'"> |
---|
18 | <table border=0 cellpadding=0 cellspacing=0> |
---|
19 | <tr><th>Subject</th><th>Grade</th> |
---|
20 | <tr tal:repeat="res results"> |
---|
21 | <span tal:define="wnr python:'%02d' % (repeat['res'].number())"> |
---|
22 | <td><select size="1" |
---|
23 | tal:attributes="name string:${name}${wnr}_s; |
---|
24 | id string:${name}_s;" |
---|
25 | > |
---|
26 | <option tal:repeat="sub subjects_voc/items" |
---|
27 | tal:attributes="value python:sub[0]; |
---|
28 | selected python: res[0] == sub[0];" |
---|
29 | tal:content="python: sub[1]"> |
---|
30 | </option> |
---|
31 | </select> |
---|
32 | </td> |
---|
33 | <td> |
---|
34 | <select size="1" |
---|
35 | tal:attributes="name string:${name}${wnr}_g; |
---|
36 | id string:${name}_g;" |
---|
37 | > |
---|
38 | <option tal:repeat="sub grade_voc/items" |
---|
39 | tal:attributes="value python:sub[0]; |
---|
40 | selected python: res[1] == sub[0]" |
---|
41 | tal:content="python: sub[1]"> |
---|
42 | </option> |
---|
43 | </select> |
---|
44 | </td> |
---|
45 | </span> |
---|
46 | </tr> |
---|
47 | <tr> |
---|
48 | <td colspan="2"> |
---|
49 | <hr /> |
---|
50 | </td> |
---|
51 | </tr> |
---|
52 | <tr> |
---|
53 | <td><select size="1" |
---|
54 | tal:attributes="name string:${name}_s; |
---|
55 | id string:${name}_s;"> |
---|
56 | <option tal:repeat="sub subjects_voc/items" |
---|
57 | tal:attributes="value python:sub[0]" |
---|
58 | tal:content="python: sub[1]"> |
---|
59 | </option> |
---|
60 | </select> |
---|
61 | </td> |
---|
62 | <td> |
---|
63 | <select size="1" |
---|
64 | tal:attributes="name string:${name}_g; |
---|
65 | id string:${name}_g;"> |
---|
66 | <option tal:repeat="sub grade_voc/items" |
---|
67 | tal:attributes="value python:sub[0]" |
---|
68 | tal:content="python: sub[1]"> |
---|
69 | </option> |
---|
70 | </select> |
---|
71 | </td> |
---|
72 | <td> |
---|
73 | <input type="submit" class="standalone" name="cpsdocument_edit_button" |
---|
74 | value="Add/Modify" |
---|
75 | id="cpsdocument_edit_button" /> |
---|
76 | </td> |
---|
77 | </tr> |
---|
78 | </table> |
---|
79 | </tal:block> |
---|
80 | </tal:block> |
---|