[IMP] cover by default + clean HTML
authorFabien Pinckaers <fp@tinyerp.com>
Sun, 23 Feb 2014 17:54:03 +0000 (18:54 +0100)
committerFabien Pinckaers <fp@tinyerp.com>
Sun, 23 Feb 2014 17:54:03 +0000 (18:54 +0100)
bzr revid: fp@tinyerp.com-20140223175403-g70my3c3pxwhhx4j

addons/website_blog/static/src/css/website_blog.css
addons/website_blog/static/src/css/website_blog.sass
addons/website_blog/views/website_blog_templates.xml

index 23a8fc3..a63793a 100644 (file)
@@ -27,25 +27,36 @@ p.post-meta {
   -o-background-size: cover;
   background-size: cover;
   background-position: center;
-  background-color: rgba(0, 0, 0, 0.3);
-  color: white;
 }
 
 .cover_header {
+  color: white;
   min-height: 400px;
   height: 100vh;
 }
-.cover_header h1 {
+.cover_header .blog_title {
   padding-top: 20vh;
+}
+.cover_header h1 {
   font-weight: bold;
 }
+.cover_header h2.text-muted {
+  color: white;
+}
 
 .cover_footer {
+  color: white;
   min-height: 200px;
   height: 50vh;
   padding-top: 5vh;
   cursor: pointer;
 }
+.cover_footer h1 {
+  font-weight: bold;
+}
+.cover_footer h2.text-muted {
+  color: white;
+}
 
 /*Inline Discussion */
 .discussion {
index ab7b964..6318412 100644 (file)
@@ -26,21 +26,28 @@ p.post-meta
     -o-background-size: cover
     background-size: cover
     background-position: center
-    background-color: rgba(0, 0, 0, 0.3)
-    color: white
 
 .cover_header
+    color: white
     min-height : 400px
     height: 100vh
-    h1
+    .blog_title
         padding-top : 20vh
+    h1
         font-weight: bold
+    h2.text-muted
+        color: white
 
 .cover_footer
+    color: white
     min-height : 200px
     height: 50vh
     padding-top: 5vh
     cursor: pointer
+    h1
+        font-weight: bold
+    h2.text-muted
+        color: white
 
 /*Inline Discussion
 
index faa6a95..342505f 100644 (file)
 <template id="blog_post_complete" name="Blog Post">
   <t t-call="website_blog.index">
 
-    <div class="cover cover_header text-center" id="title" t-attf-style="background-image : url(#{blog_post.content_image})">
-        <div class="text-right">
-            <a id="change_cover" t-ignore="true" class="btn btn-primary css_non_editable_mode_hidden">
-                Change Cover Photo
-            </a>
+    <div t-attf-class="cover #{blog_post.content_image and 'cover_header' or ''} text-center" id="title" t-attf-style="background-image : url(#{blog_post.content_image})" t-ignore="True">
+        <div class="container">
+          <div style="position: absolute" class="container text-right mt16">
+            <div class="btn-group css_non_editable_mode_hidden">
+                <a id="change_cover" class="btn btn-primary">
+                    Change Cover
+                </a>
+                <a id="clear_cover" class="btn btn-danger">
+                    <span class="fa fa-times"/>
+                </a>
+            </div>
+            <t t-call="website.publish_management">
+                <t t-set="object" t-value="blog_post"/>
+                <t t-set="publish_edit" t-value="True"/>
+                <li>
+                    <form class="duplicate hidden" action="/blogpost/duplicate">
+                        <input name="blog_post_id" t-att-value="blog_post.id"/>
+                    </form>
+                    <a href="#" class="duplicate" onclick="$(this).prev('form').submit()">Duplicate</a>
+                </li>
+            </t>
+          </div>
         </div>
-        <h1 t-field="blog_post.name" id="blog_post_name"/>
-        <h2 t-field="blog_post.sub_title"/>
-        <div>
-            <img class="img-circle" t-att-src="'/website/image?model=res.users&amp;field=image_small&amp;id='+str(blog_post.create_uid.id)" style="width: 30px; margin-right: 10px;"/>
-            <small id="blog_author" t-field="blog_post.create_uid.name"/>
+        <div class="blog_title">
+            <h1 t-field="blog_post.name" id="blog_post_name" class="mt32"/>
+            <h2 t-field="blog_post.sub_title" class="text-muted"/>
+            <div>
+                <img class="img-circle" t-att-src="'/website/image?model=res.users&amp;field=image_small&amp;id='+str(blog_post.create_uid.id)" style="width: 30px; margin-right: 10px;"/>
+                <small id="blog_author" t-field="blog_post.create_uid.name"/><br/>
+            </div>
+            <div t-if="blog_post.content_image">
+                <a href="#blog_content" class="fa fa-angle-down fa-2x fa-inverse mt32"/>
+            </div>
         </div>
-        <a href="#blog_content" class="fa fa-angle-down fa-2x fa-inverse mt32"/>
     </div>
 
-    <div class="container">
-        <t t-call="website.publish_management">
-            <t t-set="object" t-value="blog_post"/>
-            <t t-set="publish_edit" t-value="True"/>
-            <li>
-                <form class="duplicate hidden" action="/blogpost/duplicate">
-                    <input name="blog_post_id" t-att-value="blog_post.id"/>
-                </form>
-                <a href="#" class="duplicate" onclick="$(this).prev('form').submit()">Duplicate</a>
-            </li>
-        </t>
-    </div>
-    <div id="blog_content" t-field="blog_post.content"/>
+    <div id="blog_content" t-field="blog_post.content" class="mt32"/>
 
     <!-- FP Note: should we remove this or put it in options? -->
     <section id="comments" class="container">