[boostrap] Support bootstrap 3.0 CSS (closes #3306560).
authorVladimir Popescu <vladimir.popescu@logilab.fr>
Mon, 09 Dec 2013 15:44:13 +0100
changeset 584 44f466ecc207
parent 583 6a390e8078ab
child 585 2a63796abb42
[boostrap] Support bootstrap 3.0 CSS (closes #3306560).
data/cubes.brainomics.css
views/basetemplates.py
views/browse.py
views/components.py
views/primary.py
views/startup.py
--- a/data/cubes.brainomics.css	Wed Dec 04 16:22:27 2013 +0100
+++ b/data/cubes.brainomics.css	Mon Dec 09 15:44:13 2013 +0100
@@ -7,7 +7,7 @@
  list-style-type: none;
  }
 
-.navbar a.brand {
+.navbar a.navbar-brand {
     display: block;
     padding: 15px 20px;
 }
@@ -18,4 +18,4 @@
 
 .navbar .nav > li > a {
    background: none;
-}
\ No newline at end of file
+}
--- a/views/basetemplates.py	Wed Dec 04 16:22:27 2013 +0100
+++ b/views/basetemplates.py	Mon Dec 09 15:44:13 2013 +0100
@@ -28,8 +28,8 @@
     self.set_request_content_type()
     self.template_header(self.content_type, view)
     w = self.w
-    w(u'<div class="row-fluid">')
-    w(u'<div class="span12" id="pageContent">')
+    w(u'<div class="row">')
+    w(u'<div class="col-md-12" id="pageContent">')
     vtitle = self._cw.form.get('vtitle')
     if vtitle:
         w(u'<div class="vtitle">%s</div>\n' % xml_escape(vtitle))
@@ -47,7 +47,7 @@
     w(u'</div>\n') # closes id=contentmain
     w(nav_html.getvalue())
     w(u'</div>\n' # closes id=pageContent
-      u'</div>\n') # closes row-fluid
+      u'</div>\n') # closes row
     self.template_footer(view)
 
 
@@ -68,7 +68,7 @@
         self._cw, rset=self.cw_rset, view=view, context=context))
     if boxes:
         getlayout = self._cw.vreg['components'].select
-        self.w(u'<div id="aside-main-%s" class="span3">\n' % context)
+        self.w(u'<div id="aside-main-%s" class="col-md-3">\n' % context)
         self.w(u'<div class="navboxes" id="navColumn%s">\n' % context.capitalize())
         for box in boxes:
             box.render(w=self.w, view=view)
@@ -110,21 +110,21 @@
     w(u'<body>\n')
     self.wview('header', rset=self.cw_rset, view=view)
     # Toolbar
-    w(u'<div id="toolbar" class="container-fluid">\n'
-      u'<div class="row-fluid offset3">\n')
+    w(u'<div id="toolbar" class="container">\n'
+      u'<div class="row col-md-offset-3">\n')
     self.nav_toolbar(view)
     w(u'</div></div>\n')
     # Page
-    w(u'<div id="page" class="container-fluid">\n'
-      u'<div class="row-fluid">\n')
-    #w(u'<div class="span3">')
+    w(u'<div id="page" class="container">\n'
+      u'<div class="row">\n')
+    #w(u'<div class="col-md-3">')
     nb_boxes = self.nav_column(view, 'left')
     #w(u'</div>')
     if nb_boxes is not None and nb_boxes:
         content_span = 9
     else:
         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']
     rqlcomp = components.select_or_none('rqlinput', self._cw, rset=self.cw_rset)
     if rqlcomp:
@@ -145,7 +145,7 @@
     w(u'<div id="header" class="navbar">'
       u'<div class="navbar-inner">'
       u'<div class="container">'
-      u'<div class="row-fluid">')
+      u'<div class="row">')
     prev_span_size = 0
     for colid, context in self.headers:
         components = self._cw.vreg['ctxcomponents'].poss_visible_objects(
@@ -153,7 +153,7 @@
         if components:
             span_size = spans.get(colid, 2) + prev_span_size
             prev_span_size = 0
-            w(u'<div id="%s" class="span%s">' % (colid, span_size))
+            w(u'<div id="%s" class="col-md-%s">' % (colid, span_size))
             klass = ' pull-right' if context in ('header-center', 'header-right') else ''
             w(u'<ul class="nav%s">' % klass)
             for comp in components:
@@ -193,8 +193,8 @@
     self.nav_column(view, 'right')
     self.w(u'</div>\n') # XXX closes div#page in template_body_header
     self.wview('footer', rset=self.cw_rset)
-    self.w(u'</div>'    # closes class="row-fluid"
-           u'</div>')   # closes class="container-fluid"
+    self.w(u'</div>'    # closes class="row"
+           u'</div>')   # closes class="container"
     self.w(u'</body>')
 
 
--- a/views/browse.py	Wed Dec 04 16:22:27 2013 +0100
+++ b/views/browse.py	Mon Dec 09 15:44:13 2013 +0100
@@ -30,7 +30,7 @@
     __regid__ = 'display-specific-entities'
 
     def call(self):
-        self.w(u'<div class="span12">')
+        self.w(u'<div class="col-md-12">')
         self.w(u'<h2>Display specific entities</h2>')
         self.w(u'<legend>%s</legend>' % self._cw._('Browse for identifiers file'))
         entities_form = self._cw.vreg['forms'].select('browse-identifiers-form', self._cw)
--- a/views/components.py	Wed Dec 04 16:22:27 2013 +0100
+++ b/views/components.py	Mon Dec 09 15:44:13 2013 +0100
@@ -195,7 +195,7 @@
                     icon = getattr(action, 'icon', 'edit')
                     title = self._cw._(action.title)
                     w(u'<a class="btn btn-primary btn-block" href="%s">' % action.url())
-                    w(u'<i class="icon-%s icon-white"></i>%s</a>' % (icon, title))
+                    w(u'<i class="glyphicon-%s glyphicon-white"></i>%s</a>' % (icon, title))
             w(u'</div>')
 
 
@@ -219,7 +219,7 @@
                 _id = link.__regid__
                 w(u'<a class="btn btn-primary btn-block download-ctx" id="%s" href="%s">'
                   % (_id, url))
-                w(u'<i class="icon-download icon-white"></i>%s</a>' % self._cw._(link.title))
+                w(u'<i class="glyphicon-download glyphicon-white"></i>%s</a>' % self._cw._(link.title))
             w(u'</div>')
             # Add on load the rql facet change
             self._cw.add_onload("""$(cw).bind('facets-content-loaded',
--- a/views/primary.py	Wed Dec 04 16:22:27 2013 +0100
+++ b/views/primary.py	Mon Dec 09 15:44:13 2013 +0100
@@ -65,7 +65,7 @@
     def display_main_col(self, entity):
         """ Render all relations of the 'relations' section, similarly to CW's primary view
         """
-        self.w(u'<div class="span12">')
+        self.w(u'<div class="col-md-12">')
         eschema = entity.e_schema
         for rschema, tschemas, role in eschema.relation_definitions(True):
             if rschema in VIRTUAL_RTYPES or rschema in META_RTYPES or rschema.final:
@@ -131,7 +131,7 @@
         # Header
         self.display_header(entity)
         # Main col
-        w(u'<div class="row-fluid">')
+        w(u'<div class="row">')
         self.display_main_col(entity)
         w(u'</div>')
         # Close table
@@ -182,14 +182,14 @@
         return data
 
     def display_main_col(self, entity):
-        self.w(u'<div class="span10">')
+        self.w(u'<div class="col-md-10">')
         # Detailed measures
         rset = self._cw.execute('Any X WHERE X concerns S, S eid %(e)s', {'e': entity.eid})
         if rset:
             self.w(u'<h3>%s</h3>' % xml_escape(self._cw._('Measures')))
             self.wview('list', rset=rset)
         self.w(u'</div>')
-        self.w(u'<div class="span10">')
+        self.w(u'<div class="col-md-10">')
         # Related external resources
         rset = self._cw.execute('Any E WHERE X external_resources E, S concerned_by X, S eid %(e)s, '
                                 'NOT EXISTS(X generates M)', {'e': entity.eid})
@@ -404,7 +404,7 @@
     def display_main_col(self, entity):
         w = self.w
         # Scores
-        self.w(u'<div class="span9">')
+        self.w(u'<div class="col-md-9">')
         rset = self._cw.execute('Any SD, S WHERE QR is GenericTestRun, QR eid %(e)s, '
                                 'S measure QR, S definition SD, S value V, S text T',
                                 {'e': entity.eid})
@@ -421,7 +421,7 @@
         w(u'</table>')
         self.w(u'</div>')
         # Related external resources
-        self.w(u'<div class="span3">')
+        self.w(u'<div class="col-md-3">')
         rset = self._cw.execute('(Any E WHERE X external_resources E, X eid %(e)s) '
                                 'UNION (Any E WHERE A generates X, A external_resources E, X eid %(e)s)',
                                 {'e': entity.eid})
--- a/views/startup.py	Wed Dec 04 16:22:27 2013 +0100
+++ b/views/startup.py	Mon Dec 09 15:44:13 2013 +0100
@@ -24,32 +24,32 @@
 class BrainomicsIndexView(IndexView):
 
     def call(self, **kwargs):
-        self.w(u'<div class="span12">')
-        self.w(u'<div class="row-fluid">')
+        self.w(u'<div class="col-md-12">')
+        self.w(u'<div class="row">')
         url = self._cw.data_url('images/subject.png')
         href = self._cw.build_url(rql='Any X WHERE X is Subject')
-        self.w(u'<div class="span3"><h2>Subjects</h2><a href="%s"><img width="200" src="%s"/></a></div>'
+        self.w(u'<div class="col-md-3"><h2>Subjects</h2><a href="%s"><img width="200" src="%s"/></a></div>'
                % (href, url))
         url = self._cw.data_url('images/images.png')
         href = self._cw.build_url(rql=('Any X, XT, XL, XI, XF, XD WHERE X is Scan, '
                                        'X type XT, X label XL, X identifier XI, '
                                        'X format XF, X description XD'))
-        self.w(u'<div class="span3"><h2>Images</h2><a href="%s"><img width="200" src="%s"/></a></div>'
+        self.w(u'<div class="col-md-3"><h2>Images</h2><a href="%s"><img width="200" src="%s"/></a></div>'
                % (href, url))
         url = self._cw.data_url('images/genetics.png')
         href = self._cw.build_url(rql='(Any X WHERE X is GenomicMeasure) '
                                   'UNION (Any X WHERE X is GenericTestRun, X instance_of T, T type "genomics")')
-        self.w(u'<div class="span3"><h2>Genetics</h2><a href="%s"><img width="200" src="%s"/></a></div>'
+        self.w(u'<div class="col-md-3"><h2>Genetics</h2><a href="%s"><img width="200" src="%s"/></a></div>'
                % (href, url))
         url = self._cw.data_url('images/questionnaire.png')
         href = self._cw.build_url(rql='Any X, XI, XD WHERE X is QuestionnaireRun, X identifier XI, X datetime XD')
-        self.w(u'<div class="span3"><h2>Questionnaires</h2><a href="%s"><img width="200" src="%s"/></a></div>'
+        self.w(u'<div class="col-md-3"><h2>Questionnaires</h2><a href="%s"><img width="200" src="%s"/></a></div>'
                % (href, url))
         self.w(u'</div>')
         self.w(u'</div>')
         self.w(u'</div>')
-        self.w(u'<div class="span12">')
-        self.w(u'<div class="row-fluid">')
+        self.w(u'<div class="col-md-12">')
+        self.w(u'<div class="row">')
         for title in ('index', 'rqlexamples'):
             card = self._cw.execute('Any X WHERE X is Card, X title %(t)s', {'t': title})
             if card: