web/views/formrenderers.py
changeset 4587 70d47389630c
parent 4573 fc6bb020e60e
child 4625 d8c3a50a8ee7
equal deleted inserted replaced
4567:bf3453789887 4587:70d47389630c
    90         if form.redirect_path:
    90         if form.redirect_path:
    91             w(tags.input(type='hidden', name='__redirectpath', value=form.redirect_path))
    91             w(tags.input(type='hidden', name='__redirectpath', value=form.redirect_path))
    92         self.render_fields(w, form, values)
    92         self.render_fields(w, form, values)
    93         self.render_buttons(w, form)
    93         self.render_buttons(w, form)
    94         w(u'</fieldset>')
    94         w(u'</fieldset>')
    95         w(u'</form>')
    95         w(self.close_form(form, values))
    96         errormsg = self.error_message(form)
    96         errormsg = self.error_message(form)
    97         if errormsg:
    97         if errormsg:
    98             data.insert(0, errormsg)
    98             data.insert(0, errormsg)
    99         return '\n'.join(data)
    99         return '\n'.join(data)
   100 
   100 
   168         if form.cssclass:
   168         if form.cssclass:
   169             tag += ' class="%s"' % xml_escape(form.cssclass)
   169             tag += ' class="%s"' % xml_escape(form.cssclass)
   170         if form.cwtarget:
   170         if form.cwtarget:
   171             tag += ' cubicweb:target="%s"' % xml_escape(form.cwtarget)
   171             tag += ' cubicweb:target="%s"' % xml_escape(form.cwtarget)
   172         return tag + '>'
   172         return tag + '>'
       
   173 
       
   174     def close_form(self, form, values):
       
   175         """seem dump but important for consistency w/ close form, and necessary
       
   176         for form renderers overriding open_form to use something else or more than
       
   177         and <form>
       
   178         """
       
   179         return '</form>'
   173 
   180 
   174     def render_fields(self, w, form, values):
   181     def render_fields(self, w, form, values):
   175         fields = self._render_hidden_fields(w, form)
   182         fields = self._render_hidden_fields(w, form)
   176         if fields:
   183         if fields:
   177             self._render_fields(fields, w, form)
   184             self._render_fields(fields, w, form)