[MERGE] Sync with website-al main branch
bzr revid: tde@openerp.com-20140121105805-msfn6i901v7kr2o3
This commit is contained in:
commit
93711b0f91
|
@ -207,6 +207,44 @@ ul.oe_menu_editor .disclose {
|
|||
visibility: visible !important;
|
||||
}
|
||||
|
||||
.modal .font-icons-icons {
|
||||
font-size: 2em;
|
||||
max-height: 6em;
|
||||
overflow: auto;
|
||||
}
|
||||
.modal .font-icons-icons .font-icons-icon {
|
||||
display: inline-block;
|
||||
width: 2em;
|
||||
padding: 0.25em;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
.modal .font-icons {
|
||||
position: relative;
|
||||
display: block;
|
||||
}
|
||||
.modal .font-icons:before {
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70);
|
||||
opacity: 0.7;
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
left: 3px;
|
||||
font-size: 2em;
|
||||
}
|
||||
.modal #icon-search {
|
||||
padding-left: 2.5em;
|
||||
}
|
||||
.modal #fa-preview {
|
||||
text-align: center;
|
||||
}
|
||||
.modal #fa-preview span {
|
||||
cursor: pointer;
|
||||
padding: 0 15px;
|
||||
}
|
||||
.modal #fa-preview .font-icons-selected {
|
||||
background-color: #dddddd;
|
||||
}
|
||||
|
||||
.existing-attachments .pager .disabled {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -172,6 +172,43 @@ ul.oe_menu_editor
|
|||
display: inline-block !important
|
||||
visibility: visible !important
|
||||
|
||||
// fontawesome modal
|
||||
.modal
|
||||
.font-icons-icons
|
||||
font-size: 2em
|
||||
max-height: 6em
|
||||
overflow: auto
|
||||
|
||||
.font-icons-icon
|
||||
display: inline-block
|
||||
width: 2em
|
||||
padding: 0.25em
|
||||
text-align: center
|
||||
cursor: pointer
|
||||
|
||||
.font-icons
|
||||
position: relative
|
||||
display: block
|
||||
|
||||
&:before
|
||||
+opacity(0.7)
|
||||
position: absolute
|
||||
top: 2px
|
||||
left: 3px
|
||||
font-size: 2em
|
||||
#icon-search
|
||||
padding-left: 2.5em
|
||||
|
||||
#fa-preview
|
||||
text-align: center
|
||||
|
||||
span
|
||||
cursor: pointer
|
||||
padding: 0 15px
|
||||
.font-icons-selected
|
||||
background-color: #ddd
|
||||
|
||||
|
||||
.existing-attachments .pager .disabled
|
||||
display: none
|
||||
|
||||
|
|
|
@ -1456,6 +1456,34 @@
|
|||
template: 'website.editor.dialog.font-icons',
|
||||
events : _.extend({}, website.editor.Dialog.prototype.events, {
|
||||
change: 'update_preview',
|
||||
'click .font-icons-icon': function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
this.$('#fa-icon').val(e.target.getAttribute('data-id'));
|
||||
this.update_preview();
|
||||
},
|
||||
'click #fa-preview span': function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
this.$('#fa-size').val(e.target.getAttribute('data-size'));
|
||||
this.update_preview();
|
||||
},
|
||||
'input input#icon-search': function () {
|
||||
var needle = this.$('#icon-search').val();
|
||||
var icons = this.icons;
|
||||
if (needle) {
|
||||
icons = _(icons).filter(function (icon) {
|
||||
return icon.id.substring(3).indexOf(needle) !== -1;
|
||||
});
|
||||
}
|
||||
|
||||
this.$('div.font-icons-icons').html(
|
||||
openerp.qweb.render(
|
||||
'website.editor.dialog.font-icons.icons',
|
||||
{icons: icons}));
|
||||
},
|
||||
}),
|
||||
|
||||
// List of FontAwesome icons in 4.0.3, extracted from the cheatsheet.
|
||||
|
@ -1474,26 +1502,7 @@
|
|||
* isn't customizable (?) and the fontawesome glyphs fail to appear.
|
||||
*/
|
||||
start: function () {
|
||||
var self = this;
|
||||
var started = this._super();
|
||||
this.$('#fa-icon').select2({
|
||||
data: this.icons,
|
||||
initSelection: function (element, callback) {
|
||||
var id = element.val(), match;
|
||||
if (id) {
|
||||
match = _.find(self.icons, function (item) {
|
||||
return item.id === id;
|
||||
}) || void 0;
|
||||
}
|
||||
|
||||
callback(match);
|
||||
},
|
||||
formatSelection: function (object) {
|
||||
return $('<span class="fa fa-fw">').text(object.text);
|
||||
},
|
||||
formatResultCssClass: function () { return 'fa'; },
|
||||
});
|
||||
return started.then(this.proxy('load_data'));
|
||||
return this._super().then(this.proxy('load_data'));
|
||||
},
|
||||
/**
|
||||
* Removes existing FontAwesome classes on the bound element, and sets
|
||||
|
@ -1520,7 +1529,7 @@
|
|||
for (var i = 0; i < classes.length; i++) {
|
||||
var cls = classes[i];
|
||||
switch(cls) {
|
||||
case 'fa-lg':case 'fa-2x':case 'fa-3x':case 'fa-4x':case 'fa-5x':
|
||||
case 'fa-2x':case 'fa-3x':case 'fa-4x':case 'fa-5x':
|
||||
// size classes
|
||||
this.$('#fa-size').val(cls);
|
||||
continue;
|
||||
|
@ -1529,15 +1538,14 @@
|
|||
case 'fa-flip-horizontal':case 'fa-rotate-vertical':
|
||||
this.$('#fa-rotation').val(cls);
|
||||
continue;
|
||||
case 'fa-fixed':
|
||||
this.$('#fa-fixed').prop('checked', true);
|
||||
case 'fa-fw':
|
||||
continue;
|
||||
case 'fa-border':
|
||||
this.$('#fa-border').prop('checked', true);
|
||||
continue;
|
||||
default:
|
||||
if (!/^fa-/.test(cls)) { continue; }
|
||||
this.$('#fa-icon').select2('val', cls);
|
||||
this.$('#fa-icon').val(cls);
|
||||
}
|
||||
}
|
||||
this.update_preview();
|
||||
|
@ -1549,15 +1557,31 @@
|
|||
get_fa_classes: function () {
|
||||
return [
|
||||
'fa',
|
||||
this.$('#fa-icon').select2('val'),
|
||||
this.$('#fa-icon').val(),
|
||||
this.$('#fa-size').val(),
|
||||
this.$('#fa-rotation').val(),
|
||||
this.$('#fa-fixed').prop('checked') ? 'fa-fixed' : '',
|
||||
this.$('#fa-border').prop('checked') ? 'fa-border' : ''
|
||||
];
|
||||
},
|
||||
update_preview: function () {
|
||||
this.$('#fa-preview')[0].className = this.get_fa_classes().join(' ');
|
||||
var $preview = this.$('#fa-preview').empty();
|
||||
var sizes = ['', 'fa-2x', 'fa-3x', 'fa-4x', 'fa-5x'];
|
||||
var classes = this.get_fa_classes();
|
||||
var no_sizes = _.difference(classes, sizes).join(' ');
|
||||
var selected = false;
|
||||
for (var i = sizes.length - 1; i >= 0; i--) {
|
||||
var size = sizes[i];
|
||||
|
||||
var $p = $('<span>')
|
||||
.attr('data-size', size)
|
||||
.addClass(size)
|
||||
.addClass(no_sizes);
|
||||
if ((size && _.contains(classes, size)) || (!size && !selected)) {
|
||||
$p.addClass('font-icons-selected');
|
||||
selected = true;
|
||||
}
|
||||
$preview.prepend($p);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -327,6 +327,7 @@
|
|||
var testId = 'test_'+tour.id+'_tour';
|
||||
this.tours.push(tour);
|
||||
var defaultDelay = 500; //ms
|
||||
var overlapsCrash;
|
||||
var test = {
|
||||
id: tour.id,
|
||||
run: function (force) {
|
||||
|
@ -336,45 +337,60 @@
|
|||
var actionSteps = _.filter(tour.steps, function (step) {
|
||||
return step.trigger || step.sampleText;
|
||||
});
|
||||
window.onbeforeunload = function () {
|
||||
clearTimeout(overlapsCrash);
|
||||
};
|
||||
function executeStep (step) {
|
||||
var lastStep = window.localStorage.getItem(testId);
|
||||
var tryStep = lastStep != step.stepId ? 0 : parseInt(window.localStorage.getItem("last-"+testId) || 0, 10)+1;
|
||||
window.localStorage.setItem("last-"+testId, tryStep);
|
||||
if (tryStep > 2) {
|
||||
window.localStorage.removeItem(testId);
|
||||
throw "Test: '" + testId + "' cycling stape: '" + step.stepId + "'";
|
||||
}
|
||||
|
||||
var _next = false;
|
||||
window.localStorage.setItem(testId, step.stepId);
|
||||
function next () {
|
||||
clearTimeout(overlapsCrash);
|
||||
_next = true;
|
||||
var nextStep = actionSteps.shift();
|
||||
if (nextStep) {
|
||||
setTimeout(function () {
|
||||
executeStep(nextStep);
|
||||
},0);
|
||||
}, step.delay || defaultDelay);
|
||||
} else {
|
||||
window.localStorage.removeItem(testId);
|
||||
}
|
||||
}
|
||||
setTimeout(function () {
|
||||
var $element = $(step.element);
|
||||
if (step.triggers) step.triggers(next);
|
||||
if ((step.trigger === 'reload' || step.trigger.url) && _next) return;
|
||||
|
||||
if (step.snippet && step.trigger === 'drag') {
|
||||
website.TestConsole.dragAndDropSnippet(step.snippet);
|
||||
} else if (step.trigger && step.trigger.id === 'change') {
|
||||
$element.trigger($.Event("change", { srcElement: $element }));
|
||||
} else if (step.sampleText) {
|
||||
$element.val(step.sampleText);
|
||||
$element.trigger($.Event("change", { srcElement: $element }));
|
||||
} else if ($element.is(":visible")) { // Click by default
|
||||
if (step.trigger.id === 'mousedown') {
|
||||
$element.trigger($.Event("mousedown", { srcElement: $element }));
|
||||
}
|
||||
var evt = document.createEvent("MouseEvents");
|
||||
evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
||||
$element[0].dispatchEvent(evt);
|
||||
if (step.trigger.id === 'mouseup') {
|
||||
$element.trigger($.Event("mouseup", { srcElement: $element }));
|
||||
}
|
||||
}
|
||||
if (!step.triggers) next();
|
||||
overlapsCrash = setTimeout(function () {
|
||||
window.localStorage.removeItem(testId);
|
||||
throw "Test: '" + testId + "' can't resolve stape: '" + step.stepId + "'";
|
||||
}, step.delay || defaultDelay);
|
||||
|
||||
var $element = $(step.element);
|
||||
if (step.triggers) step.triggers(next);
|
||||
if ((step.trigger === 'reload' || step.trigger.url) && _next) return;
|
||||
|
||||
if (step.snippet && step.trigger === 'drag') {
|
||||
website.TestConsole.dragAndDropSnippet(step.snippet);
|
||||
} else if (step.trigger && step.trigger.id === 'change') {
|
||||
$element.trigger($.Event("change", { srcElement: $element }));
|
||||
} else if (step.sampleText) {
|
||||
$element.val(step.sampleText);
|
||||
$element.trigger($.Event("change", { srcElement: $element }));
|
||||
} else if ($element.is(":visible")) { // Click by default
|
||||
if (step.trigger.id === 'mousedown') {
|
||||
$element.trigger($.Event("mousedown", { srcElement: $element }));
|
||||
}
|
||||
var evt = document.createEvent("MouseEvents");
|
||||
evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
||||
$element[0].dispatchEvent(evt);
|
||||
if (step.trigger.id === 'mouseup') {
|
||||
$element.trigger($.Event("mouseup", { srcElement: $element }));
|
||||
}
|
||||
}
|
||||
if (!step.triggers) next();
|
||||
}
|
||||
var url = new website.UrlParser(window.location.href);
|
||||
if (tour.path && url.pathname !== tour.path && !window.localStorage.getItem(testId)) {
|
||||
|
|
|
@ -207,23 +207,18 @@
|
|||
<t t-call="website.editor.dialog">
|
||||
<t t-set="title">Icon:</t>
|
||||
<form>
|
||||
<div class="form-group">
|
||||
Preview: <span id="fa-preview"/>
|
||||
<div class="form-group" id="fa-preview">
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="fa-icon">icon</label>
|
||||
<div class="form-group font-icons fa fa-search">
|
||||
<input type="hidden" id="fa-icon" class="form-control"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="fa-size">size</label>
|
||||
<select id="fa-size" class="form-control">
|
||||
<option value="">Default</option>
|
||||
<option value="fa-lg">Large</option>
|
||||
<option value="fa-2x">x2</option>
|
||||
<option value="fa-3x">x3</option>
|
||||
<option value="fa-4x">x4</option>
|
||||
<option value="fa-5x">x5</option>
|
||||
</select>
|
||||
<input type="hidden" id="fa-size" class="form-control"/>
|
||||
<input type="search" class="form-control" id="icon-search"/>
|
||||
<div class="font-icons-icons">
|
||||
<t t-call="website.editor.dialog.font-icons.icons">
|
||||
<t t-set="icons" t-value="widget.icons"/>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="fa-rotation">Rotation</label>
|
||||
|
@ -239,16 +234,18 @@
|
|||
</div>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
<input type="checkbox" id="fa-fixed"/> fixed width
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
<input type="checkbox" id="fa-border"/> bordered
|
||||
<input type="checkbox" id="fa-border"/> border
|
||||
</label>
|
||||
</div>
|
||||
</form>
|
||||
</t>
|
||||
</t>
|
||||
<t t-name="website.editor.dialog.font-icons.icons">
|
||||
<span t-foreach="icons" t-as="icon"
|
||||
class="fa font-icons-icon"
|
||||
t-att-data-id="icon.id">
|
||||
<t t-esc="icon.text"/>
|
||||
</span>
|
||||
</t>
|
||||
|
||||
</templates>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp.addons.website_blog.tests import test_controllers
|
||||
import test_controllers
|
||||
|
||||
import test_ui
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import openerp.addons.website.tests.test_ui as test_ui,full_path
|
||||
import openerp.addons.website.tests.test_ui as test_ui
|
||||
|
||||
def load_tests(loader, base, _):
|
||||
base.addTest(test_ui.WebsiteUiSuite(full_path(__file__,'post_test.js'), { 'action': 'website.action_website_homepage' }, 60.0))
|
||||
base.addTest(test_ui.WebsiteUiSuite(test_ui.full_path(__file__,'post_test.js'), { 'action': 'website.action_website_homepage' }, 60.0))
|
||||
return base
|
|
@ -19,7 +19,7 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp.addons.website_blog.tests import test_controllers
|
||||
import test_controllers
|
||||
|
||||
import test_ui
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import openerp.addons.website.tests.test_ui as test_ui,full_path
|
||||
import openerp.addons.website.tests.test_ui as test_ui
|
||||
|
||||
def load_tests(loader, base, _):
|
||||
base.addTest(test_ui.WebsiteUiSuite(full_path(__file__,'event_test.js'), { 'action': 'website.action_website_homepage' }, 60.0))
|
||||
base.addTest(test_ui.WebsiteUiSuite(test_ui.full_path(__file__,'event_test.js'), { 'action': 'website.action_website_homepage' }, 60.0))
|
||||
return base
|
|
@ -19,7 +19,7 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp.addons.website_mail.tests import test_controllers
|
||||
import test_controllers
|
||||
|
||||
checks = [
|
||||
test_controllers,
|
||||
|
|
|
@ -246,7 +246,7 @@ class Ecommerce(http.Controller):
|
|||
'range': range,
|
||||
'search': {
|
||||
'search': search,
|
||||
'category': category,
|
||||
'category': category and category.id,
|
||||
'filters': filters,
|
||||
},
|
||||
'pager': pager,
|
||||
|
|
|
@ -269,6 +269,10 @@
|
|||
url: '/shop/payment/',
|
||||
},
|
||||
beforeTrigger: function (tour, callback) {
|
||||
if ($("input[name='name']").val() === "")
|
||||
$("input[name='name']").val("website_sale-test-shoptest");
|
||||
if ($("input[name='email']").val() === "")
|
||||
$("input[name='email']").val("website_sale-test-shoptest@website_sale-test-shoptest.optenerp.com");
|
||||
$("input[name='phone']").val("123");
|
||||
$("input[name='street']").val("123");
|
||||
$("input[name='city']").val("123");
|
||||
|
@ -276,11 +280,6 @@
|
|||
$("select[name='country_id']").val("21");
|
||||
},
|
||||
},
|
||||
// {
|
||||
// stepId: 'delivery-checkout-product',
|
||||
// element: 'input[name="delivery_type"]:eq(1)',
|
||||
// trigger: 'reload',
|
||||
// },
|
||||
{
|
||||
stepId: 'acquirer-checkout-product',
|
||||
element: 'input[name="acquirer"]',
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import openerp.addons.website.tests.test_ui as test_ui,full_path
|
||||
import openerp.addons.website.tests.test_ui as test_ui
|
||||
|
||||
def load_tests(loader, base, _):
|
||||
base.addTest(test_ui.WebsiteUiSuite(full_path(__file__,'website_sale-sale_process-test.js'),
|
||||
base.addTest(test_ui.WebsiteUiSuite(test_ui.full_path(__file__,'website_sale-sale_process-test.js'),
|
||||
{ 'action': 'website.action_website_homepage' }, 60.0))
|
||||
return base
|
|
@ -26,7 +26,7 @@
|
|||
<!-- List of categories -->
|
||||
|
||||
<template id="categories_recursive" name="Category list">
|
||||
<li t-att-class="str(category.id) == search.get('category') and 'active' or ''">
|
||||
<li t-att-class="category.id == search.get('category') and 'active' or ''">
|
||||
<a t-href="/shop/category/#{ slug(category) }/" t-field="category.name"></a>
|
||||
<ul t-if="category.child_id" class="nav nav-pills nav-stacked nav-hierarchy">
|
||||
<t t-foreach="category.child_id" t-as="category">
|
||||
|
|
Loading…
Reference in New Issue