author | Sylvain Thénault <sylvain.thenault@logilab.fr> |
Thu, 16 Sep 2010 18:43:40 +0200 | |
branch | stable |
changeset 6277 | 83179ccbda1f |
parent 6246 | 62e25fac41cd |
child 6283 | c827fa795a6b |
permissions | -rw-r--r-- |
6246
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
1 |
# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
2 |
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
3 |
# |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
4 |
# This file is part of CubicWeb. |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
5 |
# |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
6 |
# CubicWeb is free software: you can redistribute it and/or modify it under the |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
7 |
# terms of the GNU Lesser General Public License as published by the Free |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
8 |
# Software Foundation, either version 2.1 of the License, or (at your option) |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
9 |
# any later version. |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
10 |
# |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
11 |
# CubicWeb is distributed in the hope that it will be useful, but WITHOUT |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
13 |
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
14 |
# details. |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
15 |
# |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
16 |
# You should have received a copy of the GNU Lesser General Public License along |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
17 |
# with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
18 |
""" |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
19 |
mainly regression-preventing tests for reledit/doreledit views |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
20 |
""" |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
21 |
|
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
22 |
from cubicweb.devtools.testlib import CubicWebTC |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
23 |
from cubicweb.web.uicfg import reledit_ctrl |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
24 |
|
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
25 |
class ReleditMixinTC(object): |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
26 |
|
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
27 |
def setup_database(self): |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
28 |
self.req = self.request() |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
29 |
self.proj = self.req.create_entity('Project', title=u'cubicweb-world-domination') |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
30 |
self.tick = self.req.create_entity('Ticket', title=u'write the code') |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
31 |
self.toto = self.req.create_entity('Personne', nom=u'Toto') |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
32 |
|
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
33 |
class ClickAndEditFormTC(ReleditMixinTC, CubicWebTC): |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
34 |
|
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
35 |
def test_default_config(self): |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
36 |
reledit = {'title': """<div id="title-subject-917-reledit" onmouseout="jQuery('#title-subject-917').addClass('hidden')" onmouseover="jQuery('#title-subject-917').removeClass('hidden')" class="releditField"><div id="title-subject-917-value" class="editableFieldValue">cubicweb-world-domination</div><div id="title-subject-917" class="editableField hidden"><div id="title-subject-917-update" class="editableField" onclick="cw.reledit.loadInlineEditionForm('base', 917, 'title', 'subject', 'title-subject-917', false, '', '&lt;title not specified&gt;');" title="click to edit this field"><img title="click to edit this field" src="data/pen_icon.png" alt="click to edit this field"/></div></div></div>""", |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
37 |
'long_desc': """<div id="long_desc-subject-917-reledit" onmouseout="jQuery('#long_desc-subject-917').addClass('hidden')" onmouseover="jQuery('#long_desc-subject-917').removeClass('hidden')" class="releditField"><div id="long_desc-subject-917-value" class="editableFieldValue"><long_desc not specified></div><div id="long_desc-subject-917" class="editableField hidden"><div id="long_desc-subject-917-add" class="editableField" onclick="cw.reledit.loadInlineEditionForm('edition', 917, 'long_desc', 'subject', 'long_desc-subject-917', false, 'incontext', '&lt;long_desc not specified&gt;');" title="click to add a value"><img title="click to add a value" src="data/plus.png" alt="click to add a value"/></div></div></div>""", |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
38 |
'manager': """<div id="manager-subject-917-reledit" onmouseout="jQuery('#manager-subject-917').addClass('hidden')" onmouseover="jQuery('#manager-subject-917').removeClass('hidden')" class="releditField"><div id="manager-subject-917-value" class="editableFieldValue"><manager not specified></div><div id="manager-subject-917" class="editableField hidden"><div id="manager-subject-917-update" class="editableField" onclick="cw.reledit.loadInlineEditionForm('base', 917, 'manager', 'subject', 'manager-subject-917', false, 'incontext', '&lt;manager not specified&gt;');" title="click to edit this field"><img title="click to edit this field" src="data/pen_icon.png" alt="click to edit this field"/></div></div></div>""", |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
39 |
'composite_card11_2ttypes': """<composite_card11_2ttypes not specified>""", |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
40 |
'concerns': """<concerns_object not specified>"""} |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
41 |
|
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
42 |
for rschema, ttypes, role in self.proj.e_schema.relation_definitions(includefinal=True): |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
43 |
if rschema not in reledit: |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
44 |
continue |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
45 |
rtype = rschema.type |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
46 |
self.assertTextEquals(reledit[rtype], self.proj.view('reledit', rtype=rtype, role=role), rtype) |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
47 |
|
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
48 |
def test_default_forms(self): |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
49 |
doreledit = {'title': """<div id="title-subject-917-reledit" onmouseout="jQuery('#title-subject-917').addClass('hidden')" onmouseover="jQuery('#title-subject-917').removeClass('hidden')" class="releditField"><div id="title-subject-917-value" class="editableFieldValue">cubicweb-world-domination</div><form action="http://testing.fr/cubicweb/validateform?__onsuccess=window.parent.cw.reledit.onSuccess" method="post" enctype="application/x-www-form-urlencoded" id="title-subject-917-form" onsubmit="return freezeFormButtons('title-subject-917-form');" class="releditForm" cubicweb:target="eformframe"> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
50 |
<fieldset> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
51 |
<input name="__form_id" type="hidden" value="base" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
52 |
<input name="__errorurl" type="hidden" value="http://testing.fr/cubicweb/view?rql=Blop&vid=blop#title-subject-917-form" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
53 |
<input name="__domid" type="hidden" value="title-subject-917-form" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
54 |
<input name="__type:917" type="hidden" value="Project" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
55 |
<input name="eid" type="hidden" value="917" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
56 |
<input name="__maineid" type="hidden" value="917" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
57 |
<input name="__reledit|default_value" type="hidden" value="&lt;title not specified&gt;" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
58 |
<input name="__reledit|vid" type="hidden" value="" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
59 |
<input name="__reledit|rtype" type="hidden" value="title" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
60 |
<input name="__reledit|divid" type="hidden" value="title-subject-917" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
61 |
<input name="__reledit|formid" type="hidden" value="base" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
62 |
<input name="__reledit|reload" type="hidden" value="false" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
63 |
<input name="__reledit|role" type="hidden" value="subject" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
64 |
<input name="__reledit|eid" type="hidden" value="917" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
65 |
<input name="_cw_edited_fields:917" type="hidden" value="title-subject,__type" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
66 |
<fieldset class="default"> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
67 |
<table class=""> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
68 |
<tr class="title_subject_row"> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
69 |
<td |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
70 |
> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
71 |
<input id="title-subject:917" maxlength="32" name="title-subject:917" size="32" tabindex="1" type="text" value="cubicweb-world-domination" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
72 |
</td></tr> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
73 |
</table></fieldset> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
74 |
<table class="buttonbar"> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
75 |
<tr> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
76 |
|
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
77 |
<td><button class="validateButton" tabindex="2" type="submit" value="button_ok"><img alt="OK_ICON" src="http://crater:8080/data/ok.png" />button_ok</button></td> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
78 |
|
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
79 |
<td><button class="validateButton" onclick="cw.reledit.cleanupAfterCancel('title-subject-917')" tabindex="3" type="button" value="button_cancel"><img alt="CANCEL_ICON" src="http://crater:8080/data/cancel.png" />button_cancel</button></td> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
80 |
|
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
81 |
</tr></table> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
82 |
</fieldset> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
83 |
</form><div id="title-subject-917" class="editableField hidden"><div id="title-subject-917-update" class="editableField" onclick="cw.reledit.loadInlineEditionForm('base', 917, 'title', 'subject', 'title-subject-917', false, '', '&lt;title not specified&gt;');" title="click to edit this field"><img title="click to edit this field" src="data/pen_icon.png" alt="click to edit this field"/></div></div></div>""", |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
84 |
|
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
85 |
'long_desc': """<div id="long_desc-subject-917-reledit" onmouseout="jQuery('#long_desc-subject-917').addClass('hidden')" onmouseover="jQuery('#long_desc-subject-917').removeClass('hidden')" class="releditField"><div id="long_desc-subject-917-value" class="editableFieldValue"><long_desc not specified></div><form action="http://testing.fr/cubicweb/validateform?__onsuccess=window.parent.cw.reledit.onSuccess" method="post" enctype="application/x-www-form-urlencoded" id="long_desc-subject-917-form" onsubmit="return freezeFormButtons('long_desc-subject-917-form');" class="releditForm" cubicweb:target="eformframe"> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
86 |
<fieldset> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
87 |
<input name="__form_id" type="hidden" value="edition" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
88 |
<input name="__errorurl" type="hidden" value="http://testing.fr/cubicweb/view?rql=Blop&vid=blop#long_desc-subject-917-form" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
89 |
<input name="__domid" type="hidden" value="long_desc-subject-917-form" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
90 |
<input name="__type:A" type="hidden" value="Blog" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
91 |
<input name="eid" type="hidden" value="A" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
92 |
<input name="__maineid" type="hidden" value="A" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
93 |
<input name="__linkto" type="hidden" value="long_desc:917:object" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
94 |
<input name="__message" type="hidden" value="entity linked" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
95 |
<input name="__reledit|default_value" type="hidden" value="&lt;long_desc not specified&gt;" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
96 |
<input name="__reledit|vid" type="hidden" value="incontext" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
97 |
<input name="__reledit|rtype" type="hidden" value="long_desc" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
98 |
<input name="__reledit|divid" type="hidden" value="long_desc-subject-917" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
99 |
<input name="__reledit|formid" type="hidden" value="edition" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
100 |
<input name="__reledit|reload" type="hidden" value="false" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
101 |
<input name="__reledit|role" type="hidden" value="subject" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
102 |
<input name="__reledit|eid" type="hidden" value="917" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
103 |
<input name="_cw_edited_fields:A" type="hidden" value="title-subject,rss_url-subject,__type,description-subject" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
104 |
<fieldset class="default"> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
105 |
<table class="attributeForm"> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
106 |
<tr class="title_subject_row"> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
107 |
<th class="labelCol"><label class="required" for="title-subject:A">title</label></th> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
108 |
<td |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
109 |
> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
110 |
<input id="title-subject:A" maxlength="50" name="title-subject:A" size="45" tabindex="4" type="text" value="" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
111 |
</td></tr> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
112 |
<tr class="description_subject_row"> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
113 |
<th class="labelCol"><label for="description-subject:A">description</label></th> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
114 |
<td |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
115 |
> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
116 |
<input name="description_format-subject:A" type="hidden" value="text/html" /><textarea cols="80" cubicweb:type="wysiwyg" id="description-subject:A" name="description-subject:A" onkeyup="autogrow(this)" rows="2" tabindex="5"></textarea> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
117 |
</td></tr> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
118 |
<tr class="rss_url_subject_row"> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
119 |
<th class="labelCol"><label for="rss_url-subject:A">rss_url</label></th> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
120 |
<td |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
121 |
> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
122 |
<input id="rss_url-subject:A" maxlength="128" name="rss_url-subject:A" size="45" tabindex="6" type="text" value="" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
123 |
</td></tr> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
124 |
</table></fieldset> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
125 |
<table class="buttonbar"> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
126 |
<tr> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
127 |
|
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
128 |
<td><button class="validateButton" tabindex="7" type="submit" value="button_ok"><img alt="OK_ICON" src="http://crater:8080/data/ok.png" />button_ok</button></td> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
129 |
|
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
130 |
<td><button class="validateButton" onclick="cw.reledit.cleanupAfterCancel('long_desc-subject-917')" tabindex="8" type="button" value="button_cancel"><img alt="CANCEL_ICON" src="http://crater:8080/data/cancel.png" />button_cancel</button></td> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
131 |
|
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
132 |
</tr></table> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
133 |
</fieldset> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
134 |
</form><div id="long_desc-subject-917" class="editableField hidden"><div id="long_desc-subject-917-add" class="editableField" onclick="cw.reledit.loadInlineEditionForm('edition', 917, 'long_desc', 'subject', 'long_desc-subject-917', false, 'incontext', '&lt;long_desc not specified&gt;');" title="click to add a value"><img title="click to add a value" src="data/plus.png" alt="click to add a value"/></div></div></div>""", |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
135 |
|
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
136 |
'manager': """<div id="manager-subject-917-reledit" onmouseout="jQuery('#manager-subject-917').addClass('hidden')" onmouseover="jQuery('#manager-subject-917').removeClass('hidden')" class="releditField"><div id="manager-subject-917-value" class="editableFieldValue"><manager not specified></div><form action="http://testing.fr/cubicweb/validateform?__onsuccess=window.parent.cw.reledit.onSuccess" method="post" enctype="application/x-www-form-urlencoded" id="manager-subject-917-form" onsubmit="return freezeFormButtons('manager-subject-917-form');" class="releditForm" cubicweb:target="eformframe"> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
137 |
<fieldset> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
138 |
<input name="__form_id" type="hidden" value="base" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
139 |
<input name="__errorurl" type="hidden" value="http://testing.fr/cubicweb/view?rql=Blop&vid=blop#manager-subject-917-form" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
140 |
<input name="__domid" type="hidden" value="manager-subject-917-form" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
141 |
<input name="__type:917" type="hidden" value="Project" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
142 |
<input name="eid" type="hidden" value="917" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
143 |
<input name="__maineid" type="hidden" value="917" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
144 |
<input name="__linkto" type="hidden" value="long_desc:917:object" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
145 |
<input name="__message" type="hidden" value="entity linked" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
146 |
<input name="__reledit|default_value" type="hidden" value="&lt;manager not specified&gt;" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
147 |
<input name="__reledit|vid" type="hidden" value="incontext" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
148 |
<input name="__reledit|rtype" type="hidden" value="manager" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
149 |
<input name="__reledit|divid" type="hidden" value="manager-subject-917" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
150 |
<input name="__reledit|formid" type="hidden" value="base" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
151 |
<input name="__reledit|reload" type="hidden" value="false" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
152 |
<input name="__reledit|role" type="hidden" value="subject" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
153 |
<input name="__reledit|eid" type="hidden" value="917" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
154 |
<input name="_cw_edited_fields:917" type="hidden" value="manager-subject,__type" /> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
155 |
<fieldset class="default"> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
156 |
<table class=""> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
157 |
<tr class="manager_subject_row"> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
158 |
<td |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
159 |
> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
160 |
<select id="manager-subject:917" name="manager-subject:917" size="1" tabindex="9"> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
161 |
<option value="__cubicweb_internal_field__"></option> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
162 |
<option value="919">Toto</option> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
163 |
</select> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
164 |
</td></tr> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
165 |
</table></fieldset> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
166 |
<table class="buttonbar"> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
167 |
<tr> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
168 |
|
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
169 |
<td><button class="validateButton" tabindex="10" type="submit" value="button_ok"><img alt="OK_ICON" src="http://crater:8080/data/ok.png" />button_ok</button></td> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
170 |
|
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
171 |
<td><button class="validateButton" onclick="cw.reledit.cleanupAfterCancel('manager-subject-917')" tabindex="11" type="button" value="button_cancel"><img alt="CANCEL_ICON" src="http://crater:8080/data/cancel.png" />button_cancel</button></td> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
172 |
|
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
173 |
</tr></table> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
174 |
</fieldset> |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
175 |
</form><div id="manager-subject-917" class="editableField hidden"><div id="manager-subject-917-update" class="editableField" onclick="cw.reledit.loadInlineEditionForm('base', 917, 'manager', 'subject', 'manager-subject-917', false, 'incontext', '&lt;manager not specified&gt;');" title="click to edit this field"><img title="click to edit this field" src="data/pen_icon.png" alt="click to edit this field"/></div></div></div>""", |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
176 |
'composite_card11_2ttypes': """<composite_card11_2ttypes not specified>""", |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
177 |
'concerns': """<concerns_object not specified>""" |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
178 |
} |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
179 |
for rschema, ttypes, role in self.proj.e_schema.relation_definitions(includefinal=True): |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
180 |
if rschema not in doreledit: |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
181 |
continue |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
182 |
rtype = rschema.type |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
183 |
self.assertTextEquals(doreledit[rtype], |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
184 |
self.proj.view('doreledit', rtype=rtype, role=role, |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
185 |
formid='edition' if rtype == 'long_desc' else 'base'), |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
186 |
rtype) |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
187 |
|
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
188 |
class ClickAndEditFormUICFGTC(ReleditMixinTC, CubicWebTC): |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
189 |
|
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
190 |
def setup_database(self): |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
191 |
super(ClickAndEditFormUICFGTC, self).setup_database() |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
192 |
self.tick.set_relations(concerns=self.proj) |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
193 |
self.proj.set_relations(manager=self.toto) |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
194 |
|
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
195 |
def test_with_uicfg(self): |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
196 |
old_rctl = reledit_ctrl._tagdefs.copy() |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
197 |
reledit_ctrl.tag_attribute(('Project', 'title'), |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
198 |
{'default_value': '<title is required>', 'reload': True}) |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
199 |
reledit_ctrl.tag_subject_of(('Project', 'long_desc', '*'), |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
200 |
{'reload': True, 'edit_target': 'rtype', |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
201 |
'default_value': u'<long_desc is required>'}) |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
202 |
reledit_ctrl.tag_subject_of(('Project', 'manager', '*'), |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
203 |
{'edit_target': 'related'}) |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
204 |
reledit_ctrl.tag_subject_of(('Project', 'composite_card11_2ttypes', '*'), |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
205 |
{'edit_target': 'related'}) |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
206 |
reledit_ctrl.tag_object_of(('Ticket', 'concerns', 'Project'), |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
207 |
{'edit_target': 'rtype'}) |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
208 |
reledit = { |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
209 |
'title': """<div id="title-subject-917-reledit" onmouseout="jQuery('#title-subject-917').addClass('hidden')" onmouseover="jQuery('#title-subject-917').removeClass('hidden')" class="releditField"><div id="title-subject-917-value" class="editableFieldValue">cubicweb-world-domination</div><div id="title-subject-917" class="editableField hidden"><div id="title-subject-917-update" class="editableField" onclick="cw.reledit.loadInlineEditionForm('base', 917, 'title', 'subject', 'title-subject-917', true, '', '<title is required>');" title="click to edit this field"><img title="click to edit this field" src="data/pen_icon.png" alt="click to edit this field"/></div></div></div>""", |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
210 |
'long_desc': """<div id="long_desc-subject-917-reledit" onmouseout="jQuery('#long_desc-subject-917').addClass('hidden')" onmouseover="jQuery('#long_desc-subject-917').removeClass('hidden')" class="releditField"><div id="long_desc-subject-917-value" class="editableFieldValue"><long_desc is required></div><div id="long_desc-subject-917" class="editableField hidden"><div id="long_desc-subject-917-update" class="editableField" onclick="cw.reledit.loadInlineEditionForm('base', 917, 'long_desc', 'subject', 'long_desc-subject-917', true, 'incontext', '<long_desc is required>');" title="click to edit this field"><img title="click to edit this field" src="data/pen_icon.png" alt="click to edit this field"/></div></div></div>""", |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
211 |
'manager': """<div id="manager-subject-917-reledit" onmouseout="jQuery('#manager-subject-917').addClass('hidden')" onmouseover="jQuery('#manager-subject-917').removeClass('hidden')" class="releditField"><div id="manager-subject-917-value" class="editableFieldValue"><a href="http://testing.fr/cubicweb/personne/919" title="">Toto</a></div><div id="manager-subject-917" class="editableField hidden"><div id="manager-subject-917-update" class="editableField" onclick="cw.reledit.loadInlineEditionForm('edition', 917, 'manager', 'subject', 'manager-subject-917', false, 'incontext', '&lt;manager not specified&gt;');" title="click to edit this field"><img title="click to edit this field" src="data/pen_icon.png" alt="click to edit this field"/></div><div id="manager-subject-917-delete" class="editableField" onclick="cw.reledit.loadInlineEditionForm('deleteconf', 917, 'manager', 'subject', 'manager-subject-917', false, 'incontext', '&lt;manager not specified&gt;');" title="click to delete this value"><img title="click to delete this value" src="data/cancel.png" alt="click to delete this value"/></div></div></div>""", |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
212 |
'composite_card11_2ttypes': """<composite_card11_2ttypes not specified>""", |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
213 |
'concerns': """<div id="concerns-object-917-reledit" onmouseout="jQuery('#concerns-object-917').addClass('hidden')" onmouseover="jQuery('#concerns-object-917').removeClass('hidden')" class="releditField"><div id="concerns-object-917-value" class="editableFieldValue"><a href="http://testing.fr/cubicweb/ticket/918" title="">write the code</a></div><div id="concerns-object-917" class="editableField hidden"><div id="concerns-object-917-update" class="editableField" onclick="cw.reledit.loadInlineEditionForm('base', 917, 'concerns', 'object', 'concerns-object-917', false, 'csv', '&lt;concerns_object not specified&gt;');" title="click to edit this field"><img title="click to edit this field" src="data/pen_icon.png" alt="click to edit this field"/></div></div></div>""" |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
214 |
} |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
215 |
for rschema, ttypes, role in self.proj.e_schema.relation_definitions(includefinal=True): |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
216 |
if rschema not in reledit: |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
217 |
continue |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
218 |
rtype = rschema.type |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
219 |
self.assertTextEquals(reledit[rtype], |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
220 |
self.proj.view('reledit', rtype=rtype, role=role), |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
221 |
rtype) |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
222 |
reledit_ctrl.clear() |
62e25fac41cd
[views/reledit] refactor composite handling
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
diff
changeset
|
223 |
reledit_ctrl._tagdefs.update(old_rctl) |