Finally got something correct with the thumbnails

bzr revid: nicolas.vanhoren@openerp.com-20120803144150-t4b2xvpwwj53khp8
This commit is contained in:
niv-openerp 2012-08-03 16:41:50 +02:00
parent def89041dc
commit e060a3275f
3 changed files with 28 additions and 14 deletions

View File

@ -11,18 +11,25 @@
margin-right:1.5em;
}
.openerp .oe_linkedin_people {
.openerp .oe_linkedin_entity {
text-align: center;
cursor: pointer;
}
.openerp .oe_linkedin_people .oe_linkedin_thumb {
width: 70px;
.openerp .oe_linkedin_entity .oe_linkedin_thumb {
width: 70px;
height: 70px;
display: inline-block;
text-align: center;
}
.openerp .oe_linkedin_people img {
.openerp .oe_linkedin_entity .oe_linkedin_thumb span {
height: 70px;
display: table-cell;
vertical-align: middle;
}
.openerp .oe_linkedin_entity img {
max-width: 70px;
max-height: 70px;
}

View File

@ -82,7 +82,11 @@ openerp.web_linkedin = function(instance) {
});
},
selected_entity: function(entity) {
debugger;
if (entity.__type === "company") {
} else { //people
}
},
});
instance.web.form.widgets.add('linkedin', 'instance.web_linkedin.Linkedin');
@ -136,7 +140,7 @@ openerp.web_linkedin = function(instance) {
var i = 0;
var $row;
_.each(self.result, function(el) {
var pc = new instance.web_linkedin.PeopleCompany(self, el);
var pc = new instance.web_linkedin.EntityWidget(self, el);
if (i % 5 === 0) {
$row = $("<div style='display: table-row;width:100%'/>");
$row.appendTo(self.$(">div"));
@ -152,8 +156,8 @@ openerp.web_linkedin = function(instance) {
},
});
instance.web_linkedin.PeopleCompany = instance.web.Widget.extend({
template: "PeopleCompany",
instance.web_linkedin.EntityWidget = instance.web.Widget.extend({
template: "EntityWidget",
init: function(parent, data) {
this._super(parent);
this.data = data;
@ -165,9 +169,10 @@ openerp.web_linkedin = function(instance) {
});
if (this.data.__type === "company") {
this.$("h3").text(this.data.name);
IN.API.Raw(_.str.sprintf("companies/%d:(logo-url)", this.data.id)).result(function (result) {
self.$("img").attr("src", result.logoUrl);
});
//IN.API.Raw(_.str.sprintf("companies/%d:(logo-url)", this.data.id)).result(function (result) {
// self.$("img").attr("src", result.logoUrl);
//});
self.$("img").attr("src", "http://m3.licdn.com/media/p/2/000/03b/36c/283399d.png");
} else { // people
this.$("h3").text(_.str.sprintf("%s %s", this.data.firstName, this.data.lastName));
}

View File

@ -13,10 +13,12 @@
<div style='display: table;width:100%'/>
</div>
</t>
<t t-name="PeopleCompany">
<div class="oe_linkedin_people">
<t t-name="EntityWidget">
<div class="oe_linkedin_entity">
<span class="oe_linkedin_thumb">
<img />
<span>
<img />
</span>
</span>
<h3/>
</div>