--- a/web/views/editforms.py Thu Jul 02 14:44:23 2009 +0200
+++ b/web/views/editforms.py Thu Jul 02 14:51:37 2009 +0200
@@ -368,8 +368,13 @@
divid = '%s-%s-%s' % (peid, rtype, entity.eid)
title = self.schema.rschema(rtype).display_name(self.req, role)
removejs = self.removejs % (peid, rtype,entity.eid)
+ countkey = '%s_count' % rtype
+ try:
+ self.req.data[countkey] += 1
+ except:
+ self.req.data[countkey] = 1
self.w(form.form_render(divid=divid, title=title, removejs=removejs,
- **kwargs))
+ counter=self.req.data[countkey], **kwargs))
def add_hiddens(self, form, entity, peid, rtype, role):
# to ease overriding (see cubes.vcsfile.views.forms for instance)
--- a/web/views/formrenderers.py Thu Jul 02 14:44:23 2009 +0200
+++ b/web/views/formrenderers.py Thu Jul 02 14:51:37 2009 +0200
@@ -500,7 +500,7 @@
w(u'<div class="iformBody">')
values['removemsg'] = self.req.__('remove this %s' % form.edited_entity.e_schema)
w(u'<div class="iformTitle"><span>%(title)s</span> '
- '#<span class="icounter">1</span> '
+ '#<span class="icounter">%(counter)s</span> '
'[<a href="javascript: %(removejs)s;noop();">%(removemsg)s</a>]</div>'
% values)
# cleanup values