inline_creation_form doesn't take ptype argument anymore tls-sprint
authorsylvain.thenault@logilab.fr
Wed, 08 Apr 2009 13:16:16 +0200
branchtls-sprint
changeset 1292 18a86192c9c4
parent 1291 22b4d300d18d
child 1293 aae1516b6426
inline_creation_form doesn't take ptype argument anymore
web/data/cubicweb.edition.js
web/formrenderers.py
--- a/web/data/cubicweb.edition.js	Wed Apr 08 13:15:21 2009 +0200
+++ b/web/data/cubicweb.edition.js	Wed Apr 08 13:16:16 2009 +0200
@@ -256,12 +256,11 @@
 /*
  * makes an AJAX request to get an inline-creation view's content
  * @param peid : the parent entity eid
- * @param ptype : the parent entity type
  * @param ttype : the target (inlined) entity type
  * @param rtype : the relation type between both entities
  */
-function addInlineCreationForm(peid, ptype, ttype, rtype, role) {
-    var d = async_rawremote_exec('inline_creation_form', peid, ptype, ttype, rtype, role);
+function addInlineCreationForm(peid, ttype, rtype, role) {
+    var d = async_rawremote_exec('inline_creation_form', peid, ttype, rtype, role);
     d.addCallback(function (response) {
 	var linknode = getNode('add' + rtype + ':' + peid + 'link');
         var dom = getDomFromResponse(response);
--- a/web/formrenderers.py	Wed Apr 08 13:15:21 2009 +0200
+++ b/web/formrenderers.py	Wed Apr 08 13:16:16 2009 +0200
@@ -335,9 +335,8 @@
                 existant = entity.has_eid() and entity.related(rschema)
                 if existant:
                     # display inline-edition view for all existing related entities
-                    w(self.view('inline-edition', existant, rtype=rschema, role=role, 
-                                ptype=entity.e_schema, peid=entity.eid,
-                                **kwargs))
+                    w(form.view('inline-edition', existant, rtype=rschema, role=role, 
+                                ptype=entity.e_schema, peid=entity.eid))
                 if role == 'subject':
                     card = rschema.rproperty(entity.e_schema, targettype, 'cardinality')[0]
                 else:
@@ -354,8 +353,8 @@
                     divid = "addNew%s%s%s:%s" % (targettype, rschema, role, entity.eid)
                     w(u'<div class="inlinedform" id="%s" cubicweb:limit="true">'
                       % divid)
-                    js = "addInlineCreationForm('%s', '%s', '%s', '%s', '%s')" % (
-                        entity.eid, entity.e_schema, targettype, rschema, role)
+                    js = "addInlineCreationForm('%s', '%s', '%s', '%s')" % (
+                        entity.eid, targettype, rschema, role)
                     if card in '1?':
                         js = "toggleVisibility('%s'); %s" % (divid, js)
                     w(u'<a class="addEntity" id="add%s:%slink" href="javascript: %s" >+ %s.</a>'