[IMP] Tour: better defaults

bzr revid: ddm@openerp.com-20131121111102-l66jzdysdkqm7fje
This commit is contained in:
ddm
2013-11-21 12:11:02 +01:00
parent 2985681366
commit ec4372ac23
7 changed files with 22 additions and 60 deletions
@@ -3,8 +3,6 @@
var website = openerp.website;
var render = website.tour.render;
website.EditorBar.include({
start: function () {
this.registerTour(new website.AppTour(this));
@@ -24,7 +22,7 @@
backdrop: true,
title: "Install an App",
content: "You can intall some apps to manage your website content.",
template: render('website.tour_popover', { next: "Start Tutorial", end: "Skip It" }),
template: self.popover({ next: "Start Tutorial", end: "Skip It" }),
},
{
stepId: 'customize',
@@ -32,7 +30,6 @@
placement: 'left',
title: "Install an app",
content: "Add new apps by customizing your website.",
template: render('website.tour_popover'),
onShow: function () {
editor.on('rte:customize_menu_ready', editor, function () {
self.movetoStep('install-app');
@@ -46,7 +43,6 @@
orphan: true,
title: "Install an app",
content: "Click 'Install Apps' to select and install the application you would like to manage from your website.",
template: render('website.tour_popover'),
},
];
return this._super();
@@ -3,8 +3,6 @@
var website = openerp.website;
var render = website.tour.render;
website.EditorBar.include({
start: function () {
this.registerTour(new website.BannerTour(this));
@@ -25,7 +23,7 @@
backdrop: true,
title: "Welcome to your website!",
content: "This tutorial will guide you to build your home page. We will start by adding a banner.",
template: render('website.tour_popover', { next: "Start Tutorial", end: "Skip It" }),
template: self.popover({ next: "Start Tutorial", end: "Skip It" }),
},
{
stepId: 'edit-page',
@@ -33,7 +31,6 @@
placement: 'bottom',
title: "Edit this page",
content: "Every page of your website can be modified through the <i>Edit</i> button.",
template: render('website.tour_popover'),
onShow: function () {
editor.on('tour:editor_bar_loaded', editor, function () {
self.movetoStep('add-block');
@@ -46,7 +43,6 @@
placement: 'bottom',
title: "Insert building blocks",
content: "To add content in a page, you can insert building blocks.",
template: render('website.tour_popover'),
onShow: function () {
$('button[data-action=snippet]').click(function () {
self.movetoStep('drag-banner');
@@ -59,7 +55,6 @@
placement: 'bottom',
title: "Drag & Drop a Banner",
content: "Drag the Banner block and drop it in your page.",
template: render('website.tour_popover'),
onShow: function () {
var $body = $(document.body);
function beginDrag () {
@@ -81,7 +76,7 @@
placement: 'top',
title: "Customize banner's text",
content: "Click in the text and start editing it. Click continue once it's done.",
template: render('website.tour_popover', { next: "Continue" }),
template: self.popover({ next: "Continue" }),
onHide: function () {
var $banner = $("#wrap [data-snippet-id=carousel]:first");
if ($banner.length) {
@@ -95,7 +90,7 @@
placement: 'left',
title: "Customize the banner",
content: "You can customize characteristic of any blocks through the Customize menu. For instance, change the background of the banner.",
template: render('website.tour_popover', { next: "Continue" }),
template: self.popover({ next: "Continue" }),
onShow: function () {
$('.dropdown-menu [name=carousel-background]').click(function () {
self.movetoStep('save-changes');
@@ -109,7 +104,6 @@
reflex: true,
title: "Save your modifications",
content: "Once you click on save, your website page is updated.",
template: render('website.tour_popover'),
onHide: function () {
self.saveStep('part-2');
},
@@ -119,7 +113,7 @@
orphan: true,
title: "Congratulation!",
content: "Your homepage have been updated. Now, we suggest you insert another snippet to overview possible customization.",
template: render('website.tour_popover', { next: "Continue" }),
template: self.popover({ next: "Continue" }),
},
{
stepId: 'show-tutorials',
@@ -128,7 +122,7 @@
reflex: true,
title: "Help is always available",
content: "You can always click here if you want more helps or continue to build and get more tips about your website contents like page menu, ...",
template: render('website.tour_popover', { end: "Close" }),
template: self.popover({ end: "Close" }),
}
];
return this._super();
+5 -7
View File
@@ -4,12 +4,6 @@
var website = openerp.website;
website.add_template_file('/website/static/src/xml/website.tour.xml');
website.tour = {
render: function render (template, dict) {
return openerp.qweb.render(template, dict);
}
};
website.Tour = openerp.Class.extend({
tour: undefined,
steps: [],
@@ -19,9 +13,10 @@
name: this.id,
storage: this.tourStorage,
keyboard: false,
template: this.popover(),
});
this.tour.addSteps(_.map(this.steps, function (step) {
step.title = website.tour.render('website.tour_popover_title', { title: step.title });
step.title = openerp.qweb.render('website.tour_popover_title', { title: step.title });
return step;
}));
},
@@ -87,6 +82,9 @@
var url = new website.UrlParser(window.location.href);
return pattern.test(url.pathname+url.search);
},
popover: function (options) {
return openerp.qweb.render('website.tour_popover', options);
},
});
website.UrlParser = openerp.Class.extend({
@@ -3,8 +3,6 @@
var website = openerp.website;
var render = website.tour.render;
website.EditorBar.include({
start: function () {
this.registerTour(new website.PageTour(this));
@@ -24,7 +22,7 @@
backdrop: true,
title: "Menu editor",
content: "We will show how to edit your website's menu.",
template: render('website.tour_popover', { next: "Start Tutorial", end: "Skip It" }),
template: self.popover({ next: "Start Tutorial", end: "Skip It" }),
},
{
stepId: 'content-menu',
@@ -33,7 +31,6 @@
reflex: true,
title: "Edit the content",
content: "Click here to edit the menu.",
template: render('website.tour_popover'),
},
{
stepId: 'edit-entry',
@@ -41,7 +38,6 @@
placement: 'left',
title: "Edit menu",
content: "Click here to create a new menu entry and manage options.",
template: render('website.tour_popover'),
onShow: function () {
editor.on('tour:menu_editor_dialog_ready', editor, function () {
self.movetoStep('add-menu-entry');
@@ -54,7 +50,6 @@
placement: 'left',
title: "Add menu entry",
content: "Click here to create a new menu entry.",
template: render('website.tour_popover'),
onShow: function () {
editor.on('tour:new_menu_entry_dialog_ready', editor, function () {
self.movetoStep('enter-entry-name');
@@ -67,7 +62,7 @@
placement: 'left',
title: "Choose a label",
content: "This label will appear in the top menu and will be visible by all your audience.\nGive a meaningful name to help your visitors. For instance, 'Photos Gallery'.",
template: render('website.tour_popover', { next: "Continue" }),
template: self.popover({ next: "Continue" }),
},
{
stepId: 'enter-page-name',
@@ -75,7 +70,7 @@
placement: 'left',
title: "Link your menu to a 'gallery' page",
content: "This page does not exist. Create it by filling the name here. For instance, 'gallery'.",
template: render('website.tour_popover', { next: "Continue" }),
template: self.popover({ next: "Continue" }),
},
{
stepId: 'save-page',
@@ -83,7 +78,6 @@
placement: 'right',
title: "Save the page",
content: "Save your new page.",
template: render('website.tour_popover'),
onShow: function () {
editor.on('tour:new_menu_entry_dialog_closed', editor, function () {
self.movetoStep('save-menu');
@@ -97,7 +91,6 @@
reflex: true,
title: "Save the menu",
content: "Save the menu to edit the Gallery content directly from the interface.",
template: render('website.tour_popover'),
},
];
return this._super();
@@ -3,8 +3,6 @@
var website = openerp.website;
var render = website.tour.render;
website.EditorBar.include({
start: function () {
this.registerTour(new website.BlogTour(this));
@@ -25,7 +23,7 @@
backdrop: true,
title: "Blog",
content: "We will show how to create a new blog post.",
template: render('website.tour_popover', { next: "Start Tutorial", end: "Skip It" }),
template: self.popover({ next: "Start Tutorial", end: "Skip It" }),
},
{
stepId: 'content-menu',
@@ -34,7 +32,6 @@
reflex: true,
title: "Edit the content",
content: "Click here to add content to your site.",
template: render('website.tour_popover'),
},
{
stepId: 'new-post-entry',
@@ -42,7 +39,6 @@
placement: 'left',
title: "New blog post",
content: "Click here to create a blog post.",
template: render('website.tour_popover'),
onShow: function () {
$(document).one('shown.bs.modal', function () {
$('.modal button.btn-primary').click(function () {
@@ -58,7 +54,6 @@
placement: 'right',
title: "Choose the post category",
content: "Select the 'News' category and click 'Continue'.",
template: render('website.tour_popover'),
},
{
stepId: 'post-page',
@@ -66,7 +61,7 @@
backdrop: true,
title: "New blog post created",
content: "You just created a new blog post. We are now going to edit it.",
template: render('website.tour_popover', { next: "OK" }),
template: self.popover({ next: "OK" }),
},
{
stepId: 'post-title',
@@ -74,7 +69,7 @@
placement: 'top',
title: "Pick a title",
content: "Choose a catchy title for your blog post.",
template: render('website.tour_popover', { next: "OK" }),
template: self.popover({ next: "OK" }),
},
{
stepId: 'add-block',
@@ -82,7 +77,6 @@
placement: 'bottom',
title: "Layout your blog post",
content: "Insert blocks like text-image to layout the body of your blog post.",
template: render('website.tour_popover'),
onShow: function () {
$('button[data-action=snippet]').click(function () {
self.movetoStep('drag-image-text');
@@ -95,7 +89,6 @@
placement: 'bottom',
title: "Drag & Drop a block",
content: "Drag the 'Image Text' block and drop it in your page.",
template: render('website.tour_popover'),
onShow: function () {
var $body = $(document.body);
function beginDrag () {
@@ -3,8 +3,6 @@
var website = openerp.website;
var render = website.tour.render;
website.EditorBar.include({
start: function () {
this.registerTour(new website.EventTour(this));
@@ -25,7 +23,7 @@
backdrop: true,
title: "Event",
content: "We will show how to create a new event.",
template: render('website.tour_popover', { next: "Start Tutorial", end: "Skip It" }),
template: self.popover({ next: "Start Tutorial", end: "Skip It" }),
},
{
stepId: 'content-menu',
@@ -34,7 +32,6 @@
reflex: true,
title: "Edit the content",
content: "Click here to add content to your site.",
template: render('website.tour_popover'),
},
{
stepId: 'new-post-entry',
@@ -42,7 +39,6 @@
placement: 'left',
title: "New event",
content: "Click here to create an event.",
template: render('website.tour_popover'),
onShow: function () {
$(document).one('shown.bs.modal', function () {
$('.modal button.btn-primary').click(function () {
@@ -58,7 +54,6 @@
placement: 'right',
title: "Choose the event name",
content: "Choose a name for the new event and click 'Continue'.",
template: render('website.tour_popover'),
},
{
stepId: 'event-page',
@@ -66,7 +61,7 @@
backdrop: true,
title: "New event created",
content: "You just created a new event. We are now going to edit it.",
template: render('website.tour_popover', { next: "OK" }),
template: self.popover({ next: "OK" }),
},
{
stepId: 'add-block',
@@ -75,7 +70,6 @@
reflex: true,
title: "Layout your event",
content: "Insert blocks like text-image to layout the body of your event.",
template: render('website.tour_popover'),
},
];
return this._super();
@@ -3,8 +3,6 @@
var website = openerp.website;
var render = website.tour.render;
website.EditorBar.include({
start: function () {
this.registerTour(new website.EditorShopTour(this));
@@ -25,7 +23,7 @@
backdrop: true,
title: "Welcome to your shop",
content: "You successfully installed the e-commerce. This guide will help you to create your product and promote your sales.",
template: render('website.tour_popover', { next: "Start Tutorial", end: "Skip It" }),
template: self.popover({ next: "Start Tutorial", end: "Skip It" }),
},
{
stepId: 'content-menu',
@@ -34,7 +32,6 @@
reflex: true,
title: "Create your first product",
content: "Click here to add a new product.",
template: render('website.tour_popover'),
},
{
stepId: 'edit-entry',
@@ -42,7 +39,6 @@
placement: 'left',
title: "Create a new product",
content: "Select 'New Product' to create it and manage its properties to boost your sales.",
template: render('website.tour_popover'),
onShow: function () {
$(document).one('shown.bs.modal', function () {
$('.modal button.btn-primary').click(function () {
@@ -58,7 +54,6 @@
placement: 'right',
title: "Choose name",
content: "Enter a name for your new product.",
template: render('website.tour_popover'),
},
{
@@ -67,7 +62,7 @@
backdrop: true,
title: "New product created",
content: "This page contains all the information related to the new product.",
template: render('website.tour_popover', { next: "OK" }),
template: self.popover({ next: "OK" }),
},
{
stepId: 'edit-price',
@@ -75,7 +70,7 @@
placement: 'left',
title: "Change the public price",
content: "Edit the sale price of this product by clicking on the amount. The price is the sale price used in all sale order when selling this product.",
template: render('website.tour_popover', { next: "OK" }),
template: self.popover({ next: "OK" }),
},
{
stepId: 'add-block',
@@ -84,7 +79,6 @@
reflex: true,
title: "Describe the product for your audience",
content: "Insert blocks like text-image, or gallery to fully describe the product and make your visitors want to buy this product.",
template: render('website.tour_popover'),
},
];
return this._super();