diff --git a/addons/gamification_sale_crm/sale_crm_goals_demo.xml b/addons/gamification_sale_crm/sale_crm_goals_demo.xml
index fd69c36162f..d8e26551c32 100644
--- a/addons/gamification_sale_crm/sale_crm_goals_demo.xml
+++ b/addons/gamification_sale_crm/sale_crm_goals_demo.xml
@@ -14,7 +14,7 @@
-
+
2000
inprogress
diff --git a/addons/website/static/src/js/website.tour.js b/addons/website/static/src/js/website.tour.js
index d0611419904..39eaa5b7279 100644
--- a/addons/website/static/src/js/website.tour.js
+++ b/addons/website/static/src/js/website.tour.js
@@ -17,7 +17,7 @@ website.EditorBar.include({
var $menuItem = $($.parseHTML('
'+tour.name+''));
$menuItem.click(function () {
tour.reset();
- tour.trigger();
+ tour.run();
});
menu.append($menuItem);
});
@@ -100,20 +100,29 @@ website.Tour = openerp.Class.extend({
this.registerSteps();
},
- run: function (automatic, force) {
- if (force) this.reset();
+ run: function (automatic) {
+ this.reset();
for (var k in this.localStorage) {
if (!k.indexOf("tour-") && k.indexOf("-test") > -1) return;
}
- // only one test running
- if (website.Tour.busy) return;
-
website.Tour.busy = true;
- this.localStorage.setItem("tour-"+this.id+"-test", 0);
- website.Tour.waitReady.call(this, function () {this._run(automatic, force);});
+ if (automatic) {
+ this.localStorage.setItem("tour-"+this.id+"-test-automatic", true);
+ }
+
+ // redirect to begin of the tour
+ if (this.path) {
+ var path = this.path.split('?');
+ window.location.href = path[0] + "?tutorial."+this.id+"=true" + path.slice(1, path.length).join("?");
+ return;
+ }
+
+ var self = this;
+ this.localStorage.setItem("tour-"+this.id+"-test", 0);
+ website.Tour.waitReady.call(this, function () {self._running();});
},
running: function () {
if (+this.localStorage.getItem("tour-"+this.id+"-test") >= this.steps.length) {
@@ -121,33 +130,29 @@ website.Tour = openerp.Class.extend({
return;
}
- if (website.Tour.busy || !this.testUrl()) return;
+ if (website.Tour.is_busy() || !this.testUrl()) return;
+
+ // launch tour with url
+ this.checkRunningUrl();
+
+ // mark tour as busy (only one test running)
+ if (this.localStorage.getItem("tour-"+this.id+"-test") != null) {
+ website.Tour.busy = true;
+ }
var self = this;
- website.Tour.waitReady.call(this, function () {
- self._running();
- }, 500);
+ website.Tour.waitReady.call(this, function () {self._running();});
},
- _run: function (automatic, force) {
- this.reset();
- this.localStorage.setItem("tour-"+this.id+"-test", 0);
- if (automatic) {
- this.localStorage.setItem("tour-"+this.id+"-test-automatic", true);
- }
- this.nextStep(null, automatic ? this.autoNextStep : null, automatic ? 5000 : null);
- },
_running: function () {
var stepId = this.localStorage.getItem("tour-"+this.id+"-test");
var automatic = !!this.localStorage.getItem("tour-"+this.id+"-test-automatic");
- if (stepId || this.checkRuningUrl()) {
-
+ if (stepId != null) {
if (!this.check(this.step(stepId))) {
var step = this.next(stepId);
stepId = step ? step.stepId : stepId;
}
- website.Tour.busy = true;
this.nextStep(stepId, automatic ? this.autoNextStep : null, automatic ? 5000 : null);
}
},
@@ -168,22 +173,15 @@ website.Tour = openerp.Class.extend({
$('.popover.tour').remove();
},
- trigger: function (automatic) {
- this.reset();
- if (this.path) {
- this.localStorage.setItem("tour-"+this.id+"-test", 0);
- if (automatic) this.localStorage.setItem("tour-"+this.id+"-test-automatic", true);
- var path = this.path.split('?');
- window.location.href = path[0] + "?tutorial."+this.id+"=true" + path.slice(1, path.length).join("?");
- } else {
- this.run(automatic);
- }
- },
+
testUrl: function () {
return !this.testPath || this.testPath.test(window.location.href);
},
- checkRuningUrl: function () {
- return window.location.search.indexOf("tutorial."+this.id+"=true") > -1;
+ checkRunningUrl: function () {
+ if (window.location.search.indexOf("tutorial."+this.id+"=true") > -1) {
+ this.localStorage.setItem("tour-"+this.id+"-test", 0);
+ window.location.href = window.location.href.replace(/tutorial.+=true&?/, '');
+ }
},
registerSteps: function () {
@@ -430,7 +428,15 @@ website.Tour.waitReady = function (callback) {
});
};
website.Tour.run_test = function (id) {
- website.Tour.get(id).trigger(true);
+ website.Tour.get(id).run(true);
+};
+website.Tour.is_busy = function () {
+ for (var k in this.localStorage) {
+ if (!k.indexOf("tour-")) {
+ return true;
+ }
+ }
+ return website.Tour.busy;
};
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 5e7a7888b89..1bd9f22fa31 100644
--- a/addons/website_blog/static/src/js/website.tour.blog.js
+++ b/addons/website_blog/static/src/js/website.tour.blog.js
@@ -13,7 +13,7 @@
website.BlogTour = website.Tour.extend({
id: 'blog',
name: "Create a blog post",
- testPath: /\/blogpost\/[0-9]+\//,
+ testPath: /\/(blog|blogpost)\/[0-9]+\//,
init: function (editor) {
var self = this;
self.steps = [
diff --git a/addons/website_crm_partner_assign/controllers/main.py b/addons/website_crm_partner_assign/controllers/main.py
index 17a666cf2e3..fbfb1908a14 100644
--- a/addons/website_crm_partner_assign/controllers/main.py
+++ b/addons/website_crm_partner_assign/controllers/main.py
@@ -1,12 +1,13 @@
# -*- coding: utf-8 -*-
+import werkzeug
+
import openerp
from openerp import SUPERUSER_ID
from openerp.addons.web import http
from openerp.tools.translate import _
from openerp.addons.web.http import request
from openerp.addons.website_partner.controllers import main as website_partner
-import werkzeug.urls
class WebsiteCrmPartnerAssign(http.Controller):
_references_per_page = 20
@@ -14,16 +15,25 @@ class WebsiteCrmPartnerAssign(http.Controller):
@http.route([
'/partners/',
'/partners/page//',
+
+ '/partners/grade/',
+ '/partners/grade//page//',
+
'/partners/country/',
'/partners/country/-',
'/partners/country//page//',
'/partners/country/-/page//',
+
+ '/partners/grade//country//',
+ '/partners/grade//country/-',
+ '/partners/grade//country//page//',
+ '/partners/grade//country/-/page//',
+
], type='http', auth="public", website=True, multilang=True)
- def partners(self, country_id=0, page=0, **post):
+ def partners(self, country_id=0, grade_id=0, page=0, **post):
country_obj = request.registry['res.country']
partner_obj = request.registry['res.partner']
post_name = post.get('search', '')
- grade_id = post.get('grade', '')
country = None
# format displayed membership lines domain
@@ -83,7 +93,7 @@ class WebsiteCrmPartnerAssign(http.Controller):
context=request.context, count=True)
grades.insert(0, {
'grade_id_count': grades_partners,
- 'grade_id': ("all", _("All Levels"))
+ 'grade_id': (0, _("All Categories"))
})
values = {
diff --git a/addons/website_crm_partner_assign/views/website_crm_partner_assign.xml b/addons/website_crm_partner_assign/views/website_crm_partner_assign.xml
index cd06e515a3e..cd2e3cb58bd 100644
--- a/addons/website_crm_partner_assign/views/website_crm_partner_assign.xml
+++ b/addons/website_crm_partner_assign/views/website_crm_partner_assign.xml
@@ -35,13 +35,27 @@
Contact a reseller
+
-
Resellers by Country
+
+
+
+
+
@@ -60,17 +76,7 @@
-
-
-
+
@@ -103,7 +109,7 @@
-
+
World Map