From c204d621bb7abb932fa4136c4818348c58858d37 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Tue, 30 Aug 2016 11:21:08 +0200 Subject: [PATCH] [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 00cfb0889b49d8d8c091ce18ff67e1dcb55d789e). --- addons/website_blog/models/website_blog.py | 14 ++++++++++---- .../static/src/js/website.tour.blog.js | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/addons/website_blog/models/website_blog.py b/addons/website_blog/models/website_blog.py index 35d611f162e..1ffa0c4d900 100644 --- a/addons/website_blog/models/website_blog.py +++ b/addons/website_blog/models/website_blog.py @@ -95,11 +95,17 @@ class BlogPost(models.Model): return res def _default_content(self): - return '''
-
+ return ''' +
+
+
+

''' + _("Start writing here...") + '''

-
-
''' + + + + + ''' name = fields.Char('Title', required=True, translate=True, default='') subtitle = fields.Char('Sub Title', translate=True) diff --git a/addons/website_blog/static/src/js/website.tour.blog.js b/addons/website_blog/static/src/js/website.tour.blog.js index f8c16df1eeb..59f411316e4 100644 --- a/addons/website_blog/static/src/js/website.tour.blog.js +++ b/addons/website_blog/static/src/js/website.tour.blog.js @@ -40,7 +40,7 @@ odoo.define("website_blog.tour", function (require) { content: _t("Click on Save to set the picture as cover."), position: "top", }, { - trigger: ".blog_content section.mt16", + trigger: ".blog_content .s_text_block", content: _t("Write your story here. 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) {