[IMP] website_blog: use valid website snippet as default content for blog post

Adapt the default content of blog post to be a valid website snippet.
Previous content was not entirely possible to remove (there still was
a remaining .container) and was not easily customizable (user had to
remove it if he wants something great).

Note: maybe we should adapt the snippets so that they are callable with
custom content or do something like what has been done for default
content for job positions (see commit 00cfb0889b).
This commit is contained in:
qsm-odoo
2016-08-31 16:37:20 +02:00
parent 1c87f1d3bb
commit c204d621bb
2 changed files with 11 additions and 5 deletions
+10 -4
View File
@@ -95,11 +95,17 @@ class BlogPost(models.Model):
return res
def _default_content(self):
return ''' <div class="container">
<section class="mt16 mb16">
return '''
<section class="s_text_block">
<div class="container">
<div class="row">
<div class="col-md-12 mb16 mt16">
<p class="o_default_snippet_text">''' + _("Start writing here...") + '''</p>
</section>
</div> '''
</div>
</div>
</div>
</section>
'''
name = fields.Char('Title', required=True, translate=True, default='')
subtitle = fields.Char('Sub Title', translate=True)
@@ -40,7 +40,7 @@ odoo.define("website_blog.tour", function (require) {
content: _t("Click on <b>Save</b> to set the picture as cover."),
position: "top",
}, {
trigger: ".blog_content section.mt16",
trigger: ".blog_content .s_text_block",
content: _t("<b>Write your story here.</b> Use the top toolbar to style your text: add an image or table, set bold or italic, etc. Drag and drop building blocks for more graphical blogs."),
position: "top",
run: function (actions) {