bzr revid: nicolas.vanhoren@openerp.com-20120229110935-y2omxvx7vhchsti5
This commit is contained in:
niv-openerp 2012-02-29 12:09:35 +01:00
commit 436ed74729
24 changed files with 2361 additions and 740 deletions

1456
addons/web/i18n/uk.po Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,7 @@
/*
Fork of some unlicensed library found somewhere, don't hesitate to
patch it directly.
*/
(function($) {
var menu,shadow,trigger,content,hash,currentTarget;
var defaults= {
@ -30,7 +34,7 @@
};
$.fn.contextMenu= function(id,options) {
if(!menu) {
menu=$('<div id="jqContextMenu"></div>').hide().css({
menu=$('<div id="jqContextMenu" class="openerp"></div>').hide().css({
position:'absolute',
zIndex:'2000'
}).appendTo('body').bind('click', function(e) {

View File

@ -1,4 +1,5 @@
repo: 076b192d0d8ab2b92d1dbcfa3da055382f30eaea
node: a2f78eecb94af8e38839e47b3a5b2ca21f1ed6c3
node: 0274b3792917c9eba7b096dc2e8f74a508ddaee6
branch: default
tag: 0.4
latesttag: 0.4
latesttagdistance: 4

View File

@ -10,6 +10,106 @@ specification document is the `Python 2.7 Expressions spec
<http://docs.python.org/reference/expressions.html>`_ (along with the
lexical analysis part).
Builtins
--------
``py.js`` currently implements the following builtins:
``type``
Restricted to creating new types, can't be used to get an object's
type (yet)
``None``
``True``
``False``
``NotImplemented``
Returned from rich comparison methods when the comparison is not
implemented for this combination of operands. In ``py.js``, this
is also the default implementation for all rich comparison methods.
``issubclass``
``object``
``bool``
Does not inherit from ``int``, since ``int`` is not currently
implemented.
``float``
``str``
``tuple``
Constructor/coercer is not implemented, only handles literals
``list``
Same as tuple (``list`` is currently an alias for ``tuple``)
``dict``
Implements just about nothing
Note that most methods are probably missing from all of these.
Data model protocols
--------------------
``py.js`` currently implements the following protocols (or
sub-protocols) of the `Python 2.7 data model
<http://docs.python.org/reference/datamodel.html>`_:
Rich comparisons
Roughly complete implementation but for two limits: ``__eq__`` and
``__ne__`` can't return ``NotImplemented`` (well they can but it's
not going to work right), and the behavior is undefined if a
rich-comparison operation does not return a ``py.bool``.
Also, a ``NotImplemented`` result does not try the reverse
operation, not sure if it's supposed to. It directly falls back to
comparing type names.
Boolean conversion
Implementing ``__nonzero__`` should work.
Customizing attribute access
Protocols for getting and setting attributes (including new-style
extension) fully implemented but for ``__delattr__`` (since
``del`` is a statement)
Descriptor protocol
As with attributes, ``__delete__`` is not implemented.
Callable objects
Collections Abstract Base Classes
Container is the only implemented ABC protocol (ABCs themselves
are not currently implemented) (well technically Callable and
Hashable are kind-of implemented as well)
Numeric type emulation
Basically not implemented, the only part of it which is
implemented is the unary ``-`` (because it's used to create
negative floats, they're parsed as a negated positive number)
Utilities
---------
``py.js`` also provides (and exposes) a few utilities for "userland"
implementation:
``def``
Wraps a native javascript function into a ``py.js`` function, so
that it can be called from native expressions.
Does not ensure the return types are type-compatible with
``py.js`` types.
When accessing instance methods, ``py.js`` automatically wraps
these in a variant of ``py.def`` automatically, to behave as
Python's (bound) methods.
Why
===

View File

@ -384,6 +384,7 @@ var py = {};
base = py.object;
}
proto = constructor.prototype = create(base.prototype);
proto.constructor = constructor;
if (dict) {
for(var k in dict) {
if (!dict.hasOwnProperty(k)) { continue; }
@ -420,6 +421,10 @@ var py = {};
return py.True;
}
},
__lt__: function () { return py.NotImplemented; },
__le__: function () { return py.NotImplemented; },
__ge__: function () { return py.NotImplemented; },
__gt__: function () { return py.NotImplemented; },
__str__: function () {
return this.__unicode__();
},
@ -462,11 +467,13 @@ var py = {};
throw new Error(this.constructor.name + ' can not be converted to JSON');
}
});
NoneType = py.type(function () {}, py.object, {
NoneType = py.type(function NoneType() {}, py.object, {
__nonzero__: function () { return py.False; },
toJSON: function () { return null; }
});
py.None = new NoneType();
NotImplementedType = py.type(function NotImplementedType(){});
py.NotImplemented = new NotImplementedType();
var booleans_initialized = false;
py.bool = py.type(function bool(value) {
// The only actual instance of py.bool should be py.True
@ -492,15 +499,19 @@ var py = {};
return this._value === other._value ? py.True : py.False;
},
__lt__: function (other) {
if (!(other instanceof py.float)) { return py.NotImplemented; }
return this._value < other._value ? py.True : py.False;
},
__le__: function (other) {
if (!(other instanceof py.float)) { return py.NotImplemented; }
return this._value <= other._value ? py.True : py.False;
},
__gt__: function (other) {
if (!(other instanceof py.float)) { return py.NotImplemented; }
return this._value > other._value ? py.True : py.False;
},
__ge__: function (other) {
if (!(other instanceof py.float)) { return py.NotImplemented; }
return this._value >= other._value ? py.True : py.False;
},
__neg__: function () {
@ -523,15 +534,19 @@ var py = {};
return py.False;
},
__lt__: function (other) {
if (!(other instanceof py.str)) { return py.NotImplemented; }
return this._value < other._value ? py.True : py.False;
},
__le__: function (other) {
if (!(other instanceof py.str)) { return py.NotImplemented; }
return this._value <= other._value ? py.True : py.False;
},
__gt__: function (other) {
if (!(other instanceof py.str)) { return py.NotImplemented; }
return this._value > other._value ? py.True : py.False;
},
__ge__: function (other) {
if (!(other instanceof py.str)) { return py.NotImplemented; }
return this._value >= other._value ? py.True : py.False;
},
__nonzero__: function () {
@ -608,6 +623,7 @@ var py = {};
None: py.None,
True: py.True,
False: py.False,
NotImplemented: py.NotImplemented,
object: py.object,
bool: py.bool,
@ -630,10 +646,22 @@ var py = {};
case 'is': return a === b ? py.True : py.False;
case '!=': return a.__ne__(b)
case 'is not': return a !== b ? py.True : py.False;
case '<': return a.__lt__(b);
case '<=': return a.__le__(b);
case '>': return a.__gt__(b);
case '>=': return a.__ge__(b);
case '<':
var v = a.__lt__(b);
if (v !== py.NotImplemented) { return v; }
return PY_ensurepy(a.constructor.name < b.constructor.name);
case '<=':
var v = a.__le__(b);
if (v !== py.NotImplemented) { return v; }
return PY_ensurepy(a.constructor.name <= b.constructor.name);
case '>':
var v = a.__gt__(b);
if (v !== py.NotImplemented) { return v; }
return PY_ensurepy(a.constructor.name > b.constructor.name);
case '>=':
var v = a.__ge__(b);
if (v !== py.NotImplemented) { return v; }
return PY_ensurepy(a.constructor.name >= b.constructor.name);
case 'in':
return b.__contains__(a);
case 'not in':

View File

@ -137,6 +137,36 @@ describe('Comparisons', function () {
});
});
describe('missing eq/neq', function () {
it('should fall back on identity', function () {
var typ = new py.type(function MyType() {});
expect(py.eval('MyType() == MyType()', {MyType: typ})).to.be(false);
});
});
describe('un-comparable types', function () {
it('should default to type-name ordering', function () {
var t1 = new py.type(function Type1() {});
var t2 = new py.type(function Type2() {});
expect(py.eval('T1() < T2()', {T1: t1, T2: t2})).to.be(true);
expect(py.eval('T1() > T2()', {T1: t1, T2: t2})).to.be(false);
});
it('should handle native stuff', function () {
expect(py.eval('None < 42')).to.be(true);
expect(py.eval('42 > None')).to.be(true);
expect(py.eval('None > 42')).to.be(false);
expect(py.eval('None < False')).to.be(true);
expect(py.eval('None < True')).to.be(true);
expect(py.eval('False > None')).to.be(true);
expect(py.eval('True > None')).to.be(true);
expect(py.eval('None > False')).to.be(false);
expect(py.eval('None > True')).to.be(false);
expect(py.eval('False < ""')).to.be(true);
expect(py.eval('"" > False')).to.be(true);
expect(py.eval('False > ""')).to.be(false);
});
});
});
describe('Boolean operators', function () {
it('should work', function () {

View File

@ -17,6 +17,13 @@
left: 0;
right: 0;
}
.openerp2 .oe_webclient .oe_application {
position: absolute;
top: 32px;
bottom: 0;
left: 206px;
right: 0;
}
.openerp2 .oe_topbar {
width: 100%;
height: 31px;
@ -62,6 +69,50 @@
-webkit-border-radius: 4px;
border-radius: 4px;
}
.openerp2 .oe_topbar .oe_topbar_avatar {
vertical-align: top;
}
.openerp2 .oe_leftbar {
width: 205px;
height: 100%;
background: #f0eeee;
border-right: 1px solid #afafb6;
overflow: auto;
text-shadow: 0 1px 1px white;
}
.openerp2 .oe_leftbar .oe_footer {
position: absolute;
width: 205px;
text-align: center;
bottom: 8px;
}
.openerp2 a.oe_logo {
display: block;
text-align: center;
height: 70px;
line-height: 70px;
}
.openerp2 a.oe_logo img {
height: 40px;
width: 157px;
margin: 14px 0;
}
.openerp2 .oe_footer {
position: absolute;
width: 205px;
text-align: center;
bottom: 8px;
}
.openerp2 .oe_footer a {
font-weight: 800;
font-family: serif;
font-size: 16px;
color: black;
}
.openerp2 .oe_footer a span {
color: #c81010;
font-style: italic;
}
.openerp2 .oe_menu {
float: left;
padding: 0;
@ -95,6 +146,91 @@
-webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset;
-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset;
}
.openerp2 .oe_secondary_menu_section {
font-weight: bold;
margin-left: 8px;
color: #8a89ba;
}
.openerp2 .oe_secondary_submenu {
padding: 2px 0 8px 0;
margin: 0;
width: 100%;
display: inline-block;
}
.openerp2 .oe_secondary_submenu li {
position: relative;
padding: 1px 0 1px 16px;
list-style-type: none;
}
.openerp2 .oe_secondary_submenu li a {
display: block;
color: #4c4c4c;
padding: 2px 4px 2px 0;
}
.openerp2 .oe_secondary_submenu li .oe_menu_label {
position: absolute;
top: 1px;
right: 1px;
font-size: 10px;
background: #8a89ba;
color: white;
padding: 2px 4px;
margin: 1px 6px 0 0;
border: 1px solid lightGray;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2);
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2);
-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2);
}
.openerp2 .oe_secondary_submenu .oe_active {
background: #8a89ba;
border-top: 1px solid lightGray;
border-bottom: 1px solid lightGray;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2);
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2);
-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2);
}
.openerp2 .oe_secondary_submenu .oe_active a {
color: white;
}
.openerp2 .oe_secondary_submenu .oe_active .oe_menu_label {
background: #eeeeee;
color: #8a89ba;
text-shadow: 0 1px 1px white;
-moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}
.openerp2 .oe_secondary_submenu .oe_menu_toggler:before {
width: 0;
height: 0;
display: inline-block;
content: "&darr";
text-indent: -99999px;
vertical-align: top;
margin-left: -8px;
margin-top: 4px;
margin-right: 4px;
border-top: 4px solid transparent;
border-bottom: 4px solid transparent;
border-left: 4px solid #4c4c4c;
filter: alpha(opacity=50);
-khtml-opacity: 0.5;
-moz-opacity: 0.5;
opacity: 0.5;
}
.openerp2 .oe_secondary_submenu .oe_menu_opened:before {
margin-top: 6px;
margin-left: -12px;
margin-right: 4px;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 4px solid #4c4c4c;
}
.openerp2 .oe_dropdown_menu {
float: right;
padding: 0;
@ -107,7 +243,7 @@
.openerp2 .oe_dropdown_menu .oe_dropdown {
position: relative;
}
.openerp2 .oe_dropdown_menu .dropdown-toggle:after {
.openerp2 .oe_dropdown_menu .oe_dropdown_toggle:after {
width: 0;
height: 0;
display: inline-block;
@ -134,7 +270,6 @@
right: -1px;
border: 0;
z-index: 900;
width: 160px;
margin-left: 0;
margin-right: 0;
padding: 6px 0;
@ -175,10 +310,3 @@
-webkit-box-shadow: none;
-box-shadow: none;
}
.openerp .oe-shortcuts {
position: static;
}
.openerp #oe_header {
clear: both;
}

View File

@ -1,3 +1,8 @@
// Variables {{{
$colour4: #8a89ba
//$colour4: #d14836
// }}}
// Mixins {{{
@mixin vertical-gradient($startColor: #555, $endColor: #333)
background: $startColor
@ -61,6 +66,13 @@
bottom: 0
left: 0
right: 0
.oe_application
position: absolute
top: 32px
bottom: 0
left: 206px
right: 0
// }}}
// Topbar {{{
@ -97,6 +109,46 @@
height: 24px
margin: -2px 2px 0 0
@include radius(4px)
.oe_topbar_avatar
vertical-align: top
// }}}
// Leftbar {{{
.oe_leftbar
width: 205px
height: 100%
background: #f0eeee
border-right: 1px solid #afafb6
overflow: auto
text-shadow: 0 1px 1px white
.oe_footer
position: absolute
width: 205px
text-align: center
bottom: 8px
a.oe_logo
display: block
text-align: center
height: 70px
line-height: 70px
img
height: 40px
width: 157px
margin: 14px 0
.oe_footer
position: absolute
width: 205px
text-align: center
bottom: 8px
a
font-weight: 800
font-family: serif
font-size: 16px
color: black
span
color: #c81010
font-style: italic
// }}}
// Menu {{{
@ -124,6 +176,70 @@
font-weight: bold
color: white
@include box-shadow(0 1px 2px rgba(255,255,255,0.3) inset)
.oe_secondary_menu_section
font-weight: bold
margin-left: 8px
color: $colour4
.oe_secondary_submenu
padding: 2px 0 8px 0
margin: 0
width: 100%
display: inline-block
li
position: relative
padding: 1px 0 1px 16px
list-style-type: none
a
display: block
color: #4c4c4c
padding: 2px 4px 2px 0
.oe_menu_label
position: absolute
top: 1px
right: 1px
font-size: 10px
background: $colour4
color: white
padding: 2px 4px
margin: 1px 6px 0 0
border: 1px solid lightGray
text-shadow: 0 1px 1px rgba(0,0,0,0.2)
@include radius(4px)
@include box-shadow(inset 0 1px 1px rgba(0, 0, 0, 0.2))
.oe_active
background: $colour4
border-top: 1px solid lightGray
border-bottom: 1px solid lightGray
text-shadow: 0 1px 1px rgba(0,0,0,0.2)
@include box-shadow(inset 0 1px 1px rgba(0, 0, 0, 0.2))
a
color: white
.oe_menu_label
background: #eee
color: $colour4
text-shadow: 0 1px 1px white
@include box-shadow(0 1px 1px rgba(0, 0, 0, 0.2))
.oe_menu_toggler:before
width: 0
height: 0
display: inline-block
content: "&darr"
text-indent: -99999px
vertical-align: top
margin-left: -8px
margin-top: 4px
margin-right: 4px
border-top: 4px solid transparent
border-bottom: 4px solid transparent
border-left: 4px solid #4c4c4c
@include opacity(0.5)
.oe_menu_opened:before
margin-top: 6px
margin-left: -12px
margin-right: 4px
border-left: 4px solid transparent
border-right: 4px solid transparent
border-top: 4px solid #4c4c4c
// }}}
// DropDown Menu {{{
@ -137,7 +253,7 @@
.oe_dropdown
position: relative
.dropdown-toggle:after
.oe_dropdown_toggle:after
width: 0
height: 0
display: inline-block
@ -161,7 +277,6 @@
right: -1px
border: 0
z-index: 900
width: 160px
margin-left: 0
margin-right: 0
padding: 6px 0
@ -191,10 +306,6 @@
.openerp
// Transitional overrides for old styles {{{
.oe-shortcuts
position: static
#oe_header
clear: both
// }}}
// au BufWritePost,FileWritePost *.sass :!sass --style expanded --line-numbers <afile> > "%:p:r.css"

View File

@ -27,9 +27,6 @@
margin: 2px;
}
#oe_header h2 {
margin: 2px 0;
}
#oe_errors pre {
margin: 0;
@ -388,312 +385,6 @@ label.error {
min-height: 100%\9;
}
/* Menu */
.openerp .menu {
height: 34px;
background: #cc4e45; /* Old browsers */
background: -moz-linear-gradient(top, #cc4e45 0%, #b52d20 8%, #7a211a 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#cc4e45), color-stop(8%,#b52d20), color-stop(100%,#7a211a)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #cc4e45 0%,#b52d20 8%,#7a211a 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #cc4e45 0%,#b52d20 8%,#7a211a 100%); /* Opera11.10+ */
background: -ms-linear-gradient(top, #cc4e45 0%,#b52d20 8%,#7a211a 100%); /* IE10+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#CC4E45', endColorstr='#7A211A',GradientType=0 ); /* IE6-9 */
background: linear-gradient(top, #cc4e45 0%,#b52d20 8%,#7a211a 100%); /* W3C */
}
.openerp .menu td {
text-align: center;
padding:0;
}
.openerp .menu a {
display:block;
min-width: 60px;
height: 20px;
margin: 3px 2px;
padding: 0 8px;
background: #bd5e54; /* Old browsers */
background: -moz-linear-gradient(top, #bd5e54 0%, #90322a 60%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#bd5e54), color-stop(60%,#90322a)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #bd5e54 0%,#90322a 60%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #bd5e54 0%,#90322a 60%); /* Opera11.10+ */
background: -ms-linear-gradient(top, #bd5e54 0%,#90322a 60%); /* IE10+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#BD5E54', endColorstr='#90322A',GradientType=0 ); /* IE6-9 */
background: linear-gradient(top, #bd5e54 0%,#90322a 60%); /* W3C */
border: 1px solid #5E1A14;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
color: #eee;
text-shadow: #222 0 1px 0;
text-decoration: none;
text-transform: uppercase;
line-height: 20px;
font-weight: bold;
font-size: 75%;
white-space: nowrap;
}
.openerp .menu a:hover,
.openerp .menu a:focus,
.openerp .menu a.active {
background: #c6c6c6; /* Old browsers */
background: -moz-linear-gradient(top, #c6c6c6 0%, #5c5c5c 7%, #969595 86%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#c6c6c6), color-stop(7%,#5c5c5c), color-stop(86%,#969595)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #c6c6c6 0%,#5c5c5c 7%,#969595 86%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #c6c6c6 0%,#5c5c5c 7%,#969595 86%); /* Opera11.10+ */
background: -ms-linear-gradient(top, #c6c6c6 0%,#5c5c5c 7%,#969595 86%); /* IE10+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#C6C6C6', endColorstr='#969595',GradientType=0 ); /* IE6-9 */
background: linear-gradient(top, #c6c6c6 0%,#5c5c5c 7%,#969595 86%); /* W3C */
/* for ie */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#5c5c5c', endColorstr='#969595',GradientType=0 ); /* IE6-9 */
color: #fff;
}
/* Secondary Menu */
.openerp .secondary_menu .oe_toggle_secondary_menu {
position: absolute;
cursor: pointer;
border-left: 1px solid #282828;
border-bottom: 1px solid #282828;
width: 21px;
height: 21px;
z-index: 10;
background: transparent;
color: white;
text-shadow: 0 1px 0 #333;
text-align: center;
font-size: 18px;
line-height: 18px;
right: 0;
}
.openerp .secondary_menu.oe_folded .oe_toggle_secondary_menu {
position: static;
border-left: none;
border-bottom: 1px solid #282828;
width: 21px;
height: 21px;
background: #818181;
}
.openerp .secondary_menu.oe_folded .oe_toggle_secondary_menu span.oe_menu_fold {
display: none;
}
.openerp .secondary_menu.oe_unfolded .oe_toggle_secondary_menu span.oe_menu_unfold {
display: none;
}
.openerp .secondary_menu {
width: 200px;
min-width: 200px;
border-right: 1px solid #3C3C3C;
border-bottom: 1px solid #5A5858;
background: #5A5858;
vertical-align: top;
height: 100%;
display: block;
position: relative;
font-size:85%;
}
.openerp .secondary_menu.oe_folded {
width: 20px;
min-width: 20px;
position: static;
}
.openerp .secondary_menu.oe_folded .oe_secondary_menu.active {
position: absolute;
z-index: 100;
border: 4px solid #585858;
border-color: rgba(88, 88, 88, .5);
border-radius: 4px;
min-width: 200px;
}
.openerp .secondary_menu a {
display: block;
padding: 0 5px 2px 5px;
line-height: 20px;
text-decoration: none;
white-space: nowrap;
color: white;
text-shadow: 0 1px 0 #333;
}
.openerp .oe_secondary_submenu {
background: #5A5858;
}
.openerp .secondary_menu a.oe_secondary_menu_item {
background: #949292; /* Old browsers */
background: -moz-linear-gradient(top, #949292 0%, #6d6b6b 87%, #282828 99%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#949292), color-stop(87%,#6d6b6b), color-stop(99%,#282828)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #949292 0%,#6d6b6b 87%,#282828 99%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #949292 0%,#6d6b6b 87%,#282828 99%); /* Opera11.10+ */
background: -ms-linear-gradient(top, #949292 0%,#6d6b6b 87%,#282828 99%); /* IE10+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#949292', endColorstr='#282828',GradientType=0 ); /* IE6-9 */
background: linear-gradient(top, #949292 0%,#6d6b6b 87%,#282828 99%); /* W3C */
/* for ie9 */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#949292', endColorstr='#5B5A5A',GradientType=0 ); /* IE6-9 */
white-space: nowrap;
color: white;
text-shadow: 0 1px 0 #333;
}
.openerp a.oe_secondary_submenu_item {
padding: 0 5px 2px 10px;
}
.openerp a.oe_secondary_submenu_item,
.openerp a.oe_secondary_menu_item {
overflow: hidden;
text-overflow: ellipsis;
}
.openerp a.oe_secondary_submenu_item:hover,
.openerp a.oe_secondary_submenu_item.leaf.active {
display: block;
background: #ffffff; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #d8d8d8 11%, #afafaf 86%, #333333 91%, #5a5858 96%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(11%,#d8d8d8), color-stop(86%,#afafaf), color-stop(91%,#333333), color-stop(96%,#5a5858)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 0%,#d8d8d8 11%,#afafaf 86%,#333333 91%,#5a5858 96%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%,#d8d8d8 11%,#afafaf 86%,#333333 91%,#5a5858 96%); /* Opera11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%,#d8d8d8 11%,#afafaf 86%,#333333 91%,#5a5858 96%); /* IE10+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FFFFFF', endColorstr='#5A5858',GradientType=0 ); /* IE6-9 */
background: linear-gradient(top, #ffffff 0%,#d8d8d8 11%,#afafaf 86%,#333333 91%,#5a5858 96%); /* W3C */
padding: 0 5px 2px 10px;
line-height: 20px;
color: #3f3d3d;
text-decoration: none;
text-shadow: #fff 0 1px 0;
}
.openerp a.oe_secondary_submenu_item.submenu.opened span:before {
content: "\25be";
}
.openerp a.oe_secondary_submenu_item.submenu span:before {
content: "\25b8";
}
/* Header */
.openerp .header {
height: 65px;
background: url("/web/static/src/img/header-background.png") repeat-x scroll left top transparent;
color: #FFFFFF;
letter-spacing: 0.5px;
text-shadow: 0 1px 0 #333333;
}
.openerp .company_logo_link {
display: block;
float: left;
height: 63px;
width: 200px;
border: 1px solid white;
border-right-color: black;
border-bottom-color: black;
background: #FFFFFF;
background: -moz-linear-gradient(top, #FFFFFF 0%, #CECECE 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFFFFF), color-stop(100%,#CECECE));
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FFFFFF', endColorstr='#CECECE',GradientType=0 );
}
.openerp .company_logo {
margin-top: 7px;
margin-left: 10px;
display: block;
background: url(/web/static/src/img/logo.png);
width:180px;
height:46px;
}
.openerp .header_title {
float: left;
font-size: 100%;
margin: 0;
padding: 4px 10px;
text-shadow: 0 1px 0 #111111;
font-weight:normal;
line-height:14px;
}
.openerp .header_title small {
color: #ccc;
font-size: 90%;
font-weight: normal;
}
.openerp .header_corner {
float: right;
}
.openerp .header_corner .block {
float: left;
height: 34px;
line-height: 34px;
/*background: url(../images/top-sep-a.png) no-repeat;*/
border-left: 1px solid #6a6a6a;
background: #828282;
background: -moz-linear-gradient(top, #828282 0%, #4D4D4D 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#828282), color-stop(100%,#4D4D4D));
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#828282', endColorstr='#4D4D4D',GradientType=0 );
}
.openerp .header_corner .block a {
display: block;
color: white;
text-decoration: none;
padding: 0 10px;
}
.openerp .header_corner .block a:hover {
background: #929292;
background: -moz-linear-gradient(top, #929292 0%, #4D4D4D 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#929292), color-stop(100%,#4D4D4D));
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#929292', endColorstr='#4D4D4D',GradientType=0 );
}
.openerp .header_corner ul.block {
list-style: none;
height: 34px;
margin: 0;
padding: 0 0 0 2px;
line-height: 33px;
}
.openerp .header_corner ul.block li {
float: left;
}
.openerp .header_corner ul.block li a {
padding: 0 5px;
position: relative;
line-height: 32px;
}
.openerp .header_corner ul.block li a img {
vertical-align: middle;
}
.openerp .header_corner ul.block li a small {
position: absolute;
right: 0;
top: 5px;
padding: 1px 4px 2px;
background: rgba(0, 0, 0, 0.75);
border-radius: 7px;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
line-height: 1em;
font-weight: bold;
}
.openerp .logout {
font-size:80%;
}
/* Footer */
.openerp div.oe_footer {
background: none repeat scroll 0 0 #CCCCCC;
overflow: hidden;
padding: 5px 0;
position: relative;
-moz-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.4);
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.4);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.4);
}
.openerp div.oe_footer p.oe_footer_powered {
left: 50%;
margin: 0;
padding: 0 15px;
color: #666666;
font-weight: bold;
font-size: 0.8em;
text-align: center;
}
.openerp div.oe_footer p.oe_footer_powered a {
text-decoration: none;
color: #666666;
}
/* Main Application */
.openerp .oe-main-content {
@ -1851,10 +1542,6 @@ label.error {
background: url(http://placekitten.com/g/211/65) repeat;
}
.openerp.kitten-mode-activated .secondary_menu {
background: url(http://placekitten.com/g/212/100) repeat;
}
.openerp.kitten-mode-activated .menu {
background: #828282;
background: -moz-linear-gradient(top, #828282 0%, #4D4D4D 100%);
@ -1876,7 +1563,6 @@ label.error {
.openerp.kitten-mode-activated .menu,
.openerp.kitten-mode-activated .header_corner,
.openerp.kitten-mode-activated .header_title,
.openerp.kitten-mode-activated .secondary_menu div,
.openerp.kitten-mode-activated .oe-application,
.openerp.kitten-mode-activated .oe_footer,
.openerp.kitten-mode-activated .loading,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 454 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 420 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 846 B

View File

@ -666,151 +666,149 @@ openerp.web.Login = openerp.web.OldWidget.extend(/** @lends openerp.web.Login#
}
});
openerp.web.Header = openerp.web.OldWidget.extend(/** @lends openerp.web.Header# */{
template: "Header",
openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{
/**
* @constructs openerp.web.Header
* @extends openerp.web.OldWidget
* @constructs openerp.web.Menu
* @extends openerp.web.Widget
*
* @param parent
*/
template: 'Menu',
do_reload: function() {
var self = this;
return this.rpc("/web/menu/load", {}, this.on_loaded).then(function () {
if (self.current_menu) {
self.open_menu(self.current_menu);
}
});
},
on_loaded: function(data) {
this.data = data;
this.renderElement();
if (!this.$secondary_menus && this.getParent()) {
// TODO: create Widget openerp.web.SubMenu
this.$secondary_menus = this.getParent().$element.find('.oe_secondary_menus_container');
this.$element.add(this.$secondary_menus).on('click', 'a[data-menu]', this.on_menu_click);
}
this.$secondary_menus.html(QWeb.render("Menu.secondary", { widget : this }));
// Hide second level submenus
this.$secondary_menus.find('.oe_menu_toggler').siblings('.oe_secondary_submenu').hide();
},
/**
* Opens a given menu by id, as if a user had browsed to that menu by hand
* except does not trigger any event on the way
*
* @param {Number} menu_id database id of the terminal menu to select
*/
open_menu: function (id) {
var $clicked_menu, $sub_menu, $main_menu;
$clicked_menu = this.$element.add(this.$secondary_menus).find('a[data-menu=' + id + ']');
if (this.$secondary_menus.has($clicked_menu).length) {
$sub_menu = $clicked_menu.parents('.oe_secondary_menu');
$main_menu = this.$element.find('a[data-menu=' + $sub_menu.data('menu-parent') + ']');
} else {
$sub_menu = this.$secondary_menus.find('.oe_secondary_menu[data-menu-parent=' + $clicked_menu.attr('data-menu') + ']');
$main_menu = $clicked_menu;
}
// Activate current main menu
this.$element.find('.oe_active').removeClass('oe_active');
$main_menu.addClass('oe_active');
// Show current sub menu
this.$secondary_menus.find('.oe_secondary_menu').hide();
$sub_menu.show();
// Activate current menu item and show parents
this.$secondary_menus.find('.oe_active').removeClass('oe_active');
if ($main_menu !== $clicked_menu) {
$clicked_menu.parents().show();
if ($clicked_menu.is('.oe_menu_toggler')) {
$clicked_menu.toggleClass('oe_menu_opened').siblings('.oe_secondary_submenu:first').toggle();
} else {
$clicked_menu.parent().addClass('oe_active');
}
}
},
on_menu_click: function(ev, id) {
id = id || 0;
var $clicked_menu, manual = false;
if (id) {
// We can manually activate a menu with it's id (for hash url mapping)
manual = true;
$clicked_menu = this.$element.find('a[data-menu=' + id + ']');
if (!$clicked_menu.length) {
$clicked_menu = this.$secondary_menus.find('a[data-menu=' + id + ']');
}
} else {
$clicked_menu = $(ev.currentTarget);
id = $clicked_menu.data('menu');
}
if (id) {
this.open_menu(id);
this.current_menu = id;
this.session.active_id = id;
this.rpc('/web/menu/action', {'menu_id': id}, this.on_menu_action_loaded);
}
if (ev) {
ev.stopPropagation();
}
return false;
},
do_show_secondary: function($sub_menu, $main_menu) {
var self = this;
this.$secondary_menus.show();
if (!arguments.length) {
return;
}
$sub_menu.show();
},
on_menu_action_loaded: function(data) {
var self = this;
if (data.action.length) {
var action = data.action[0][2];
action.from_menu = true;
self.on_action(action);
} else {
self.on_action({type: 'null_action'});
}
},
on_action: function(action) {
}
});
openerp.web.DropDownMenu = openerp.web.Widget.extend(/** @lends openerp.web.DropDownMenu# */{
template: "DropDownMenu",
/**
* @constructs openerp.web.DropDownMenu
* @extends openerp.web.Widget
*
* @param parent
*/
init: function(parent) {
this._super(parent);
this.qs = "?" + jQuery.param.querystring();
this.$content = $();
this.update_promise = $.Deferred().resolve();
},
start: function() {
this._super();
},
do_update: function () {
var self = this;
var fct = function() {
self.$content.remove();
if (!self.session.uid)
return;
var func = new openerp.web.Model("res.users").get_func("read");
return func(self.session.uid, ["name", "company_id"]).pipe(function(res) {
self.$content = $(QWeb.render("Header-content", {widget: self, user: res}));
self.$content.appendTo(self.$element);
self.$element.find(".logout").click(self.on_logout);
self.$element.find("a.preferences").click(self.on_preferences);
self.$element.find(".about").click(self.on_about);
return self.shortcut_load();
});
};
this.update_promise = this.update_promise.pipe(fct, fct);
},
on_about: function() {
var self = this;
self.rpc("/web/webclient/version_info", {}).then(function(res) {
var $help = $(QWeb.render("About-Page", {version_info: res}));
$help.find('a.oe_activate_debug_mode').click(function (e) {
e.preventDefault();
window.location = $.param.querystring(
window.location.href, 'debug');
});
openerp.web.dialog($help, {autoOpen: true,
modal: true, width: 960, title: _t("About")});
this._super.apply(this, arguments);
$('html').bind('click', function() {
self.$element.find('.oe_dropdown_options').hide();
});
this.$element.find('.oe_dropdown_toggle').click(function() {
self.$element.find('.oe_dropdown_options').toggle();
return false;
});
this.$element.on('click', '.oe_dropdown_options li a[data-menu]', function() {
var f = self['on_menu_' + $(this).data('menu')];
f && f($(this));
self.$element.find('.oe_dropdown_options').hide();
return false;
});
},
shortcut_load :function(){
var self = this,
sc = self.session.shortcuts,
shortcuts_ds = new openerp.web.DataSet(this, 'ir.ui.view_sc');
// TODO: better way to communicate between sections.
// sc.bindings, because jquery does not bind/trigger on arrays...
if (!sc.binding) {
sc.binding = {};
$(sc.binding).bind({
'add': function (e, attrs) {
shortcuts_ds.create(attrs, function (out) {
$('<li>', {
'data-shortcut-id':out.result,
'data-id': attrs.res_id
}).text(attrs.name)
.appendTo(self.$element.find('.oe-shortcuts ul'));
attrs.id = out.result;
sc.push(attrs);
});
},
'remove-current': function () {
var menu_id = self.session.active_id;
var $shortcut = self.$element
.find('.oe-shortcuts li[data-id=' + menu_id + ']');
var shortcut_id = $shortcut.data('shortcut-id');
$shortcut.remove();
shortcuts_ds.unlink([shortcut_id]);
var sc_new = _.reject(sc, function(shortcut){ return shortcut_id === shortcut.id});
sc.splice(0, sc.length);
sc.push.apply(sc, sc_new);
}
});
}
return this.rpc('/web/session/sc_list', {}, function(shortcuts) {
sc.splice(0, sc.length);
sc.push.apply(sc, shortcuts);
self.$element.find('.oe-shortcuts')
.html(QWeb.render('Shortcuts', {'shortcuts': shortcuts}))
.undelegate('li', 'click')
.delegate('li', 'click', function(e) {
e.stopPropagation();
var id = $(this).data('id');
self.session.active_id = id;
self.rpc('/web/menu/action', {'menu_id':id}, function(ir_menu_data) {
if (ir_menu_data.action.length){
self.on_action(ir_menu_data.action[0][2]);
}
});
});
});
},
on_action: function(action) {
},
on_preferences: function(){
var self = this;
var action_manager = new openerp.web.ActionManager(this);
var dataset = new openerp.web.DataSet (this,'res.users',this.context);
dataset.call ('action_get','',function (result){
self.rpc('/web/action/load', {action_id:result}, function(result){
action_manager.do_action(_.extend(result['result'], {
res_id: self.session.uid,
res_model: 'res.users',
flags: {
action_buttons: false,
search_view: false,
sidebar: false,
views_switcher: false,
pager: false
}
}));
});
});
this.dialog = new openerp.web.Dialog(this,{
title: _t("Preferences"),
width: '700px',
buttons: [
{text: _t("Cancel"), click: function(){ $(this).dialog('destroy'); }},
{text: _t("Change password"), click: function(){ self.change_password(); }},
{text: _t("Save"), click: function(){
var inner_viewmanager = action_manager.inner_viewmanager;
inner_viewmanager.views[inner_viewmanager.active_view].controller.do_save()
.then(function() {
self.dialog.destroy();
// needs to refresh interface in case language changed
window.location.reload();
});
}
}
]
}).open();
action_manager.appendTo(this.dialog);
action_manager.render(this.dialog);
},
change_password :function() {
var self = this;
this.dialog = new openerp.web.Dialog(this, {
@ -842,198 +840,68 @@ openerp.web.Header = openerp.web.OldWidget.extend(/** @lends openerp.web.Header
]
}).html(error.error);
},
on_logout: function() {
}
});
openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{
/**
* @constructs openerp.web.Menu
* @extends openerp.web.Widget
*
* @param parent
*/
template: 'Menu',
do_reload: function() {
do_update: function () {
var self = this;
return this.rpc("/web/menu/load", {}, this.on_loaded).then(function () {
if (self.current_menu) {
self.open_menu(self.current_menu);
}
var fct = function() {
var $avatar = self.$element.find('.oe_topbar_avatar');
$avatar.attr('src', $avatar.data('default-src'));
if (!self.session.uid)
return;
var func = new openerp.web.Model("res.users").get_func("read");
return func(self.session.uid, ["name", "company_id"]).pipe(function(res) {
// TODO: Only show company if multicompany in use
self.$element.find('.oe_topbar_name').text(res.name + '/' + res.company_id[1]);
return self.shortcut_load();
});
};
this.update_promise = this.update_promise.pipe(fct, fct);
},
on_action: function() {
},
shortcut_load :function(){
var self = this,
sc = self.session.shortcuts,
shortcuts_ds = new openerp.web.DataSet(this, 'ir.ui.view_sc');
self.$element.find('.oe_dropdown_options a[data-menu=shortcut]').each(function() {
$(this).parent().remove();
});
},
on_loaded: function(data) {
this.data = data;
this.renderElement();
if (!this.$secondary_menu && this.getParent()) {
// TODO: create Widget openerp.web.SubMenu
this.$secondary_menu = this.getParent().$element.find('.oe_secondary_menu');
}
this.$secondary_menu.html(QWeb.render("Menu.secondary", { widget : this }));
this.$element.add(this.$secondary_menu).find("a").click(this.on_menu_click);
},
/**
* Opens a given menu by id, as if a user had browsed to that menu by hand
* except does not trigger any event on the way
*
* @param {Number} menu_id database id of the terminal menu to select
*/
open_menu: function (menu_id) {
this.$element.add(this.$secondary_menu).find('.oe_active')
.removeClass('oe_active');
this.$secondary_menu.find('> .oe_secondary_menu').hide();
var $primary_menu;
var $secondary_submenu = this.$secondary_menu.find(
'a[data-menu=' + menu_id +']');
if ($secondary_submenu.length) {
for(;;) {
if ($secondary_submenu.hasClass('leaf')) {
$secondary_submenu.addClass('oe_active');
} else if ($secondary_submenu.hasClass('submenu')) {
$secondary_submenu.addClass('opened')
// TODO: better way to communicate between sections.
// sc.bindings, because jquery does not bind/trigger on arrays...
if (!sc.binding) {
sc.binding = {};
$(sc.binding).bind({
'add': function (e, attrs) {
shortcuts_ds.create(attrs, function (out) {
var shortcut = QWeb.render('DropDownMenu.shortcut', {
shortcuts : [{
name : attrs.name,
id : out.result,
res_id : attrs.res_id
}]
});
$(shortcut).appendTo(self.$element.find('.oe_dropdown_options'));
attrs.id = out.result;
sc.push(attrs);
});
},
'remove-current': function () {
var menu_id = self.session.active_id;
var $shortcut = self.$element.find('.oe_dropdown_options li a[data-id=' + menu_id + ']');
var shortcut_id = $shortcut.data('shortcut-id');
$shortcut.remove();
shortcuts_ds.unlink([shortcut_id]);
var sc_new = _.reject(sc, function(shortcut){ return shortcut_id === shortcut.id});
sc.splice(0, sc.length);
sc.push.apply(sc, sc_new);
}
var $parent = $secondary_submenu.parent().show();
if ($parent.hasClass('oe_secondary_menu')) {
var primary_id = $parent.data('menu-parent');
$primary_menu = this.$element.find(
'a[data-menu=' + primary_id + ']');
break;
}
$secondary_submenu = $parent.prev();
}
} else {
$primary_menu = this.$element.find('a[data-menu=' + menu_id + ']');
});
}
if (!$primary_menu.length) {
return;
}
$primary_menu.addClass('oe_active');
this.$secondary_menu.find(
'div[data-menu-parent=' + $primary_menu.data('menu') + ']').addClass('oe_active');
},
on_menu_click: function(ev, id) {
id = id || 0;
var $clicked_menu, manual = false;
return this.rpc('/web/session/sc_list', {}, function(shortcuts) {
sc.splice(0, sc.length);
sc.push.apply(sc, shortcuts);
if (id) {
// We can manually activate a menu with it's id (for hash url mapping)
manual = true;
$clicked_menu = this.$element.find('a[data-menu=' + id + ']');
if (!$clicked_menu.length) {
$clicked_menu = this.$secondary_menu.find('a[data-menu=' + id + ']');
}
} else {
$clicked_menu = $(ev.currentTarget);
id = $clicked_menu.data('menu');
}
if (this.do_menu_click($clicked_menu, manual) && id) {
this.current_menu = id;
this.session.active_id = id;
this.rpc('/web/menu/action', {'menu_id': id}, this.on_menu_action_loaded);
}
if (ev) {
ev.stopPropagation();
}
return false;
},
do_menu_click: function($clicked_menu, manual) {
var $sub_menu, $main_menu,
active = $clicked_menu.is('.oe_active'),
sub_menu_visible = false,
has_submenu_items = false;
if (this.$secondary_menu.has($clicked_menu).length) {
$sub_menu = $clicked_menu.parents('.oe_secondary_menu');
$main_menu = this.$element.find('a[data-menu=' + $sub_menu.data('menu-parent') + ']');
} else {
$sub_menu = this.$secondary_menu.find('.oe_secondary_menu[data-menu-parent=' + $clicked_menu.attr('data-menu') + ']');
$main_menu = $clicked_menu;
}
sub_menu_visible = $sub_menu.is(':visible');
has_submenu_items = !!$sub_menu.children().length;
this.$secondary_menu.find('.oe_secondary_menu').hide();
$('.oe_active', this.$element.add(this.$secondary_menu)).removeClass('oe_active');
$main_menu.add($clicked_menu).add($sub_menu).addClass('oe_active');
if (has_submenu_items) {
if (!manual) {
this.do_show_secondary($sub_menu, $main_menu);
} else {
this.do_show_secondary();
}
}
if ($main_menu != $clicked_menu) {
if ($clicked_menu.is('.submenu')) {
$sub_menu.find('.submenu.opened').each(function() {
if (!$(this).next().has($clicked_menu).length && !$(this).is($clicked_menu)) {
$(this).removeClass('opened').next().hide();
}
});
$clicked_menu.toggleClass('opened').next().toggle();
} else if ($clicked_menu.is('.leaf')) {
return true;
}
} else {
return true;
}
return false;
},
do_hide_secondary: function() {
//this.$secondary_menu.hide();
},
do_show_secondary: function($sub_menu, $main_menu) {
var self = this;
this.$secondary_menu.show();
if (!arguments.length) {
return;
}
$sub_menu.show();
},
on_menu_action_loaded: function(data) {
var self = this;
if (data.action.length) {
var action = data.action[0][2];
action.from_menu = true;
self.on_action(action);
} else {
self.on_action({type: 'null_action'});
}
},
on_action: function(action) {
}
});
openerp.web.DropDownMenu = openerp.web.Widget.extend(/** @lends openerp.web.Header# */{
template: "DropDownMenu",
/**
* @constructs openerp.web.DropDownMenu
* @extends openerp.web.OldWidget
*
* @param parent
*/
init: function(parent) {
this._super(parent);
},
start: function() {
var self = this;
this._super.apply(this, arguments);
$('html').bind('click', function() {
self.$element.find('.oe_dropdown_options').hide();
});
this.$element.find('.oe_dropdown_toggle').click(function() {
self.$element.find('.oe_dropdown_options').toggle();
return false;
});
this.$element.find('.oe_dropdown_options li a').click(function() {
var f = self['on_menu_' + $(this).data('menu')];
f && f();
self.$element.find('.oe_dropdown_options').hide();
return false;
$(QWeb.render('DropDownMenu.shortcut', {'shortcuts': shortcuts}))
.appendTo(self.$element.find('.oe_dropdown_options'));
});
},
on_menu_logout: function() {
@ -1077,6 +945,29 @@ openerp.web.DropDownMenu = openerp.web.Widget.extend(/** @lends openerp.web.Hea
}).open();
action_manager.appendTo(this.dialog);
action_manager.render(this.dialog);
},
on_menu_about: function() {
var self = this;
self.rpc("/web/webclient/version_info", {}).then(function(res) {
var $help = $(QWeb.render("About-Page", {version_info: res}));
$help.find('a.oe_activate_debug_mode').click(function (e) {
e.preventDefault();
window.location = $.param.querystring(
window.location.href, 'debug');
});
openerp.web.dialog($help, {autoOpen: true,
modal: true, width: 960, title: _t("About")});
});
},
on_menu_shortcut: function($link) {
var self = this,
id = $link.data('id');
self.session.active_id = id;
self.rpc('/web/menu/action', {'menu_id': id}, function(ir_menu_data) {
if (ir_menu_data.action.length){
self.on_action(ir_menu_data.action[0][2]);
}
});
}
});
@ -1089,7 +980,7 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie
var self = this;
this._super(parent);
openerp.webclient = this;
this.querystring = '?' + jQuery.param.querystring();
this._current_state = null;
},
start: function() {
@ -1108,13 +999,13 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie
});
this.session.on_session_valid.add(function() {
self.show_application();
self.header.do_update();
self.dropdown_menu.do_update();
self.menu.do_reload();
if(self.action_manager)
self.action_manager.destroy();
self.action_manager = new openerp.web.ActionManager(self);
self.action_manager.appendTo($("#oe_app"));
self.action_manager.appendTo(self.$element.find('.oe_application'));
self.bind_hashchange();
var version_label = _t("OpenERP - Unsupported/Community Version");
if (!self.session.openerp_entreprise) {
@ -1136,16 +1027,13 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie
this.show_common();
self.$table = $(QWeb.render("WebClient", {}));
self.$element.append(self.$table);
self.header = new openerp.web.Header(self);
self.header.on_logout.add(this.proxy('on_logout'));
self.header.on_action.add(this.proxy('on_menu_action'));
self.header.appendTo($("#oe_header"));
self.menu = new openerp.web.Menu(self);
self.menu.replace(this.$element.find('.oe_menu_placeholder'));
self.menu.on_action.add(this.proxy('on_menu_action'));
self.dropdown_menu = new openerp.web.DropDownMenu(self);
self.dropdown_menu.replace(this.$element.find('.oe_dropdown_menu_placeholder'));
self.dropdown_menu.on_menu_logout.add(this.proxy('on_logout'));
self.dropdown_menu.on_action.add(this.proxy('on_menu_action'));
},
show_common: function() {
var self = this;

View File

@ -1938,9 +1938,13 @@ openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({
$cmenu.append(QWeb.render("FieldMany2One.context_menu", {widget: self}));
var bindings = {};
bindings[self.cm_id + "_search"] = function() {
if (self.readonly)
return;
self._search_create_popup("search");
};
bindings[self.cm_id + "_create"] = function() {
if (self.readonly)
return;
self._search_create_popup("form");
};
bindings[self.cm_id + "_open"] = function() {

View File

@ -23,32 +23,16 @@
<div class="oe_menu_placeholder"/>
<div class="oe_dropdown_menu_placeholder"/>
</div>
<div id="oe_header" class="header" style="display: none"></div>
<div class="oe_leftbar">
<!--
<a href="#" class="oe_logo"><img src="img/logo.png"/></a>
<a href="#" class="oe_logo"><img t-att-src='_s + "/web/static/src/img/logo.png"'/></a>
<div class="oe_secondary_menu"/>
<div class="oe_secondary_menus_container"/>
<div class="oe_footer">
Powered by <a href="http://www.openerp.com" class="openerp"><span class="red">Open</span>ERP</a>
Powered by <a href="http://www.openerp.com"><span>Open</span>ERP</a>
</div>
-->
</div>
<div class="oe_application">
<!-- This table will be removed as soon as we decide what will happen to the sidebar -->
<table cellspacing="0" cellpadding="0" border="0" height="100%" width="100%">
<tr>
<td valign="top" class="secondary_menu">
<div class="oe_secondary_menu"/>
</td>
<td valign="top" class="oe-application-container">
<div id="oe_app" class="oe-application">
</div>
</td>
</tr>
</table>
</div>
<div class="oe_application"/>
</div>
</t>
<t t-name="Loading">
@ -339,43 +323,6 @@
<div id="oe_db_options" class="oe_db_options"></div>
</div>
</t>
<t t-name="Header">
<div>
<a t-att-href="'/' + widget.qs" class="company_logo_link">
<div class="company_logo" />
</a>
</div>
</t>
<t t-name="Header-content">
<h1 class="header_title">
<t t-esc="user.company_id[1]"/> (<t t-esc="widget.session.db"/>)<br/>
<small class="username"><t t-esc="user.name"/></small>
</h1>
<div class="header_corner">
<ul class="block">
<li>
<a t-att-href="'/' + widget.qs" title="Home" class="home"><img t-att-src='_s + "/web/static/src/img/header-home.png"' width="16" height="16" border="0"/></a>
</li>
<li class="preferences">
<a href="javascript:void(0)" title="Preferences" class="preferences"><img t-att-src='_s + "/web/static/src/img/header-preferences.png"' width="16" height="16" border="0"/></a>
</li>
<li>
<a href="javascript:void(0)" title="About" class="about"><img t-att-src='_s + "/web/static/src/img/header-about.png"' width="16" height="16" border="0"/></a>
</li>
</ul>
<div class="block">
<a href="javascript:void(0)" class="logout">LOGOUT</a>
</div>
</div>
<div class="oe-shortcuts"> </div>
</t>
<ul t-name="Shortcuts">
<li t-foreach="shortcuts" t-as="shortcut"
t-att-data-id="shortcut.res_id"
t-att-data-shortcut-id="shortcut.id"
><t t-esc="shortcut.name"/></li>
</ul>
<t t-name="Menu">
<ul class="oe_menu" t-if="widget.data">
@ -389,42 +336,59 @@
<t t-name="Menu.secondary">
<div t-foreach="widget.data.data.children" t-as="menu" style="display: none" class="oe_secondary_menu" t-att-data-menu-parent="menu.id">
<t t-foreach="menu.children" t-as="menu">
<t t-set="classname" t-translation="off">oe_secondary_menu_item</t>
<t t-set="level" t-value="0"/>
<t t-call="Menu.secondary.children"/>
<div class="oe_secondary_menu_section">
<t t-esc="menu.name"/>
<!--
Shall the section be still clickable ?
<t t-call="Menu.secondary.link"/>
-->
</div>
<t t-call="Menu.secondary.submenu"/>
</t>
</div>
</t>
<t t-name="Menu.secondary.children">
<t t-set="level" t-value="level + 1"/>
<a href="#" t-att-id="menu.children.length ? 'menu_' + menu.id : undefined"
t-att-class="classname + (menu.children.length ? ' submenu' : ' leaf') + (menu_first and level == 1 ? ' opened' : '')"
t-att-data-menu="menu.children.length ? undefined : menu.id">
<span t-attf-style="padding-left: #{(level - 2) * 20}px"> <t t-esc="menu.name"/></span>
<t t-name="Menu.secondary.submenu">
<ul t-if="menu.children.length" class="oe_secondary_submenu">
<li t-foreach="menu.children" t-as="menu">
<t t-call="Menu.secondary.link"/>
<!--<span class="oe_menu_label">8</span>-->
<t t-call="Menu.secondary.submenu"/>
</li>
</ul>
</t>
<t t-name="Menu.secondary.link">
<a href="#"
t-att-class="menu.children.length ? 'oe_menu_toggler' : 'oe_menu_leaf'"
t-att-data-menu="menu.id">
<t t-esc="menu.name"/>
</a>
<div t-attf-class="oe_secondary_submenu" t-if="menu.children.length" t-att-style="menu_first and level == 1 ? undefined : 'display: none'">
<t t-foreach="menu.children" t-as="menu">
<t t-set="classname" t-translation="off">oe_secondary_submenu_item</t>
<t t-call="Menu.secondary.children"/>
</t>
</div>
</t>
<t t-name="DropDownMenu">
<ul class="oe_dropdown_menu oe_topbar_item">
<li class="oe_dropdown">
<a href="#" class="oe_dropdown_toggle">
<img class="oe_topbar_avatar" src="http://www.amigrave.com/ClarkGableSmall.jpg"/>
Clark Gable
<img class="oe_topbar_avatar" t-att-data-default-src="_s + '/web/static/src/img/topbar-avatar.png'"/>
<span class="oe_topbar_name"/>
</a>
<ul class="oe_dropdown_options">
<!--<li><a href="#" data-menu="profile">Profile</a></li>-->
<li><a href="#" data-menu="settings">Settings</a></li>
<li><a href="#" data-menu="logout">Log out</a></li>
<li><hr/></li>
<li><a href="#" data-menu="about">About OpenERP</a></li>
<li><hr/></li>
</ul>
</li>
</ul>
</t>
<t t-name="DropDownMenu.shortcut">
<li t-foreach="shortcuts" t-as="shortcut">
<a href="#" data-menu="shortcut" t-att-data-id="shortcut.res_id" t-att-data-shortcut-id="shortcut.id">
<t t-esc="shortcut.name"/>
</a>
</li>
</t>
<t t-name="ViewManager">
<table class="view-manager-main-table" cellpadding="0" cellspacing="0">

View File

@ -406,7 +406,6 @@ openerp.web_dashboard.ApplicationTiles = openerp.web.OldWidget.extend({
},
start: function() {
var self = this;
openerp.webclient.menu.do_hide_secondary();
var domain = [['application','=',true], ['state','=','installed'], ['name', '!=', 'base']];
var ds = new openerp.web.DataSetSearch(this, 'ir.module.module',{},domain);
ds.read_slice(['id']).then(function(result) {

View File

@ -0,0 +1,28 @@
# Polish translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-06 17:33+0100\n"
"PO-Revision-Date: 2012-02-28 11:09+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Polish <pl@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-02-29 04:54+0000\n"
"X-Generator: Launchpad (build 14874)\n"
#. openerp-web
#: addons/web_gantt/static/src/js/gantt.js:11
msgid "Gantt"
msgstr ""
#. openerp-web
#: addons/web_gantt/static/src/xml/web_gantt.xml:10
msgid "Create"
msgstr "Utwórz"

View File

@ -0,0 +1,23 @@
# Polish translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-06 17:33+0100\n"
"PO-Revision-Date: 2012-02-28 11:09+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Polish <pl@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-02-29 04:54+0000\n"
"X-Generator: Launchpad (build 14874)\n"
#. openerp-web
#: addons/web_graph/static/src/js/graph.js:19
msgid "Graph"
msgstr "Wykres"

View File

@ -0,0 +1,53 @@
# Polish translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-14 15:27+0100\n"
"PO-Revision-Date: 2012-02-28 11:13+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Polish <pl@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-02-29 04:54+0000\n"
"X-Generator: Launchpad (build 14874)\n"
#. openerp-web
#: addons/web_kanban/static/src/js/kanban.js:10
msgid "Kanban"
msgstr ""
#. openerp-web
#: addons/web_kanban/static/src/js/kanban.js:294
msgid "Undefined"
msgstr "Niezdefiniowane"
#. openerp-web
#: addons/web_kanban/static/src/js/kanban.js:469
msgid "Are you sure you want to delete this record ?"
msgstr "Jesteś pewien, że chcesz usunąć ten rekord?"
#. openerp-web
#: addons/web_kanban/static/src/xml/web_kanban.xml:5
msgid "Create"
msgstr "Utwórz"
#. openerp-web
#: addons/web_kanban/static/src/xml/web_kanban.xml:41
msgid "Show more... ("
msgstr "Pokaż więcej...("
#. openerp-web
#: addons/web_kanban/static/src/xml/web_kanban.xml:41
msgid "remaining)"
msgstr "pozostało)"
#. openerp-web
#: addons/web_kanban/static/src/xml/web_kanban.xml:59
msgid "</tr><tr>"
msgstr ""

View File

@ -0,0 +1,118 @@
# Polish translation for openerp-web
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-07 19:19+0100\n"
"PO-Revision-Date: 2012-02-28 11:14+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Polish <pl@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-02-29 04:54+0000\n"
"X-Generator: Launchpad (build 14874)\n"
#. openerp-web
#: addons/web_process/static/src/js/process.js:261
msgid "Cancel"
msgstr "Anuluj"
#. openerp-web
#: addons/web_process/static/src/js/process.js:262
msgid "Save"
msgstr "Zapisz"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:6
msgid "Process View"
msgstr "Widok procesu"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:19
msgid "Documentation"
msgstr "Dokumentacja"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:19
msgid "Read Documentation Online"
msgstr "Czytaj dokumentację online"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:25
msgid "Forum"
msgstr ""
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:25
msgid "Community Discussion"
msgstr "Dyskusja w społeczności"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:31
msgid "Books"
msgstr "Książki"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:31
msgid "Get the books"
msgstr "Pobierz książki"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:37
msgid "OpenERP Enterprise"
msgstr ""
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:37
msgid "Purchase OpenERP Enterprise"
msgstr ""
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:52
msgid "Process"
msgstr ""
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:56
msgid "Notes:"
msgstr "Notatki:"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:59
msgid "Last modified by:"
msgstr "Ostatnio modyfikowane przez:"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:59
msgid "N/A"
msgstr ""
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:62
msgid "Subflows:"
msgstr "Podobiegi:"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:75
msgid "Related:"
msgstr "Związane:"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:88
msgid "Select Process"
msgstr "Wybierz proces"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:98
msgid "Select"
msgstr "Wybierz"
#. openerp-web
#: addons/web_process/static/src/xml/web_process.xml:109
msgid "Edit Process"
msgstr "Edytuj proces"