Add div to tweak only blog content & limit width using css (closes #2093040)
authorArthur Lutz <arthur.lutz@logilab.fr>
Thu, 07 Jun 2012 17:07:31 +0200
changeset 280 3ff01e768daa
parent 279 acc20451d14b
child 281 cf2d7f7ce574
Add div to tweak only blog content & limit width using css (closes #2093040)
data/cubes.blog.css
views/blog.py
views/entry.py
--- a/data/cubes.blog.css	Thu Jun 07 17:07:27 2012 +0200
+++ b/data/cubes.blog.css	Thu Jun 07 17:07:31 2012 +0200
@@ -10,7 +10,7 @@
   font-weight: normal;
 }
 
-div.entry h3, h3.title {
+h3.title {
   font-size: 1.0em;
 }
 div.post div.postmetadata {
@@ -27,7 +27,17 @@
   margin-top: 25px;
   padding-top: 5px;
 }
-
+div.blogentry_title, div.blogwrapper {
+  max-width:56em;
+  font-size:120%;
+}
+div.blogwrapper img {
+    margin: 10px;
+}
+div.blogwrapper h3,
+div.entry h3 {
+    font-size:105%;
+}
 div.post div.entry p {
   margin-bottom:1.5em;
 }
--- a/views/blog.py	Thu Jun 07 17:07:27 2012 +0200
+++ b/views/blog.py	Thu Jun 07 17:07:31 2012 +0200
@@ -30,6 +30,11 @@
 class BlogPrimaryView(primary.PrimaryView):
     __select__ = is_instance('Blog', 'MicroBlog')
 
+    def entity_call(self, entity):
+        self.w(u'<div class="blogwrapper">')
+        super(BlogPrimaryView, self).entity_call(entity)
+        self.w(u'</div>')
+
     def render_entity_relations(self, entity):
         super(BlogPrimaryView, self).render_entity_relations(entity)
         rset = entity.related('entry_of', 'object')
--- a/views/entry.py	Thu Jun 07 17:07:27 2012 +0200
+++ b/views/entry.py	Thu Jun 07 17:07:31 2012 +0200
@@ -55,6 +55,11 @@
     __select__ = is_instance('BlogEntry')
     show_attr_label = False
 
+    def render_entity_attributes(self, entity):
+        self.w(u'<div class="blogwrapper">')
+        super(BlogEntryPrimaryView, self).render_entity_attributes(entity)
+        self.w(u'</div>')
+
     def render_entity_title(self, entity):
         self._cw.add_css('cubes.blog.css')
         w = self.w