|
1 <fieldset class="subentity"> |
|
2 <legend class="iformTitle" tal:content="python: label">relations</legend> |
|
3 <table id="relatedEntities" |
|
4 tal:define="pendings python: list(self.restore_pending_inserts(entity))"> |
|
5 <span tal:iter="row python: self.relations_table(entity)" tal:omit-tag="python: True"> |
|
6 <tr tal:condition="python: row[2]"> |
|
7 <th class="labelCol" tal:content="python: display_name(req, row[0].type, row[1])">relation name</th> |
|
8 <td> |
|
9 <ul> |
|
10 <li tal:iter="viewparams python: row[2]" class="invisible"> |
|
11 <span tal:replace="structure python:viewparams[1]">[del it if you can]</span> |
|
12 <div tal:attributes="id python: 'span'+viewparams[0]; class python: viewparams[2]" |
|
13 tal:content="structure python: viewparams[3]">related entity view</div> |
|
14 </li> |
|
15 <li class="invisible" |
|
16 tal:condition="python: not self.force_display and self.maxrelitems < len(row[2])" |
|
17 tal:content="structure python:self.force_display_link()"/> |
|
18 </ul> |
|
19 </td> |
|
20 </tr> |
|
21 </span> |
|
22 <tr tal:iter="row pendings" |
|
23 tal:attributes="id python: 'tr' + row[1]"> |
|
24 <!-- row: (relname, nodeid, js, url, eview) --> |
|
25 <th tal:content="python: row[3]">relation name</th> |
|
26 <td> |
|
27 <a class="handle" title="cancel this insert" |
|
28 tal:attributes="href python: row[2]">[x]</a> |
|
29 <a class="editionPending" |
|
30 tal:attributes="href python: row[4]; id python: 'a' + row[1]" |
|
31 tal:content="python: row[5]">entity\'s text_view</a> |
|
32 </td> |
|
33 </tr> |
|
34 <tr tal:condition="not:pendings"><th> </th><td> </td></tr> |
|
35 <tr class="separator" tal:attributes="id string: relationSelectorRow_$eid;"> |
|
36 <th class="labelCol"> |
|
37 <span i18n:content="add relation"></span> |
|
38 <select tal:attributes="id string: relationSelector_${eid}; |
|
39 tabindex req/next_tabindex; |
|
40 onchange string: javascript:showMatchingSelect(this.options[this.selectedIndex].value,${eid});"> |
|
41 <option value="" i18n:content="select a relation">select a relation</option> |
|
42 <option tal:iter="rel python: entity.srelations_by_category(('generic', 'metadata'), 'add')" |
|
43 tal:attributes="value python: '%s_%s' % (rel[1], rel[2])" |
|
44 tal:content="python: rel[0]">rel</option> |
|
45 </select> |
|
46 </th> |
|
47 <td tal:attributes="id string: unrelatedDivs_$eid"> |
|
48 </td> |
|
49 </tr> |
|
50 </table> |
|
51 </fieldset> |