Skip to content
Snippets Groups Projects
Commit b3f11a9075c6 authored by Katia Saurfelt's avatar Katia Saurfelt
Browse files

[main template] clean the TheMainTemplate structure

parent bc487b9ade28
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,12 @@
self.template_footer(view)
@monkeypatch(basetemplates.TheMainTemplate)
def template_header(self, content_type, view=None, page_title='', additional_headers=()):
page_title = page_title or view.page_title()
additional_headers = additional_headers or view.html_headers()
self.template_html_header(content_type, page_title, additional_headers)
@monkeypatch(basetemplates.TheMainTemplate)
def template_html_header(self, content_type, page_title,
additional_headers=()):
w = self.whead
......@@ -56,12 +62,6 @@
if page_title:
w(u'<title>%s</title>\n' % xml_escape(page_title))
@monkeypatch(basetemplates.TheMainTemplate)
def template_body_header(self, view):
self.w(u'<body>\n')
self.wview('header', rset=self.cw_rset, view=view)
@monkeypatch(basetemplates.TheMainTemplate)
def template_page_content(self, view):
w = self.w
......@@ -65,6 +65,8 @@
@monkeypatch(basetemplates.TheMainTemplate)
def template_page_content(self, view):
w = self.w
self.w(u'<body>\n')
self.wview('header', rset=self.cw_rset, view=view)
w(u'<div id="page" class="container">\n')
w(u'<div class="row">\n')
left_boxes = list(self._cw.vreg['ctxcomponents'].poss_visible_objects(
......@@ -79,6 +81,8 @@
self.content_column(view, content_cols)
self.nav_column(view, right_boxes, 'right')
self.w(u'</div>\n') # closes class=row
self.w(u'</div>\n') # closes id="page" from template_page_content
self.w(u'</body>\n')
@monkeypatch(basetemplates.TheMainTemplate)
def get_components(self, view, context):
......@@ -87,7 +91,6 @@
rset=self.cw_rset,
view=view,
context=context)
@monkeypatch(basetemplates.TheMainTemplate)
def state_header(self):
state = self._cw.search_state
......@@ -149,11 +152,6 @@
@monkeypatch(basetemplates.TheMainTemplate)
def content_footer(self, view=None):
self.wview('contentfooter', rset=self.cw_rset, view=view)
@monkeypatch(basetemplates.TheMainTemplate)
def content_components(self, view, components):
"""TODO : should use context"""
rqlcomp = components.select_or_none('rqlinput', self._cw, rset=self.cw_rset)
......@@ -174,9 +172,6 @@
@monkeypatch(basetemplates.TheMainTemplate)
def template_footer(self, view=None):
self.wview('footer', rset=self.cw_rset)
self.w(u'</div>\n') # closes id="page"
self.w(u'</body>\n')
# main header
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment