replace sideRelated with sideBox stable
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>
Wed, 20 May 2009 16:36:02 +0200
branchstable
changeset 1885 c2011d238e98
parent 1884 893119ce3fef
child 1889 874a055c373b
child 1890 108f3b6584b7
replace sideRelated with sideBox
web/box.py
web/data/cubicweb.css
web/htmlwidgets.py
web/views/idownloadable.py
web/views/primary.py
--- a/web/box.py	Wed May 20 16:35:37 2009 +0200
+++ b/web/box.py	Wed May 20 16:36:02 2009 +0200
@@ -152,7 +152,7 @@
         entity = self.entity(row, col)
         limit = self.req.property_value('navigation.related-limit') + 1
         role = get_role(self)
-        self.w(u'<div class="sideRelated">')
+        self.w(u'<div class="sideBox">')
         self.wview('sidebox', entity.related(self.rtype, role, limit=limit),
                    title=display_name(self.req, self.rtype, role))
         self.w(u'</div>')
--- a/web/data/cubicweb.css	Wed May 20 16:35:37 2009 +0200
+++ b/web/data/cubicweb.css	Wed May 20 16:36:02 2009 +0200
@@ -455,6 +455,8 @@
   padding: 0.2em 0px;
   margin-bottom: 0.5em;
   background: #eeedd9;
+  min-width: 21em;
+  max-width: 50em;
 }
 
 ul.sideBox li{ 
@@ -572,24 +574,11 @@
   padding: 0.5em 0.2em 0.2em;
 }
 
-div.sideRelated h4,
-div.sideRelated h5 {
-  margin-top: 0px;
-  margin-bottom: 0px;
-}
-
 div.primaryRight{
   float:right;
   
  }
 
-div.sideRelated {
-  margin-right: 1em;
-  padding: 12px 0px 12px 12px;
-  min-width: 21em;
-  max-width: 50em;
-}
-
 div.metadata {
   font-size: 90%;
   margin: 5px 0px 3px;
--- a/web/htmlwidgets.py	Wed May 20 16:35:37 2009 +0200
+++ b/web/htmlwidgets.py	Wed May 20 16:36:02 2009 +0200
@@ -57,6 +57,7 @@
     def append(self, item):
         self.items.append(item)
 
+    title_class = 'boxTitle'
     main_div_class = 'boxContent'
     listing_class = 'boxListing'
 
@@ -82,7 +83,7 @@
                 title = '<span>%s</span>' % html_escape(self.title)
             else:
                 title = '<span>%s</span>' % self.title
-            self.w(u'<div class="boxTitle">%s</div>' % title)
+            self.w(u'<div class="%s">%s</div>' % (self.title_class, title))
         if self.items:
             self.box_begin_content()
             for item in self.items:
@@ -93,6 +94,7 @@
 
 class SideBoxWidget(BoxWidget):
     """default CubicWeb's sidebox widget"""
+    title_class = u'sideBoxTitle'
     main_div_class = u'sideBoxBody'
     listing_class = ''
 
--- a/web/views/idownloadable.py	Wed May 20 16:35:37 2009 +0200
+++ b/web/views/idownloadable.py	Wed May 20 16:36:02 2009 +0200
@@ -26,7 +26,7 @@
 
 def download_box(w, entity, title=None, label=None):
     req = entity.req
-    w(u'<div class="sideRelated">')
+    w(u'<div class="sideBox">')
     if title is None:
         title = req._('download')
     w(u'<div class="sideBoxTitle downloadBoxTitle"><span>%s</span></div>'
--- a/web/views/primary.py	Wed May 20 16:35:37 2009 +0200
+++ b/web/views/primary.py	Wed May 20 16:36:02 2009 +0200
@@ -141,7 +141,7 @@
         for box in boxes:
             if isinstance(box, tuple):
                 label, rset, vid  = box
-                self.w(u'<div class="sideRelated">')
+                self.w(u'<div class="sideBox">')
                 self.wview(vid, rset, title=label)
                 self.w(u'</div>')
             else: