diff options
| author | Dharmraj Jhala (OpenERP) <dizzy.zala@gmail.com> | 2014-02-25 11:02:04 +0530 |
|---|---|---|
| committer | Dharmraj Jhala (OpenERP) <dizzy.zala@gmail.com> | 2014-02-25 11:02:04 +0530 |
| commit | c6917b9c074f3f2c19cac1dc3e05c8a3d2cadbed (patch) | |
| tree | 6a17e259f27e029458207671d10fec50b5c425be /addons/website_blog | |
| parent | b2688a37f84a505d8e334f8b0325b4747d440170 (diff) | |
| parent | 9eb2db4465cefa5dc331123c1b0a4df035545015 (diff) | |
[MERGE] with trunk-survey2-rim addons branch
bzr revid: dizzy.zala@gmail.com-20140225053204-mra08nfvumkxyixa
Diffstat (limited to 'addons/website_blog')
| -rw-r--r-- | addons/website_blog/static/src/js/website.tour.blog.js | 87 | ||||
| -rw-r--r-- | addons/website_blog/static/src/js/website_blog.editor.js | 4 | ||||
| -rw-r--r-- | addons/website_blog/tests/__init__.py | 2 | ||||
| -rw-r--r-- | addons/website_blog/tests/test_ui.py | 9 | ||||
| -rw-r--r-- | addons/website_blog/tests/ui_suite/post_test.js | 17 | ||||
| -rw-r--r-- | addons/website_blog/views/website_blog_templates.xml | 20 |
6 files changed, 62 insertions, 77 deletions
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 ffbd6e7ecc8..b6701d74634 100644 --- a/addons/website_blog/static/src/js/website.tour.blog.js +++ b/addons/website_blog/static/src/js/website.tour.blog.js @@ -2,114 +2,115 @@ 'use strict'; var website = openerp.website; + var _t = openerp._t; website.EditorBar.include({ start: function () { - this.registerTour(new website.BlogTour(this)); + this.registerTour(new website.Tour.Blog(this)); return this._super(); }, }); - website.BlogTour = website.Tour.extend({ + website.Tour.Blog = website.Tour.extend({ id: 'blog', name: "Create a blog post", testPath: '/(blog|blogpost)', - init: function (editor) { + init: function () { var self = this; self.steps = [ { - title: "New Blog Post", - content: "Let's go through the first steps to write beautiful blog posts.", - template: self.popover({ next: "Start Tutorial", end: "Skip" }), + title: _t("New Blog Post"), + content: _t("Let's go through the first steps to write beautiful blog posts."), + popover: { next: _t("Start Tutorial"), end: _t("Skip") }, }, { element: '#content-menu-button', placement: 'left', - title: "Add Content", - content: "Create new pages, blogs, menu items and products through the <em>'Content'</em> menu.", - template: self.popover({ fixed: true }), + title: _t("Add Content"), + content: _t("Create new pages, blogs, menu items and products through the <em>'Content'</em> menu."), + popover: { fixed: true }, }, { element: 'a[data-action=new_blog_post]', placement: 'left', - title: "New Blog Post", - content: "Select this menu item to create a new blog post.", - template: self.popover({ fixed: true }), + title: _t("New Blog Post"), + content: _t("Select this menu item to create a new blog post."), + popover: { fixed: true }, }, { - element: '.modal button.btn-primary', - placement: 'bottom', - title: "Create Blog Post", - content: "Click <em>Continue</em> to create the blog post.", + element: '.modal:has(#editor_new_blog) button.btn-primary', + placement: 'right', + title: _t("Create Blog Post"), + content: _t("Click <em>Continue</em> to create the blog post."), }, { - waitNot: '.modal', - title: "Blog Post Created", - content: "This is your new blog post. Let's edit it.", - template: self.popover({ next: "Continue" }), + waitFor: 'body:has(button[data-action=save]:visible):has(.js_blog)', + title: _t("Blog Post Created"), + content: _t("This is your new blog post. Let's edit it."), + popover: { next: _t("Continue") }, }, { element: 'h1[data-oe-expression="blog_post.name"]', placement: 'bottom', sampleText: 'New Blog', - title: "Set a Title", - content: "Click on this area and set a catchy title for your blog post.", + title: _t("Set a Title"), + content: _t("Click on this area and set a catchy title for your blog post."), }, { waitNot: '#wrap h1[data-oe-model="blog.post"]:contains("Blog Post Title")', element: 'button[data-action=snippet]', placement: 'bottom', - title: "Layout Your Blog Post", - content: "Use well designed building blocks to structure the content of your blog. Click 'Insert Blocks' to add new content.", - template: self.popover({ fixed: true }), + title: _t("Layout Your Blog Post"), + content: _t("Use well designed building blocks to structure the content of your blog. Click 'Insert Blocks' to add new content."), + popover: { fixed: true }, }, { snippet: 'image-text', placement: 'bottom', - title: "Drag & Drop a Block", - content: "Drag the <em>'Image-Text'</em> block and drop it in your page.", - template: self.popover({ fixed: true }), + title: _t("Drag & Drop a Block"), + content: _t("Drag the <em>'Image-Text'</em> block and drop it in your page."), + popover: { fixed: true }, }, { element: 'button[data-action=snippet]', placement: 'bottom', - title: "Add Another Block", - content: "Let's add another block to your post.", - template: self.popover({ fixed: true }), + title: _t("Add Another Block"), + content: _t("Let's add another block to your post."), + popover: { fixed: true }, }, { snippet: 'text-block', placement: 'bottom', - title: "Drag & Drop a block", - content: "Drag the <em>'Text Block'</em> block and drop it below the image block.", - template: self.popover({ fixed: true }), + title: _t("Drag & Drop a block"), + content: _t("Drag the <em>'Text Block'</em> block and drop it below the image block."), + popover: { fixed: true }, }, { element: '.oe_active .oe_snippet_remove', placement: 'top', - title: "Delete the Title", - content: "From this toolbar you can move, duplicate or delete the selected zone. Click on the garbage can image to delete the title.", + title: _t("Delete the Title"), + content: _t("From this toolbar you can move, duplicate or delete the selected zone. Click on the garbage can image to delete the title."), }, { waitNot: '.oe_active .oe_snippet_remove:visible', element: 'button[data-action=save]', placement: 'right', - title: "Save Your Blog", - content: "Click the <em>Save</em> button to record changes on the page.", - template: self.popover({ fixed: true }), + title: _t("Save Your Blog"), + content: _t("Click the <em>Save</em> button to record changes on the page."), + popover: { fixed: true }, }, { waitFor: 'button[data-action=edit]:visible', element: 'button.btn-danger.js_publish_btn', placement: 'top', - title: "Publish Your Post", - content: "Your blog post is not yet published. You can update this draft version and publish it once you are ready.", + title: _t("Publish Your Post"), + content: _t("Your blog post is not yet published. You can update this draft version and publish it once you are ready."), }, { waitFor: '.js_publish_management button.js_publish_btn.btn-success:visible', title: "Thanks!", - content: "This tutorial is finished. To discover more features, improve the content of this page and try the <em>Promote</em> button in the top right menu.", - template: self.popover({ end: "Close Tutorial" }), + content: _t("This tutorial is finished. To discover more features, improve the content of this page and try the <em>Promote</em> button in the top right menu."), + popover: { next: _t("Close Tutorial") }, }, ]; return this._super(); diff --git a/addons/website_blog/static/src/js/website_blog.editor.js b/addons/website_blog/static/src/js/website_blog.editor.js index 1626015ea1c..1c5deef56f7 100644 --- a/addons/website_blog/static/src/js/website_blog.editor.js +++ b/addons/website_blog/static/src/js/website_blog.editor.js @@ -2,6 +2,7 @@ "use strict"; var website = openerp.website; + var _t = openerp._t; website.add_template_file('/website_blog/static/src/xml/website_blog.xml'); website.is_editable = true; @@ -16,7 +17,8 @@ 'click a[data-action=new_blog_post]': function (ev) { ev.preventDefault(); website.prompt({ - window_title: "New Blog Post", + id: "editor_new_blog", + window_title: _t("New Blog Post"), select: "Select Blog", init: function (field) { return website.session.model('blog.blog') diff --git a/addons/website_blog/tests/__init__.py b/addons/website_blog/tests/__init__.py index 157f4549988..3dcbf31d714 100644 --- a/addons/website_blog/tests/__init__.py +++ b/addons/website_blog/tests/__init__.py @@ -19,6 +19,6 @@ # ############################################################################## -import test_ui +#import test_ui # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/website_blog/tests/test_ui.py b/addons/website_blog/tests/test_ui.py index 36f464e4998..8a99cf78782 100644 --- a/addons/website_blog/tests/test_ui.py +++ b/addons/website_blog/tests/test_ui.py @@ -1,5 +1,6 @@ -import openerp.addons.website.tests.test_ui as test_ui +import openerp + +class TestUi(openerp.tests.HttpCase): + def test_admin(self): + self.phantom_js("/", "openerp.website.Tour.run_test('blog')", "openerp.website.Tour") -def load_tests(loader, base, _): - base.addTest(test_ui.WebsiteUiSuite(test_ui.full_path(__file__,'post_test.js'), {'redirect': '/page/website.homepage'}, 60.0)) - return base diff --git a/addons/website_blog/tests/ui_suite/post_test.js b/addons/website_blog/tests/ui_suite/post_test.js deleted file mode 100644 index f8d729bee0b..00000000000 --- a/addons/website_blog/tests/ui_suite/post_test.js +++ /dev/null @@ -1,17 +0,0 @@ -var testRunner = require('../../../website/tests/ui_suite/ui_test_runner.js'); - -var waitFor = testRunner.waitFor; - -testRunner.run(function blogTest (page, timeout) { - page.evaluate(function () { localStorage.clear(); }); - waitFor(function clientReady () { - return page.evaluate(function () { - return window.$ && window.openerp && window.openerp.website - && window.openerp.website.Tour; - }); - }, function executeTest () { - page.evaluate(function () { - window.openerp.website.Tour.run_test('blog'); - }); - }, timeout); -});
\ No newline at end of file diff --git a/addons/website_blog/views/website_blog_templates.xml b/addons/website_blog/views/website_blog_templates.xml index 3ff075b50d4..203dcc3bb71 100644 --- a/addons/website_blog/views/website_blog_templates.xml +++ b/addons/website_blog/views/website_blog_templates.xml @@ -97,17 +97,15 @@ <!-- Blog Post Summary --> <template id="blog_post_short" name="Blog Post Summary"> <t t-call="website_blog.index"> - <div t-if="not blog_posts"> - <div class="text-center text-muted"> - <h3 class="css_editable_display">No blog post found</h3> - <h3 class="css_editable_hidden">Nothing published yet click <a t-attf-href="/page/website.contactus">here</a> to contact us</h3> - <t groups="base.group_website_publisher"> - <t groups="base.group_document_user"> - <p>Click on "Content" to define a new blog post or "Help" for more informations.</p> - <img src="/website/static/src/img/content_here.png"/> - </t> - </t> - </div> + <div t-if="not blog_posts" class="container mb64"> + <p class="css_editable_hidden"> + <h1>No blog post yet.</h1> + </p> + <t groups="base.group_website_publisher"> + <t groups="base.group_document_user"> + <p>Click on "Content" on the top menu to write your first blog post.</p> + </t> + </t> </div> <t t-foreach="blog_posts" t-as="blog_post"> <div t-att-data-publish="blog_post.website_published and 'on' or 'off'"> |
