[MERGE] Forward port of saas-3 branch up to revid 9093 mat@openerp.com-20140203091848-9kspakimqorltvxx
bzr revid: mat@openerp.com-20140203095528-xo1u0vah94edmbub
This commit is contained in:
commit
c25827f845
|
@ -14,7 +14,7 @@
|
||||||
<field name="user_id" eval="ref('base.user_demo')" />
|
<field name="user_id" eval="ref('base.user_demo')" />
|
||||||
<field name="line_id" eval="ref('line_crm_sale1')" />
|
<field name="line_id" eval="ref('line_crm_sale1')" />
|
||||||
<field name="start_date" eval="time.strftime('%Y-%m-01')" />
|
<field name="start_date" eval="time.strftime('%Y-%m-01')" />
|
||||||
<field name="end_date" eval="time.strftime('%Y-%m-31')" />
|
<field name="end_date" eval="(DateTime.today().replace(day=1)+relativedelta(months=1, days=-1)).strftime('%Y-%m-%d')" />
|
||||||
<field name="target_goal">2000</field>
|
<field name="target_goal">2000</field>
|
||||||
<field name="state">inprogress</field>
|
<field name="state">inprogress</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
|
@ -17,7 +17,7 @@ website.EditorBar.include({
|
||||||
var $menuItem = $($.parseHTML('<li><a href="#">'+tour.name+'</a></li>'));
|
var $menuItem = $($.parseHTML('<li><a href="#">'+tour.name+'</a></li>'));
|
||||||
$menuItem.click(function () {
|
$menuItem.click(function () {
|
||||||
tour.reset();
|
tour.reset();
|
||||||
tour.trigger();
|
tour.run();
|
||||||
});
|
});
|
||||||
menu.append($menuItem);
|
menu.append($menuItem);
|
||||||
});
|
});
|
||||||
|
@ -100,20 +100,29 @@ website.Tour = openerp.Class.extend({
|
||||||
this.registerSteps();
|
this.registerSteps();
|
||||||
},
|
},
|
||||||
|
|
||||||
run: function (automatic, force) {
|
run: function (automatic) {
|
||||||
if (force) this.reset();
|
this.reset();
|
||||||
|
|
||||||
for (var k in this.localStorage) {
|
for (var k in this.localStorage) {
|
||||||
if (!k.indexOf("tour-") && k.indexOf("-test") > -1) return;
|
if (!k.indexOf("tour-") && k.indexOf("-test") > -1) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// only one test running
|
|
||||||
if (website.Tour.busy) return;
|
|
||||||
|
|
||||||
website.Tour.busy = true;
|
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 () {
|
running: function () {
|
||||||
if (+this.localStorage.getItem("tour-"+this.id+"-test") >= this.steps.length) {
|
if (+this.localStorage.getItem("tour-"+this.id+"-test") >= this.steps.length) {
|
||||||
|
@ -121,33 +130,29 @@ website.Tour = openerp.Class.extend({
|
||||||
return;
|
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;
|
var self = this;
|
||||||
website.Tour.waitReady.call(this, function () {
|
website.Tour.waitReady.call(this, function () {self._running();});
|
||||||
self._running();
|
|
||||||
}, 500);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_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 () {
|
_running: function () {
|
||||||
var stepId = this.localStorage.getItem("tour-"+this.id+"-test");
|
var stepId = this.localStorage.getItem("tour-"+this.id+"-test");
|
||||||
var automatic = !!this.localStorage.getItem("tour-"+this.id+"-test-automatic");
|
var automatic = !!this.localStorage.getItem("tour-"+this.id+"-test-automatic");
|
||||||
|
|
||||||
if (stepId || this.checkRuningUrl()) {
|
if (stepId != null) {
|
||||||
|
|
||||||
if (!this.check(this.step(stepId))) {
|
if (!this.check(this.step(stepId))) {
|
||||||
var step = this.next(stepId);
|
var step = this.next(stepId);
|
||||||
stepId = step ? step.stepId : stepId;
|
stepId = step ? step.stepId : stepId;
|
||||||
}
|
}
|
||||||
website.Tour.busy = true;
|
|
||||||
this.nextStep(stepId, automatic ? this.autoNextStep : null, automatic ? 5000 : null);
|
this.nextStep(stepId, automatic ? this.autoNextStep : null, automatic ? 5000 : null);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -168,22 +173,15 @@ website.Tour = openerp.Class.extend({
|
||||||
|
|
||||||
$('.popover.tour').remove();
|
$('.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 () {
|
testUrl: function () {
|
||||||
return !this.testPath || this.testPath.test(window.location.href);
|
return !this.testPath || this.testPath.test(window.location.href);
|
||||||
},
|
},
|
||||||
checkRuningUrl: function () {
|
checkRunningUrl: function () {
|
||||||
return window.location.search.indexOf("tutorial."+this.id+"=true") > -1;
|
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 () {
|
registerSteps: function () {
|
||||||
|
@ -430,7 +428,15 @@ website.Tour.waitReady = function (callback) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
website.Tour.run_test = function (id) {
|
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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
website.BlogTour = website.Tour.extend({
|
website.BlogTour = website.Tour.extend({
|
||||||
id: 'blog',
|
id: 'blog',
|
||||||
name: "Create a blog post",
|
name: "Create a blog post",
|
||||||
testPath: /\/blogpost\/[0-9]+\//,
|
testPath: /\/(blog|blogpost)\/[0-9]+\//,
|
||||||
init: function (editor) {
|
init: function (editor) {
|
||||||
var self = this;
|
var self = this;
|
||||||
self.steps = [
|
self.steps = [
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import werkzeug
|
||||||
|
|
||||||
import openerp
|
import openerp
|
||||||
from openerp import SUPERUSER_ID
|
from openerp import SUPERUSER_ID
|
||||||
from openerp.addons.web import http
|
from openerp.addons.web import http
|
||||||
from openerp.tools.translate import _
|
from openerp.tools.translate import _
|
||||||
from openerp.addons.web.http import request
|
from openerp.addons.web.http import request
|
||||||
from openerp.addons.website_partner.controllers import main as website_partner
|
from openerp.addons.website_partner.controllers import main as website_partner
|
||||||
import werkzeug.urls
|
|
||||||
|
|
||||||
class WebsiteCrmPartnerAssign(http.Controller):
|
class WebsiteCrmPartnerAssign(http.Controller):
|
||||||
_references_per_page = 20
|
_references_per_page = 20
|
||||||
|
@ -14,16 +15,25 @@ class WebsiteCrmPartnerAssign(http.Controller):
|
||||||
@http.route([
|
@http.route([
|
||||||
'/partners/',
|
'/partners/',
|
||||||
'/partners/page/<int:page>/',
|
'/partners/page/<int:page>/',
|
||||||
|
|
||||||
|
'/partners/grade/<int:grade_id>',
|
||||||
|
'/partners/grade/<int:grade_id>/page/<int:page>/',
|
||||||
|
|
||||||
'/partners/country/<int:country_id>',
|
'/partners/country/<int:country_id>',
|
||||||
'/partners/country/<country_name>-<int:country_id>',
|
'/partners/country/<country_name>-<int:country_id>',
|
||||||
'/partners/country/<int:country_id>/page/<int:page>/',
|
'/partners/country/<int:country_id>/page/<int:page>/',
|
||||||
'/partners/country/<country_name>-<int:country_id>/page/<int:page>/',
|
'/partners/country/<country_name>-<int:country_id>/page/<int:page>/',
|
||||||
|
|
||||||
|
'/partners/grade/<int:grade_id>/country/<int:country_id>/',
|
||||||
|
'/partners/grade/<int:grade_id>/country/<country_name>-<int:country_id>',
|
||||||
|
'/partners/grade/<int:grade_id>/country/<int:country_id>/page/<int:page>/',
|
||||||
|
'/partners/grade/<int:grade_id>/country/<country_name>-<int:country_id>/page/<int:page>/',
|
||||||
|
|
||||||
], type='http', auth="public", website=True, multilang=True)
|
], 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']
|
country_obj = request.registry['res.country']
|
||||||
partner_obj = request.registry['res.partner']
|
partner_obj = request.registry['res.partner']
|
||||||
post_name = post.get('search', '')
|
post_name = post.get('search', '')
|
||||||
grade_id = post.get('grade', '')
|
|
||||||
country = None
|
country = None
|
||||||
|
|
||||||
# format displayed membership lines domain
|
# format displayed membership lines domain
|
||||||
|
@ -83,7 +93,7 @@ class WebsiteCrmPartnerAssign(http.Controller):
|
||||||
context=request.context, count=True)
|
context=request.context, count=True)
|
||||||
grades.insert(0, {
|
grades.insert(0, {
|
||||||
'grade_id_count': grades_partners,
|
'grade_id_count': grades_partners,
|
||||||
'grade_id': ("all", _("All Levels"))
|
'grade_id': (0, _("All Categories"))
|
||||||
})
|
})
|
||||||
|
|
||||||
values = {
|
values = {
|
||||||
|
|
|
@ -35,13 +35,27 @@
|
||||||
Contact a reseller
|
Contact a reseller
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-4 mb32" id="partner_left">
|
<div class="col-md-4 mb32" id="partner_left">
|
||||||
<h3>Resellers by Country</h3>
|
|
||||||
<ul class="nav nav-pills nav-stacked mt16">
|
<ul class="nav nav-pills nav-stacked mt16">
|
||||||
|
<li class="nav-header"><h3>Categories</h3></li>
|
||||||
|
<t t-foreach="grades" t-as="grade">
|
||||||
|
<li t-if="grade['grade_id']" t-att-class="grade['grade_id'][0] == grade_id and 'active' or ''">
|
||||||
|
<a t-attf-href="#{ grade['grade_id'][0] and '/partners/grade/%s' % grade['grade_id'][0] or '/partners' }#{ current_country_id and ('/country/%s' % current_country_id) or '' }#{ search_path }">
|
||||||
|
<span class="badge pull-right" t-esc="grade['grade_id_count'] or ''"/>
|
||||||
|
<t t-esc="grade['grade_id'][1]"/>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</t>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<ul id="reseller_countries" class="nav nav-pills nav-stacked mt16">
|
||||||
|
<li class="nav-header"><h3>Locations</h3></li>
|
||||||
<t t-foreach="countries" t-as="country_dict">
|
<t t-foreach="countries" t-as="country_dict">
|
||||||
<t t-if="country_dict['country_id']">
|
<t t-if="country_dict['country_id']">
|
||||||
<li t-att-class="country_dict['country_id'][0] == current_country_id and 'active' or ''">
|
<li t-att-class="country_dict['country_id'][0] == current_country_id and 'active' or ''">
|
||||||
<a t-attf-href="#{ country_dict['country_id'][0] and '/partners/country/%s' % slug(country_dict['country_id']) or '/partners/' }#{ search_path }">
|
<a t-attf-href="#{ country_dict['country_id'][0] and ('/partners/country/%s' % slug(country_dict['country_id'])) or '/partners/' }#{ search_path }">
|
||||||
<span class="badge pull-right" t-esc="country_dict['country_id_count'] or ''"/>
|
<span class="badge pull-right" t-esc="country_dict['country_id_count'] or ''"/>
|
||||||
<t t-esc="country_dict['country_id'][1]"/>
|
<t t-esc="country_dict['country_id'][1]"/>
|
||||||
</a>
|
</a>
|
||||||
|
@ -49,7 +63,9 @@
|
||||||
</t>
|
</t>
|
||||||
</t>
|
</t>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-8" id="ref_content">
|
<div class="col-md-8" id="ref_content">
|
||||||
<div class='navbar'>
|
<div class='navbar'>
|
||||||
<div>
|
<div>
|
||||||
|
@ -60,17 +76,7 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="text" name="search" class="search-query col-md-2 mt4 form-control" placeholder="Search" t-att-value="searches.get('search', '')"/>
|
<input type="text" name="search" class="search-query col-md-2 mt4 form-control" placeholder="Search" t-att-value="searches.get('search', '')"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
|
||||||
<select class="search-query col-md-2 mt4 form-control" name="grade" t-if="len(grades) > 1" onchange="submit()">
|
|
||||||
<t t-foreach="grades">
|
|
||||||
<t t-if="grade_id">
|
|
||||||
<option t-att-selected="searches.get('grade') == str(grade_id and grade_id[0]) and 'selected'" t-att-value="grade_id[0]">
|
|
||||||
<t t-esc="grade_id[1]"/> (<t t-esc="grade_id_count"/>)
|
|
||||||
</option>
|
|
||||||
</t>
|
|
||||||
</t>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -103,7 +109,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template id="ref_country" inherit_id="website_crm_partner_assign.index" inherit_option_id="website_crm_partner_assign.index" name="Left World Map">
|
<template id="ref_country" inherit_id="website_crm_partner_assign.index" inherit_option_id="website_crm_partner_assign.index" name="Left World Map">
|
||||||
<xpath expr="//div[@id='partner_left']//ul" position="after">
|
<xpath expr="//ul[@id='reseller_countries']" position="after">
|
||||||
<h3>World Map</h3>
|
<h3>World Map</h3>
|
||||||
<ul class="nav">
|
<ul class="nav">
|
||||||
<iframe t-attf-src="/google_map/?width=320&height=240&partner_ids=#{ google_map_partner_ids }&partner_url=/partners/"
|
<iframe t-attf-src="/google_map/?width=320&height=240&partner_ids=#{ google_map_partner_ids }&partner_url=/partners/"
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
<section class="oe_container oe_dark">
|
<section class="oe_container oe_dark">
|
||||||
<div class="oe_row">
|
<div class="oe_row">
|
||||||
<h2 class="oe_slogan">Create Awsome Product Pages</h2>
|
<h2 class="oe_slogan">Create Awesome Product Pages</h2>
|
||||||
<h3 class="oe_slogan">Get rid of old WYSIWYG editors</h3>
|
<h3 class="oe_slogan">Get rid of old WYSIWYG editors</h3>
|
||||||
<div class="oe_span6">
|
<div class="oe_span6">
|
||||||
<p class='oe_mt32'>
|
<p class='oe_mt32'>
|
||||||
|
@ -295,7 +295,7 @@
|
||||||
|
|
||||||
<section class="oe_container">
|
<section class="oe_container">
|
||||||
<div class="oe_row">
|
<div class="oe_row">
|
||||||
<h2 class="oe_slogan">Fully Integrated With Others Apps</h2>
|
<h2 class="oe_slogan">Fully Integrated With Other Apps</h2>
|
||||||
<h3 class="oe_slogan">Get hundreds of open source apps for free</h3>
|
<h3 class="oe_slogan">Get hundreds of open source apps for free</h3>
|
||||||
<div class="oe_span4">
|
<div class="oe_span4">
|
||||||
<a href="/apps/website">
|
<a href="/apps/website">
|
||||||
|
|
Loading…
Reference in New Issue