[MERGE] Merge parents
bzr revid: rim@openerp.com-20131106152434-9cx60zw2bbudi8d4
This commit is contained in:
@@ -6,7 +6,7 @@ import math
|
||||
import simplejson
|
||||
import traceback
|
||||
import urllib
|
||||
from urlparse import urljoin
|
||||
import urlparse
|
||||
|
||||
import werkzeug
|
||||
import werkzeug.exceptions
|
||||
@@ -53,29 +53,33 @@ def auth_method_public():
|
||||
request.uid = request.session.uid
|
||||
http.auth_methods['public'] = auth_method_public
|
||||
|
||||
def url_for(path, lang=None, keep_query=None):
|
||||
if request:
|
||||
path = urljoin(request.httprequest.path, path)
|
||||
def url_for(path_or_uri, lang=None, keep_query=None):
|
||||
location = path_or_uri.strip()
|
||||
url = urlparse.urlparse(location)
|
||||
if request and not url.netloc and not url.scheme:
|
||||
location = urlparse.urljoin(request.httprequest.path, location)
|
||||
langs = request.context.get('langs')
|
||||
if path[0] == '/' and (len(langs) > 1 or lang):
|
||||
ps = path.split('/')
|
||||
if location[0] == '/' and (len(langs) > 1 or lang):
|
||||
ps = location.split('/')
|
||||
lang = lang or request.context.get('lang')
|
||||
if ps[1] in langs:
|
||||
ps[1] = lang
|
||||
else:
|
||||
ps.insert(1, lang)
|
||||
path = '/'.join(ps)
|
||||
location = '/'.join(ps)
|
||||
if keep_query:
|
||||
keep = []
|
||||
params = werkzeug.url_decode(request.httprequest.query_string)
|
||||
params_keys = tuple(params.keys())
|
||||
url = urlparse.urlparse(location)
|
||||
location = url.path
|
||||
params = werkzeug.url_decode(url.query)
|
||||
query_params = frozenset(werkzeug.url_decode(request.httprequest.query_string).keys())
|
||||
for kq in keep_query:
|
||||
keep += fnmatch.filter(params_keys, kq)
|
||||
if keep:
|
||||
params = dict([(k, params[k]) for k in keep])
|
||||
path += u'?%s' % werkzeug.urls.url_encode(params)
|
||||
for param in fnmatch.filter(query_params, kq):
|
||||
params[param] = request.params[param]
|
||||
params = werkzeug.urls.url_encode(params)
|
||||
if params:
|
||||
location += '?%s' % params
|
||||
|
||||
return path
|
||||
return location
|
||||
|
||||
def urlplus(url, params):
|
||||
if not params:
|
||||
|
||||
+1998
-722
File diff suppressed because it is too large
Load Diff
@@ -239,7 +239,7 @@ footer {
|
||||
}
|
||||
|
||||
.oe_structure.oe_empty:empty:before, [data-oe-type=html]:empty:before, .oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child:before, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child:before {
|
||||
content: "Click Edit To Create Content";
|
||||
content: "Press The Top-Left Edit Button";
|
||||
text-align: center;
|
||||
display: block;
|
||||
padding-top: 160px;
|
||||
|
||||
@@ -164,7 +164,7 @@ footer
|
||||
position: static
|
||||
|
||||
.oe_structure.oe_empty:empty:before, [data-oe-type=html]:empty:before, .oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child:before, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child:before
|
||||
content: 'Click Edit To Create Content'
|
||||
content: 'Press The Top-Left Edit Button'
|
||||
text-align: center
|
||||
display: block
|
||||
padding-top: 160px
|
||||
|
||||
@@ -11,6 +11,15 @@
|
||||
if (!is_smartphone) {
|
||||
website.ready().then(website.init_editor);
|
||||
}
|
||||
|
||||
$(document).on('hide.bs.dropdown', '.dropdown', function (ev) {
|
||||
// Prevent dropdown closing when a contenteditable children is focused
|
||||
if (ev.originalEvent
|
||||
&& $(ev.target).has(ev.originalEvent.target).length
|
||||
&& $(ev.originalEvent.target).is('[contenteditable]')) {
|
||||
ev.preventDefault();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function link_dialog(editor) {
|
||||
@@ -361,7 +370,7 @@
|
||||
});
|
||||
// Adding Static Menus
|
||||
menu.append('<li class="divider"></li><li class="js_change_theme"><a href="/page/website.themes">Change Theme</a></li>');
|
||||
menu.append('<li class="divider"></li><li><a data-action="ace" href="#">Advanced view editor</a></li>');
|
||||
menu.append('<li class="divider"></li><li><a data-action="ace" href="#">HTML Editor</a></li>');
|
||||
self.trigger('rte:customize_menu_ready');
|
||||
}
|
||||
);
|
||||
|
||||
@@ -361,7 +361,7 @@
|
||||
}
|
||||
|
||||
self.create_overlay($target);
|
||||
$target.data("snippet-editor").build_snippet($target);
|
||||
$target.data("snippet-editor").drop_and_build_snippet($target);
|
||||
|
||||
} else {
|
||||
$target = $(this).data('target');
|
||||
@@ -369,7 +369,7 @@
|
||||
self.create_overlay($target);
|
||||
if (website.snippet.editorRegistry[snipped_id]) {
|
||||
var snippet = new website.snippet.editorRegistry[snipped_id](self, $target);
|
||||
snippet.build_snippet($target);
|
||||
snippet.drop_and_build_snippet($target);
|
||||
}
|
||||
}
|
||||
setTimeout(function () {self.make_active($target);},0);
|
||||
@@ -711,7 +711,7 @@
|
||||
|
||||
if (website.snippet.editorRegistry[snipped_id]) {
|
||||
var snippet = new website.snippet.editorRegistry[snipped_id](this, this.$target);
|
||||
snippet.build_snippet(this.$target);
|
||||
snippet.drop_and_build_snippet(this.$target);
|
||||
}
|
||||
var _class = "oe_snippet_" + snipped_id + " " + ($li.data("class") || "");
|
||||
if (active) {
|
||||
@@ -757,11 +757,11 @@
|
||||
},
|
||||
|
||||
/*
|
||||
* build_snippet
|
||||
* drop_and_build_snippet
|
||||
* This method is called just after that a thumbnail is drag and dropped into a drop zone
|
||||
* (after the insertion of this.$body, if this.$body exists)
|
||||
*/
|
||||
build_snippet: function ($target) {
|
||||
drop_and_build_snippet: function ($target) {
|
||||
},
|
||||
|
||||
/* onFocus
|
||||
@@ -1027,7 +1027,7 @@
|
||||
},
|
||||
});
|
||||
website.snippet.editorRegistry.carousel = website.snippet.editorRegistry.resize.extend({
|
||||
build_snippet: function() {
|
||||
drop_and_build_snippet: function() {
|
||||
var id = 0;
|
||||
$("body .carousel").each(function () {
|
||||
var _id = +$(this).attr("id").replace(/^myCarousel/, '');
|
||||
@@ -1039,10 +1039,6 @@
|
||||
this.$target.find(".carousel-control").attr("href", "#myCarousel" + id);
|
||||
this.$target.find("[data-target='#myCarousel']").attr("data-target", "#myCarousel" + id);
|
||||
|
||||
this.$target.attr('contentEditable', 'false')
|
||||
.find('.content, .carousel-image img')
|
||||
.attr('contentEditable', 'true');
|
||||
|
||||
this.rebind_event();
|
||||
},
|
||||
onFocus: function () {
|
||||
@@ -1096,6 +1092,10 @@
|
||||
self.$target.carousel($(this).data('slide')); });
|
||||
this.$target.off('click').on('click', '.carousel-indicators [data-target]', function () {
|
||||
self.$target.carousel(+$(this).data('slide-to')); });
|
||||
|
||||
this.$target.attr('contentEditable', 'false')
|
||||
.find('.content, .carousel-image img')
|
||||
.attr('contentEditable', 'true');
|
||||
},
|
||||
on_add: function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
@@ -18,22 +18,23 @@
|
||||
You are about to enter the translation mode.
|
||||
</p>
|
||||
<p>
|
||||
In this mode you can not change the structure of the document, you can only translate text.
|
||||
</p>
|
||||
<p>
|
||||
Here are the visuals used in order to help you in your translation flow:
|
||||
Here are the visuals used to help you translate efficiently:
|
||||
<ul class="oe_translate_examples">
|
||||
<li class="oe_translatable_text">
|
||||
Normal translatable content
|
||||
</li>
|
||||
<li class="oe_translatable_field">
|
||||
ERP translatable object data
|
||||
</li>
|
||||
<li class="oe_translatable_todo">
|
||||
Translation TODO
|
||||
Content to translate
|
||||
</li>
|
||||
<li class="oe_translatable_text">
|
||||
Translated content
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
<p>
|
||||
In this mode, you can only translate texts. To
|
||||
change the structure of the page, you must edit the
|
||||
master page. Each modification on the master page
|
||||
is automatically applied to all translated
|
||||
versions.
|
||||
</p>
|
||||
</section>
|
||||
<hr/>
|
||||
<section class="row">
|
||||
|
||||
@@ -61,18 +61,23 @@ class CrawlSuite(unittest2.TestSuite):
|
||||
]))
|
||||
|
||||
def _authenticate(self, user, password):
|
||||
if user is None: return
|
||||
|
||||
url = 'http://localhost:{port}/login?{query}'.format(
|
||||
# force tools.config['db_name'] in user session so opening `/` doesn't
|
||||
# blow up in multidb situations
|
||||
self.opener.open('http://localhost:{port}/web/?db={db}'.format(
|
||||
port=tools.config['xmlrpc_port'],
|
||||
query=urllib.urlencode({
|
||||
'db': tools.config['db_name'],
|
||||
'login': user,
|
||||
'key': password,
|
||||
})
|
||||
)
|
||||
auth = self.opener.open(url)
|
||||
assert auth.getcode() < 400, "Auth failure %d" % auth.getcode()
|
||||
db=urllib.quote_plus(tools.config['db_name']),
|
||||
))
|
||||
if user is not None:
|
||||
url = 'http://localhost:{port}/login?{query}'.format(
|
||||
port=tools.config['xmlrpc_port'],
|
||||
query=urllib.urlencode({
|
||||
'db': tools.config['db_name'],
|
||||
'login': user,
|
||||
'key': password,
|
||||
})
|
||||
)
|
||||
auth = self.opener.open(url)
|
||||
assert auth.getcode() < 400, "Auth failure %d" % auth.getcode()
|
||||
|
||||
def _wrapped_run(self, result, debug=False):
|
||||
paths = collections.deque(['/'])
|
||||
@@ -110,6 +115,6 @@ class CrawlSuite(unittest2.TestSuite):
|
||||
def load_tests(loader, base, _):
|
||||
base.addTest(CrawlSuite())
|
||||
# blog duplicate (&al?) are on links
|
||||
#base.addTest(CrawlSuite('admin', tools.config['admin_passwd']))
|
||||
#base.addTest(CrawlSuite('demo', 'demo'))
|
||||
base.addTest(CrawlSuite('admin', tools.config['admin_passwd']))
|
||||
base.addTest(CrawlSuite('demo', 'demo'))
|
||||
return base
|
||||
|
||||
@@ -176,19 +176,21 @@
|
||||
</h2>
|
||||
</div>
|
||||
<div class="col-md-5 col-lg-offset-1" name="about_us">
|
||||
<h4>
|
||||
<span t-field="res_company.name">Your Company</span>
|
||||
<small> - <a href="/page/website.aboutus">About us</a></small>
|
||||
</h4>
|
||||
<p>
|
||||
We are a team of passionated people whose goal is to improve everyone's
|
||||
life through disruptive products. We build great products to solve your
|
||||
business problems.
|
||||
</p>
|
||||
<p>
|
||||
Our products are designed for small to medium companies willing to optimize
|
||||
their performance.
|
||||
</p>
|
||||
<div>
|
||||
<h4>
|
||||
<span t-field="res_company.name">Your Company</span>
|
||||
<small> - <a href="/page/website.aboutus">About us</a></small>
|
||||
</h4>
|
||||
<p>
|
||||
We are a team of passionated people whose goal is to improve everyone's
|
||||
life through disruptive products. We build great products to solve your
|
||||
business problems.
|
||||
</p>
|
||||
<p>
|
||||
Our products are designed for small to medium companies willing to optimize
|
||||
their performance.
|
||||
</p>
|
||||
</div>
|
||||
<ul class="nav nav-pills js_language_selector" t-if="request.multilang and
|
||||
(len(website.language_ids) > 1 or editable)">
|
||||
<li t-foreach="website.language_ids" t-as="lg">
|
||||
@@ -209,7 +211,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="container mt16">
|
||||
<div class="pull-right" t-ignore="true">
|
||||
<div class="pull-right" t-ignore="true" t-if="not editable">
|
||||
Create a <a href="http://openerp.com/apps/website">free website</a> with
|
||||
<a class="label label-danger" href="https://openerp.com/apps/website">OpenERP</a>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user