[web templates] fix invalid html in main-no-top template; closes #2174806 stable
authorFlorent Cayré <florent.cayre@logilab.fr>
Mon, 27 Feb 2012 10:12:25 +0100
branchstable
changeset 8269 80d37fb56312
parent 8264 a4b009ba92ce
child 8278 3e8b94d921e0
[web templates] fix invalid html in main-no-top template; closes #2174806
web/test/unittest_views_basetemplates.py
web/views/basetemplates.py
--- a/web/test/unittest_views_basetemplates.py	Fri Feb 24 12:35:24 2012 +0100
+++ b/web/test/unittest_views_basetemplates.py	Mon Feb 27 10:12:25 2012 +0100
@@ -35,6 +35,13 @@
         self.set_option('allow-email-login', 'no')
         self.assertEqual(self._login_labels(), ['login', 'password'])
 
+
+class MainNoTopTemplateTC(CubicWebTC):
+
+    def test_valid_xhtml(self):
+        self.view('index', template='main-no-top')
+
+
 if __name__ == '__main__':
     from logilab.common.testlib import unittest_main
     unittest_main()
--- a/web/views/basetemplates.py	Fri Feb 24 12:35:24 2012 +0100
+++ b/web/views/basetemplates.py	Mon Feb 27 10:12:25 2012 +0100
@@ -256,10 +256,10 @@
         whead(u'\n'.join(additional_headers) + u'\n')
         self.wview('htmlheader', rset=self.cw_rset)
         w = self.w
-        w(u'<title>%s</title>\n' % xml_escape(page_title))
+        whead(u'<title>%s</title>\n' % xml_escape(page_title))
         w(u'<body>\n')
         w(u'<div id="page">')
-        w(u'<table width="100%" height="100%" border="0"><tr>\n')
+        w(u'<table width="100%" border="0" id="mainLayout"><tr>\n')
         w(u'<td id="navColumnLeft">\n')
         self.topleft_header()
         boxes = list(self._cw.vreg['ctxcomponents'].poss_visible_objects(
@@ -270,11 +270,7 @@
                 box.render(w=w)
             self.w(u'</div>\n')
         w(u'</td>')
-        w(u'<td id="contentcol" rowspan="2">')
-        w(u'<div id="pageContent">\n')
-        vtitle = self._cw.form.get('vtitle')
-        if vtitle:
-            w(u'<div class="vtitle">%s</div>' % xml_escape(vtitle))
+        w(u'<td id="contentColumn" rowspan="2">')
 
     def topleft_header(self):
         logo = self._cw.vreg['components'].select_or_none('logo', self._cw,