[MERGE] from saas-3
bzr revid: chm@openerp.com-20140206150121-drs3ybhgx5837zt2
This commit is contained in:
commit
64eb4376ee
|
@ -84,7 +84,11 @@ def is_multilang_url(path, langs=None):
|
|||
|
||||
def slugify(s, max_length=None):
|
||||
if slugify_lib:
|
||||
return slugify_lib.slugify(s, max_length)
|
||||
# There are 2 different libraries only python-slugify is supported
|
||||
try:
|
||||
return slugify_lib.slugify(s, max_length=max_length)
|
||||
except TypeError:
|
||||
pass
|
||||
spaceless = re.sub(r'\s+', '-', s)
|
||||
specialless = re.sub(r'[^-_A-Za-z0-9]', '', spaceless)
|
||||
return specialless[:max_length]
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
"use strict";
|
||||
|
||||
var website = openerp.website;
|
||||
var _t = openerp._t;
|
||||
website.is_editable = true;
|
||||
website.is_editable_button = true;
|
||||
|
||||
|
@ -16,7 +17,8 @@
|
|||
'click a[data-action=new_page]': function (ev) {
|
||||
ev.preventDefault();
|
||||
website.prompt({
|
||||
window_title: "New Page",
|
||||
id: "editor_new_page",
|
||||
window_title: _t("New Page"),
|
||||
input: "Page Title",
|
||||
}).then(function (val) {
|
||||
if (val) {
|
||||
|
|
|
@ -102,7 +102,7 @@
|
|||
<h3 class="modal-title"><t t-esc="window_title"/></h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" role="form">
|
||||
<form class="form-horizontal" role="form" t-att-id="id">
|
||||
<div class="form-group mb0">
|
||||
<label for="page-name" class="col-sm-3 control-label">
|
||||
<t t-esc="field_name"/>:
|
||||
|
|
|
@ -38,13 +38,14 @@
|
|||
template: self.popover({ fixed: true }),
|
||||
},
|
||||
{
|
||||
element: '.modal button.btn-primary',
|
||||
element: '.modal:has(#editor_new_blog) button.btn-primary',
|
||||
placement: 'bottom',
|
||||
title: _t("Create Blog Post"),
|
||||
content: _t("Click <em>Continue</em> to create the blog post."),
|
||||
},
|
||||
{
|
||||
waitNot: '.modal',
|
||||
waitFor: 'body:has(button[data-action=save]:visible):has(.js_blog)',
|
||||
title: _t("Blog Post Created"),
|
||||
content: _t("This is your new blog post. Let's edit it."),
|
||||
template: self.popover({ next: _t("Continue") }),
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
"use strict";
|
||||
|
||||
var website = openerp.website;
|
||||
var _t = openerp._t;
|
||||
website.add_template_file('/website_blog/static/src/xml/website_blog.xml');
|
||||
|
||||
website.is_editable = true;
|
||||
|
@ -16,7 +17,8 @@
|
|||
'click a[data-action=new_blog_post]': function (ev) {
|
||||
ev.preventDefault();
|
||||
website.prompt({
|
||||
window_title: "New Blog Post",
|
||||
id: "editor_new_blog",
|
||||
window_title: _t("New Blog Post"),
|
||||
select: "Select Blog",
|
||||
init: function (field) {
|
||||
return website.session.model('blog.blog')
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
template: self.popover({ fixed: true }),
|
||||
},
|
||||
{
|
||||
element: '.modal:contains("New Event") input[type=text]',
|
||||
element: '.modal #editor_new_event input[type=text]',
|
||||
sampleText: 'Advanced Technical Training',
|
||||
placement: 'right',
|
||||
title: _t("Create an Event Name"),
|
||||
|
@ -52,7 +52,7 @@
|
|||
content: _t("Click <em>Continue</em> to create the event."),
|
||||
},
|
||||
{
|
||||
waitFor: '#website-top-navbar button[data-action="save"]:visible',
|
||||
waitFor: 'body:has(button[data-action=save]:visible):has(.js_event)',
|
||||
title: _t("New Event Created"),
|
||||
content: _t("This is your new event page. We will edit the event presentation page."),
|
||||
template: self.popover({ next: _t("Continue") }),
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
"use strict";
|
||||
|
||||
var website = openerp.website;
|
||||
var _t = openerp._t;
|
||||
website.add_template_file('/website_event/static/src/xml/website_event.xml');
|
||||
|
||||
website.is_editable = true;
|
||||
|
@ -16,7 +17,8 @@
|
|||
'click a[data-action=new_event]': function (ev) {
|
||||
ev.preventDefault();
|
||||
website.prompt({
|
||||
window_title: "New Event",
|
||||
id: "editor_new_event",
|
||||
window_title: _t("New Event"),
|
||||
input: "Event Name",
|
||||
}).then(function (event_name) {
|
||||
website.form('/event/add_event', 'POST', {
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
template: self.popover({ fixed: true }),
|
||||
},
|
||||
{
|
||||
element: '.modal:contains("New Product") input[type=text]',
|
||||
element: '.modal #editor_new_product input[type=text]',
|
||||
sampleText: 'New Product',
|
||||
placement: 'right',
|
||||
title: _t("Choose name"),
|
||||
|
@ -52,7 +52,7 @@
|
|||
content: _t("Click <em>Continue</em> to create the product."),
|
||||
},
|
||||
{
|
||||
waitFor: '#website-top-navbar button[data-action="save"]:visible',
|
||||
waitFor: 'body:has(button[data-action=save]:visible):has(.js_sale)',
|
||||
title: _t("New product created"),
|
||||
content: _t("This page contains all the information related to the new product."),
|
||||
template: self.popover({ next: _t("Continue") }),
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
"use strict";
|
||||
|
||||
var website = openerp.website;
|
||||
var _t = openerp._t;
|
||||
website.add_template_file('/website_sale/static/src/xml/website_sale.xml');
|
||||
|
||||
website.is_editable = true;
|
||||
|
@ -16,7 +17,8 @@
|
|||
'click a[data-action=new_product]': function (ev) {
|
||||
ev.preventDefault();
|
||||
website.prompt({
|
||||
window_title: "New Product",
|
||||
id: "editor_new_product",
|
||||
window_title: _t("New Product"),
|
||||
input: "Product Name",
|
||||
}).then(function (name) {
|
||||
website.form('/shop/add_product', 'POST', {
|
||||
|
|
Loading…
Reference in New Issue