Skip to content
Snippets Groups Projects
Commit 8509ba7d authored by Patrick Hoste's avatar Patrick Hoste
Browse files

[IMP] (website_)event: add new tour to demonstrate new features


PURPOSE

Create a tour for Events to introduce new users to this freshly
revamped application.

SPECIFICATIONS

In 'website_event' module the tour steps extends the 'event' tour steps

LINKS

Task ID : 2180175
PR : #45612

Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
parent ee8c1b09
Branches
Tags
No related merge requests found
odoo.define('event.event_steps', function (require) {
"use strict";
var core = require('web.core');
var EventAdditionalTourSteps = core.Class.extend({
_get_website_event_steps: function () {
return [false];
},
});
return EventAdditionalTourSteps;
});
odoo.define('event.event_tour', function (require) {
"use strict";
var core = require('web.core');
var _t = core._t;
var tour = require('web_tour.tour');
var EventAdditionalTourSteps = require('event.event_steps');
tour.register('event_tour', {
url: '/web',
}, [tour.stepUtils.showAppsMenuItem(), {
trigger: '.o_app[data-menu-xmlid="event.event_main_menu"]',
content: _t("Ready to <b>organize events</b> in a few minutes? Let's get started!"),
position: 'bottom',
edition: 'enterprise',
}, {
trigger: '.o_app[data-menu-xmlid="event.event_main_menu"]',
content: _t("Ready to <b>organize events</b> in a few minutes? Let's get started!"),
edition: 'community',
}, {
trigger: '.o-kanban-button-new',
content: _t("Let's <b>create</b> your first event."),
position: 'bottom',
width: 175,
}, {
trigger: 'input[name="name"]',
content: _t("This is the <b>name</b> your guests will see when registering."),
run: 'text Odoo Experience 2020',
}, {
trigger: 'input[name="date_end"]',
content: _t("When will your event take place? <b>Select</b> the start and end dates <b>and click Apply</b>."),
run: function () {
$('input[name="date_begin"]').val('09/30/2020 08:00:00').change();
$('input[name="date_end"]').val('10/02/2020 23:00:00').change();
},
}, {
trigger: 'div[name="event_ticket_ids"] .o_field_x2many_list_row_add a',
content: _t("Ticket types allow you to distinguish your attendees. Let's <b>create</b> a new one."),
}, {
trigger: '.nav-item a:contains("Communication")',
content: _t("Let's make sure attendees do not forget to show up! Create an <b>automated reminder</b>."),
}, {
trigger: 'div[name="event_mail_ids"] .o_field_x2many_list_row_add a',
content: _t("Click <b>Add a line</b> to schedule a communication."),
}, {
trigger: 'div[name="template_id"] > div > input[type="text"]',
content: _t("Here, you can choose the content that will be sent out. To filter the results, start typing <b>Reminder</b>."),
position: 'top',
}, {
trigger: 'ul.ui-autocomplete a:contains("Reminder")',
content: _t('Let\'s select this template'),
width: 160,
}, {
trigger: '.o_form_button_save',
content: _t("Awesome! Now, let's <b>save</b> your changes."),
position: 'bottom',
width: 250,
}, ...new EventAdditionalTourSteps()._get_website_event_steps(), {
trigger: 'div[name="stage_id"] button:contains("Booked")',
extra_trigger: 'div.o_form_buttons_view:not(.o_hidden)',
content: _t("Now that your event is ready, click here to move it to another stage."),
position: 'bottom',
}, {
trigger: 'ol.breadcrumb li.breadcrumb-item:first',
extra_trigger: 'div[name="stage_id"] button.disabled:contains("Booked")',
content: _t("Use the <b>breadcrumbs</b> to go back to your kanban overview."),
position: 'bottom',
run: 'click',
}, {
trigger: 'div.o_quick_create_folded',
content: _t("This pipeline can be customized on the fly to fit your organizational needs. For example, let's create a new stage."),
position: 'bottom',
run: function (actions) {
actions.click();
$('div.o_kanban_header input[type="text"]').val('New Stage');
},
}, {
trigger: 'button.o_kanban_add',
content: _t("Click <b>add</b> to create a new stage."),
width: 200,
run: 'click',
}].filter(Boolean));
});
......@@ -6,5 +6,11 @@
<link rel="stylesheet" type="text/scss" href="/event/static/src/scss/event.scss"/>
</xpath>
</template>
<template id="assets_common" name="Event Assets Common" inherit_id="web.assets_common">
<xpath expr="//script[last()]" position="after">
<script type="text/javascript" src="/event/static/src/js/tours/event_tour.js"></script>
</xpath>
</template>
</data>
</odoo>
odoo.define('website_event.event_steps', function (require) {
"use strict";
var core = require('web.core');
var _t = core._t;
var EventAdditionalTourSteps = require('event.event_steps');
EventAdditionalTourSteps.include({
init: function() {
this._super.apply(this, arguments);
},
_get_website_event_steps: function () {
this._super.apply(this, arguments);
return [{
trigger: 'button[name="is_published"]',
extra_trigger: 'div.o_form_buttons_view:not(.o_hidden)',
content: _t("Use this <b>shortcut</b> to easily access your event web page."),
position: 'bottom',
}, {
trigger: 'li#edit-page-menu a',
content: _t("With the Edit button, you can <b>customize</b> the web page visitors will see when registrating."),
position: 'bottom',
}, {
trigger: 'div[name="Image - Text"] .oe_snippet_thumbnail',
content: _t("<b>Drag and Drop</b> this snippet below the event title."),
position: 'bottom',
run: 'drag_and_drop #o_wevent_event_main_col',
}, {
trigger: '#web_editor-top-edit button[data-action="save"]',
content: _t("Don't forget to click <b>save</b> when you're done."),
position: 'bottom',
}, {
trigger: 'label.js_publish_btn',
content: _t("Looking great! Let's now <b>publish</b> this page so that it becomes <b>visible</b> on your website!"),
position: 'bottom',
}, {
trigger: 'a.css_edit_dynamic',
extra_trigger: 'div.o_notification_manager:empty',
content: _t("Want to change your event configuration? Let's go back to the event form."),
position: 'bottom',
run: function (actions) {
actions.click('div.dropdown-menu a#edit-in-backend');
},
}, {
trigger: 'a#edit-in-backend',
content: _t("This shortcut will bring you right back to the event form."),
position: 'bottom'
}];
}
});
return EventAdditionalTourSteps;
});
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="assets_common" inherit_id="web.assets_common" name="Event Assets Common">
<xpath expr="//script[last()]" position="after">
<script type="text/javascript" src="/website_event/static/src/js/tours/event_tour.js"></script>
</xpath>
</template>
<template id="assets_frontend" inherit_id="website.assets_frontend" name="Event Assets Frontend">
<xpath expr="//link[last()]" position="after">
<link rel="stylesheet" type="text/scss" href="/website_event/static/src/scss/website_event.scss"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment