web/views/basecontrollers.py
branchstable
changeset 1839 2cdd0d1d3888
parent 1838 d4cbcc15c01c
child 1844 ec51bf1b8be3
equal deleted inserted replaced
1838:d4cbcc15c01c 1839:2cdd0d1d3888
    34 
    34 
    35 def xhtml_wrap(self, source):
    35 def xhtml_wrap(self, source):
    36     # XXX factor out, watch view.py ~ Maintemplate.doctype
    36     # XXX factor out, watch view.py ~ Maintemplate.doctype
    37     if self.req.xhtml_browser():
    37     if self.req.xhtml_browser():
    38         dt = STRICT_DOCTYPE
    38         dt = STRICT_DOCTYPE
    39     dt = STRICT_DOCTYPE_NOEXT
    39     else:
       
    40         dt = STRICT_DOCTYPE_NOEXT
    40     head = u'<?xml version="1.0"?>\n' + dt
    41     head = u'<?xml version="1.0"?>\n' + dt
    41     return head + u'<div xmlns="http://www.w3.org/1999/xhtml" xmlns:cubicweb="http://www.logilab.org/2008/cubicweb">%s</div>' % source.strip()
    42     return head + u'<div xmlns="http://www.w3.org/1999/xhtml" xmlns:cubicweb="http://www.logilab.org/2008/cubicweb">%s</div>' % source.strip()
    42 
    43 
    43 def jsonize(func):
    44 def jsonize(func):
    44     """decorator to sets correct content_type and calls `simplejson.dumps` on
    45     """decorator to sets correct content_type and calls `simplejson.dumps` on