[FIX] Fixed styling of the stagesbar.

bzr revid: vta@openerp.com-20120808121654-79zztekljxzawpna
This commit is contained in:
vta vta@openerp.com 2012-08-08 14:16:54 +02:00
parent d3441f111b
commit 52a01828c6
3 changed files with 131 additions and 83 deletions

View File

@ -1940,13 +1940,118 @@
.openerp .oe_form div.oe_form_configuration label {
min-width: 150px;
}
.openerp ul.oe_form_steps_clickable {
height: 30px;
margin: 0;
padding: 0;
text-shadow: 0 1px 1px #cacaca;
box-shadow: 0 0 1px rgba(0,0,0,0.5);
overflow: hidden;
}
.openerp ul.oe_form_steps_clickable li {
text-decoration: none;
padding: 0 0 0 30px;
position: relative;
display: block;
float: left;
height: 30px;
color: white;
}
.openerp ul.oe_form_steps_clickable li.oe_form_steps_active {
font-weight: bold;
text-shadow: 0 1px 1px #999999;
box-shadow: inset 0 -1px 1px rgba(0,0,0,0.25), inset 0 1px 1px rgba(255,255,255,0.25);
background-color: #dc5f59;
background: -webkit-linear-gradient(top, #dc5f59, #b33630);
color: white;
}
.openerp ul.oe_form_steps_clickable li.oe_form_steps_inactive {
display: block;
cursor: pointer;
box-shadow: inset 0 -1px 1px rgba(0,0,0,0.25), inset 0 1px 1px rgba(255,255,255,0.25);
background-color: #adadcf;
background: -webkit-linear-gradient(top, #adadcf, #7c7ba7);
}
.openerp ul.oe_form_steps_clickable li div {
padding: 0 30px 0 0;
}
.openerp ul.oe_form_steps_clickable .oe_form_steps_inactive:hover {
background: -webkit-linear-gradient(top, #7c7ba7, #adadcf);
}
.openerp ul.oe_form_steps_clickable li:after {
content: " ";
display: block;
width: 0;
height: 0;
border-top: 21px solid transparent;
border-bottom: 21px solid transparent;
border-left: 5px solid #807fb4;
position: absolute;
top: 50%;
margin-top: -21px;
left: 100%;
z-index: 2;
}
.openerp ul.oe_form_steps_clickable li:hover:after {
border-left: 5px solid #8a89ba;
}
.openerp ul.oe_form_steps_clickable li:before {
content: " ";
display: block;
width: 0;
height: 0;
border-top: 21px solid transparent;
border-bottom: 21px solid transparent;
border-left: 5px solid white;
position: absolute;
top: 50%;
margin-top: -21px;
margin-left: 2px;
left: 100%;
z-index: 2;
}
.openerp ul.oe_form_steps_clickable li.oe_form_steps_active {
font-weight: bold;
text-shadow: 0 1px 1px #999999;
background: -webkit-linear-gradient(top, #dc5f59, #b33630);
color: white;
}
.openerp ul.oe_form_steps_clickable li.oe_form_steps_active:after {
content: "";
display: block;
width: 0;
height: 0;
border-top: 21px solid transparent;
border-bottom: 21px solid transparent;
border-left: 5px solid #b33630;
position: absolute;
top: 50%;
margin-top: -21px;
left: 100%;
z-index: 2;
}
.openerp ul.oe_form_steps_clickable li.oe_form_steps_active:before {
content: "";
display: block;
width: 0;
height: 0;
border-top: 21px solid transparent;
border-bottom: 21px solid transparent;
border-left: 5px solid white;
position: absolute;
top: 50%;
margin-top: -21px;
margin-left: 2px;
left: 100%;
z-index: 2;
}
.openerp ul.oe_form_steps {
height: 30px;
padding: 0;
margin: 0;
text-shadow: 0 1px 1px white;
/*background: #dfdfdf;*/
overflow: hidden;
}
.openerp ul.oe_form_steps img {
vertical-align: top;
@ -1954,7 +2059,7 @@
}
.openerp ul.oe_form_steps li {
border-right: none;
padding: 0px;
padding: 0;
margin: 0;
float: left;
vertical-align: top;
@ -1962,90 +2067,25 @@
padding: 0 0 0 12px;
}
.openerp ul.oe_form_steps li:first-child {
padding-left: 12px;
border-left: 1px solid #cacaca;
}
.openerp ul.oe_form_steps li:last-child {
margin-right: 12px;
/*padding-right: 12px;*/
padding-right: 12px;
border-right: 1px solid #cacaca;
}
.openerp ul.oe_form_steps li {
.openerp ul.oe_form_steps li a {
color: #4c4c4c;
text-decoration: none;
padding: 0 0 0 30px;
position: relative;
display: block;
float: left;
height: 30px;
background-color: #8a89ba;
color: white;
}
.openerp ul.oe_form_steps li span {
display:block;
margin-left: 10px;
}
.openerp ul.oe_form_steps li a:hover {
color: black;
}
.openerp ul.oe_form_steps li:after {
content: " ";
display: :block;
width: 0;
height: 0;
border-top: 50px solid transparent;
border-bottom: 50px solid transparent;
border-left: 30px solid #8a89ba;
position: absolute;
top: 50%;
margin-top: -50px;
left: 100%;
z-index: 2;
}
.openerp ul.oe_form_steps li:before {
content: " ";
display: :block;
width: 0;
height: 0;
border-top: 50px solid transparent;
border-bottom: 50px solid transparent;
border-left: 30px solid #eeeeee;
position: absolute;
top: 50%;
margin-top: -50px;
margin-left: 2px;
left: 100%;
z-index: 1;
}
.openerp ul.oe_form_steps li:hover {
background: #807fb4;
}
.openerp ul.oe_form_steps li:hover:after {
border-left-color: #807fb4;
}
.openerp ul.oe_form_steps li.oe_form_steps_active {
.openerp ul.oe_form_steps .oe_form_steps_active {
font-weight: bold;
/*color: #b33630;*/
text-shadow: 0 1px 1px #999999;
/*background-color: #dc5f59;*/
background-color: #b33630;
color: white;
}
.openerp ul.oe_form_steps li.oe_form_steps_active:after {
content: " ";
display: :block;
width: 0;
height: 0;
border-top: 50px solid transparent;
border-bottom: 50px solid transparent;
/*border-left: 30px solid #dc5f59;*/
border-left: 30px solid #b33630;
position: absolute;
top: 50%;
margin-top: -50px;
left: 100%;
z-index: 2;
color: #b33630;
}
.openerp .oe_form .oe_subtotal_footer {
width: 1% !important;
}

View File

@ -4590,9 +4590,11 @@ instance.web.form.FieldBinaryImage = instance.web.form.FieldBinary.extend({
instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({
template: "FieldStatus",
clickable: false,
start: function() {
this._super();
this.selected_value = null;
this.clickable = !!this.node.attrs.clickable;
if (this.$element.parent().is('header')) {
this.$element.after('<div class="oe_clear"/>');
}
@ -4700,22 +4702,23 @@ instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({
var self = this;
var content = instance.web.qweb.render("FieldStatus.content", {widget: this, _:_});
this.$element.html(content);
clickable = this.node.attrs.clickable;
if (clickable != undefined && (clickable.toLowerCase() === 'true' || clickable === "1")) {
var elemts = this.$element.find('.oe_form_steps_item')
if (this.clickable) {
this.$element.addClass("oe_form_steps_clickable");
$('.oe_form_steps_arrow').remove();
var elemts = this.$element.find('.oe_form_steps_button');
_.each(elemts, function(element){
$item = $(element);
if ($item.attr("data-id") != self.selected_value) {
$item.attr("style", "cursor: pointer;");
$item.click(function(event){
var data_id = parseInt($(this).attr("data-id"))
self.view.dataset.call('stage_set', [[self.view.datarecord.id],data_id]).then(function() {
return self.view.reload();
});
});
} else {
}
});
} else {
this.$element.addClass("oe_form_steps");
}
var colors = JSON.parse((this.node.attrs || {}).statusbar_colors || "{}");
var color = colors[this.selected_value];

View File

@ -1026,14 +1026,19 @@
</span>
</t>
<t t-name="FieldStatus">
<ul class="oe_form_steps" t-att-style="widget.node.attrs.style"/>
<ul class="" t-att-style="widget.node.attrs.style"/>
</t>
<t t-name="FieldStatus.content">
<t t-set="size" t-value="widget.to_show.length"/>
<t t-foreach="_.range(size)" t-as="i">
<li t-att-class="widget.to_show[i][0] === widget.selected_value ? 'oe_form_steps_active' : ''">
<span class="oe_form_steps_item" t-att-data-id="widget.to_show[i][0]"><t t-esc="widget.to_show[i][1]"/></span>
<img t-att-src='_s + "/web/static/src/img/form_steps.png"' class="oe_form_steps_arrow" t-if="i &lt; size - 1"/>
<li t-att-class="widget.to_show[i][0] === widget.selected_value ? 'oe_form_steps_active' : 'oe_form_steps_inactive'">
<div class="oe_form_steps_button" t-att-data-id="widget.to_show[i][0]">
<t t-esc="widget.to_show[i][1]"/>
<span class="oe_form_steps_arrow">
<span></span>
</span>
<img t-att-src='_s + "/web/static/src/img/form_steps.png"' class="oe_form_steps_arrow" t-if="i &lt; size - 1"/>
</div>
</li>
</t>
</t>