Add div to tweak only blog content & limit width using css (closes #2093040)

authorArthur Lutz <arthur.lutz@logilab.fr>
changeset3ff01e768daa
branchdefault
phasepublic
hiddenno
parent revision#acc20451d14b Addition context views for navigation boxes (closes #1529146)
child revision#cf2d7f7ce574 Modify look of blog (fonts/css mainly) (closes #2110315)
files modified by this revision
data/cubes.blog.css
views/blog.py
views/entry.py
# HG changeset patch
# User Arthur Lutz <arthur.lutz@logilab.fr>
# Date 1339081651 -7200
# Thu Jun 07 17:07:31 2012 +0200
# Node ID 3ff01e768daab1657cd8d03467816c65ec27b839
# Parent acc20451d14b56bcb6b821d8b273562fc258d025
Add div to tweak only blog content & limit width using css (closes #2093040)

diff --git a/data/cubes.blog.css b/data/cubes.blog.css
@@ -8,11 +8,11 @@
1    position: relative;
2    border-bottom: none;
3    font-weight: normal;
4  }
5 
6 -div.entry h3, h3.title {
7 +h3.title {
8    font-size: 1.0em;
9  }
10  div.post div.postmetadata {
11    background:transparent url(postdatabg.jpg) no-repeat scroll left bottom;
12    font-size: 0.98em;
@@ -25,11 +25,21 @@
13  div.post div.entry {
14    margin-left: 10px;
15    margin-top: 25px;
16    padding-top: 5px;
17  }
18 -
19 +div.blogentry_title, div.blogwrapper {
20 +  max-width:56em;
21 +  font-size:120%;
22 +}
23 +div.blogwrapper img {
24 +    margin: 10px;
25 +}
26 +div.blogwrapper h3,
27 +div.entry h3 {
28 +    font-size:105%;
29 +}
30  div.post div.entry p {
31    margin-bottom:1.5em;
32  }
33 
34  div.post small {
diff --git a/views/blog.py b/views/blog.py
@@ -28,10 +28,15 @@
35 
36 
37  class BlogPrimaryView(primary.PrimaryView):
38      __select__ = is_instance('Blog', 'MicroBlog')
39 
40 +    def entity_call(self, entity):
41 +        self.w(u'<div class="blogwrapper">')
42 +        super(BlogPrimaryView, self).entity_call(entity)
43 +        self.w(u'</div>')
44 +
45      def render_entity_relations(self, entity):
46          super(BlogPrimaryView, self).render_entity_relations(entity)
47          rset = entity.related('entry_of', 'object')
48          if rset:
49              strio = UStringIO()
diff --git a/views/entry.py b/views/entry.py
@@ -53,10 +53,15 @@
50 
51  class BlogEntryPrimaryView(primary.PrimaryView):
52      __select__ = is_instance('BlogEntry')
53      show_attr_label = False
54 
55 +    def render_entity_attributes(self, entity):
56 +        self.w(u'<div class="blogwrapper">')
57 +        super(BlogEntryPrimaryView, self).render_entity_attributes(entity)
58 +        self.w(u'</div>')
59 +
60      def render_entity_title(self, entity):
61          self._cw.add_css('cubes.blog.css')
62          w = self.w
63          w(u'<div class="blogentry_title">')
64          render_blogentry_title(self._cw, w, entity)