4 var website = openerp.website;
6 website.EditorBar.include({
8 this.registerTour(new website.EventTour(this));
13 website.EventTour = website.Tour.extend({
15 name: "Create an event",
16 init: function (editor) {
20 stepId: 'welcome-event',
23 title: "Create an Event",
24 content: "Let's go through the firsts step to publish a new event.",
25 template: self.popover({ next: "Start Tutorial", end: "Skip It" }),
28 stepId: 'content-menu',
29 element: '#content-menu-button',
33 content: "The <em>Content</em> menu allows to create new pages, events, menus, etc.",
36 stepId: 'new-post-entry',
37 element: 'a[data-action=new_event]',
40 content: "Click here to create a new event.",
43 afterSubmit: 'event-page',
47 stepId: 'choose-name',
48 element: '.modal input',
50 title: "Choose an Event Name",
51 content: "Choose a name for your new event and click <em>'Continue'</em>. e.g: Technical Training",
56 title: "New Event Created",
57 content: "This is your new event page. We will edit the event presentation page.",
58 template: self.popover({ next: "OK" }),
61 stepId: 'event-price',
62 element: '[data-oe-field=price]',
64 title: "Ticket price",
65 content: "Edit your ticket price.",
66 template: self.popover({ next: "OK" }),
70 element: 'button[data-action=snippet]',
72 title: "Layout your event",
73 content: "Insert blocks like 'Banner' to layout the body of your event.",
74 triggers: function () {
75 $('button[data-action=snippet]').one('click', function () {
76 self.moveToNextStep();
81 stepId: 'drag-banner',
82 element: '#website-top-navbar [data-snippet-id=carousel].ui-draggable',
84 title: "Drag & Drop a block",
85 content: "Drag the 'Banner' block and drop it in your page.",
86 triggers: function () {
87 self.onSnippetDraggedAdvance('carousel');
91 stepId: 'add-text-block',
92 element: 'button[data-action=snippet]',
94 title: "Layout your event",
95 content: "Insert another block to your event.",
96 triggers: function () {
97 $('button[data-action=snippet]').one('click', function () {
98 self.moveToNextStep();
103 stepId: 'drag-text-block',
104 element: '#website-top-navbar [data-snippet-id=text-block].ui-draggable',
106 title: "Drag & Drop a block",
107 content: "Drag the 'Text Block' block below the banner.",
108 triggers: function () {
109 self.onSnippetDraggedAdvance('text-block');
111 onHide: function () {
112 window.scrollTo(0, 0);
116 stepId: 'add-three-columns',
117 element: 'button[data-action=snippet]',
119 title: "Layout your event",
120 content: "Insert a last block to your event.",
121 triggers: function () {
122 $('button[data-action=snippet]').one('click', function () {
123 self.moveToNextStep();
128 stepId: 'drag-three-columns',
129 element: '#website-top-navbar [data-snippet-id=three-columns].ui-draggable',
131 title: "Drag & Drop a block",
132 content: "Drag the 'Three Columns' block at the bottom.",
133 triggers: function () {
134 self.onSnippetDraggedAdvance('three-columns');
136 onHide: function () {
137 window.scrollTo(0, 0);
141 stepId: 'save-changes',
142 element: 'button[data-action=save]',
144 title: "Save your modifications",
145 content: "Once you click on save, your event is updated.",
146 triggers: function () {
147 var $publish = $('button.js_publish_btn');
148 if ($publish.length > 0 && $publish.is(":visible")) {
149 self.moveToNextStep();
154 stepId: 'publish-event',
155 element: 'button.js_publish_btn',
158 title: "Publish your event",
159 content: "Click to publish your event.",
162 stepId: 'customize-event',
163 element: '.js_publish_management button:last',
166 title: "Customize your event",
167 content: "Click here to customize your event further.",
170 stepId: 'edit-event-backend',
171 element: '.js_publish_management ul>li>a',
174 title: "Customize your event",
175 content: "Click here to edit your event in the backend.",
178 return this._super();
180 resume: function () {
181 return (this.isCurrentStep('event-page') || this.isCurrentStep('save-changes')) && this._super();
183 trigger: function () {
184 return (this.resume() && this.testUrl(/^\/event\/[0-9]+\/register/)) || this._super();