Skip to content
Snippets Groups Projects
Commit 937da92c7c39 authored by Nicolas Chauvat's avatar Nicolas Chauvat
Browse files

upgrade to twitter bootstrap 3.0.0

parent 6317488364cb
No related branches found
No related tags found
No related merge requests found
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
web = 'http://www.cubicweb.org/project/%s' % distname web = 'http://www.cubicweb.org/project/%s' % distname
__depends__ = {'cubicweb': '>= 3.15.6', __depends__ = {'cubicweb': '>= 3.15.6',
'cubicweb-bootstrap': None, 'cubicweb-bootstrap': '>= 0.3.0',
} }
__recommends__ = {} __recommends__ = {}
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
self.set_request_content_type() self.set_request_content_type()
self.template_header(self.content_type, view) self.template_header(self.content_type, view)
w = self.w w = self.w
w(u'<div class="row-fluid">') w(u'<div class="row">')
w(u'<div class="span12" id="pageContent">') w(u'<div class="col-md-12" id="pageContent">')
vtitle = self._cw.form.get('vtitle') vtitle = self._cw.form.get('vtitle')
if vtitle: if vtitle:
w(u'<div class="vtitle">%s</div>\n' % xml_escape(vtitle)) w(u'<div class="vtitle">%s</div>\n' % xml_escape(vtitle))
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
w(u'</div>\n') # closes id=contentmain w(u'</div>\n') # closes id=contentmain
w(nav_html.getvalue()) w(nav_html.getvalue())
w(u'</div>\n' # closes id=pageContent w(u'</div>\n' # closes id=pageContent
u'</div>\n') # closes row-fluid u'</div>\n') # closes row
self.template_footer(view) self.template_footer(view)
...@@ -83,12 +83,12 @@ ...@@ -83,12 +83,12 @@
w = self.w w = self.w
w(u'<body>\n') w(u'<body>\n')
self.wview('header', rset=self.cw_rset, view=view) self.wview('header', rset=self.cw_rset, view=view)
w(u'<div id="page" class="container-fluid">\n' w(u'<div id="page" class="container">\n'
u'<div class="row-fluid">\n') u'<div class="row">\n')
#w(u'<div class="span3">') #w(u'<div class="col-md-3">')
nb_boxes = self.nav_column(view, 'left') nb_boxes = self.nav_column(view, 'left')
#w(u'</div>') #w(u'</div>')
if nb_boxes is not None and nb_boxes: if nb_boxes is not None and nb_boxes:
content_span = 9 content_span = 9
else: else:
content_span = 12 content_span = 12
...@@ -89,10 +89,10 @@ ...@@ -89,10 +89,10 @@
nb_boxes = self.nav_column(view, 'left') nb_boxes = self.nav_column(view, 'left')
#w(u'</div>') #w(u'</div>')
if nb_boxes is not None and nb_boxes: if nb_boxes is not None and nb_boxes:
content_span = 9 content_span = 9
else: else:
content_span = 12 content_span = 12
w(u'<div id="contentColumn" class="span%s">' % content_span) w(u'<div id="contentColumn" class="col-md-%s">' % content_span)
components = self._cw.vreg['components'] components = self._cw.vreg['components']
rqlcomp = components.select_or_none('rqlinput', self._cw, rset=self.cw_rset) rqlcomp = components.select_or_none('rqlinput', self._cw, rset=self.cw_rset)
if rqlcomp: if rqlcomp:
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
self.w(u'<div class="row">') self.w(u'<div class="row">')
self.content_footer(view) self.content_footer(view)
self.w(u'</div>') self.w(u'</div>')
self.w(u'</div>\n') # XXX closes div#contentColumn span9 in template_body_header self.w(u'</div>\n') # XXX closes div#contentColumn col-md-9 in template_body_header
self.nav_column(view, 'right') self.nav_column(view, 'right')
self.w(u'</div>\n') # XXX closes div#page in template_body_header self.w(u'</div>\n') # XXX closes div#page in template_body_header
self.wview('footer', rset=self.cw_rset) self.wview('footer', rset=self.cw_rset)
...@@ -111,8 +111,8 @@ ...@@ -111,8 +111,8 @@
self.nav_column(view, 'right') self.nav_column(view, 'right')
self.w(u'</div>\n') # XXX closes div#page in template_body_header self.w(u'</div>\n') # XXX closes div#page in template_body_header
self.wview('footer', rset=self.cw_rset) self.wview('footer', rset=self.cw_rset)
self.w(u'</div>' # closes class="row-fluid" self.w(u'</div>' # closes class="row"
u'</div>') # closes class="container-fluid" u'</div>') # closes class="container"
self.w(u'</body>') self.w(u'</body>')
@monkeypatch(basetemplates.TheMainTemplate) @monkeypatch(basetemplates.TheMainTemplate)
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
self._cw, rset=self.cw_rset, view=view, context=context)) self._cw, rset=self.cw_rset, view=view, context=context))
if boxes: if boxes:
getlayout = self._cw.vreg['components'].select getlayout = self._cw.vreg['components'].select
self.w(u'<div id="aside-main-%s" class="span3">\n' self.w(u'<div id="aside-main-%s" class="col-md-3">\n'
u'<div class="well">\n' % u'<div class="well">\n' %
context) # XXX Should arrange Facets soon context) # XXX Should arrange Facets soon
self.w(u'<div class="navboxes" id="navColumn%s">\n' % context.capitalize()) self.w(u'<div class="navboxes" id="navColumn%s">\n' % context.capitalize())
...@@ -136,12 +136,12 @@ ...@@ -136,12 +136,12 @@
@monkeypatch(basetemplates.HTMLPageHeader) @monkeypatch(basetemplates.HTMLPageHeader)
def main_header(self, view): def main_header(self, view):
"""build the top menu with authentification info and the rql box""" """build the top menu with authentification info and the rql box"""
spans = {'headtext': 'span2', spans = {'headtext': 'col-md-2',
'header-center': 'span9', 'header-center': 'col-md-9',
'header-right': 'span1 pull-right', 'header-right': 'col-md-1 pull-right',
} }
w = self.w w = self.w
w(u'<div id="header" class="navbar">' w(u'<div id="header" class="navbar">'
u'<div class="navbar-inner">' u'<div class="navbar-inner">'
u'<div class="container">') u'<div class="container">')
for colid, context in self.headers: for colid, context in self.headers:
...@@ -142,10 +142,10 @@ ...@@ -142,10 +142,10 @@
} }
w = self.w w = self.w
w(u'<div id="header" class="navbar">' w(u'<div id="header" class="navbar">'
u'<div class="navbar-inner">' u'<div class="navbar-inner">'
u'<div class="container">') u'<div class="container">')
for colid, context in self.headers: for colid, context in self.headers:
w(u'<div id="%s" class="%s">' % (colid, spans.get(colid, 'span2'))) w(u'<div id="%s" class="%s">' % (colid, spans.get(colid, 'col-md-2')))
components = self._cw.vreg['ctxcomponents'].poss_visible_objects( components = self._cw.vreg['ctxcomponents'].poss_visible_objects(
self._cw, rset=self.cw_rset, view=view, context=context) self._cw, rset=self.cw_rset, view=view, context=context)
for comp in components: for comp in components:
......
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