[IMP] web_linkedin: added headline

bzr revid: nicolas.vanhoren@openerp.com-20120822082701-uohx12i2jhdao39r
This commit is contained in:
niv-openerp 2012-08-22 10:27:01 +02:00
parent 0149301e0a
commit cd0b2b10e5
3 changed files with 19 additions and 7 deletions

View File

@ -32,4 +32,13 @@
.openerp .oe_linkedin_entity img {
max-width: 70px;
max-height: 70px;
}
}
.openerp .oe_linkedin_entity h3 {
margin-bottom: 5px;
}
.openerp .oe_linkedin_entity .oe_linkedin_entity_headline {
color: grey;
margin-bottom: 10px;
}

View File

@ -102,11 +102,11 @@ openerp.web_linkedin = function(instance) {
if (entity.__type === "company") {
to_change.is_company = true;
to_change.name = entity.name;
to_change.photo = false;
to_change.image = false;
if (entity.logoUrl) {
defs.push(self.rpc('/web_linkedin/binary/url2binary',
{'url': entity.logoUrl}).pipe(function(data){
to_change.photo = data;
to_change.image = data;
}));
}
to_change.website = entity.websiteUrl;
@ -138,11 +138,11 @@ openerp.web_linkedin = function(instance) {
} else { // people
to_change.is_company = false;
to_change.name = entity.formattedName;
to_change.photo = false;
to_change.image = false;
if (entity.pictureUrl) {
defs.push(self.rpc('/web_linkedin/binary/url2binary',
{'url': entity.pictureUrl}).pipe(function(data){
to_change.photo = data;
to_change.image = data;
}));
}
to_change.mobile = false;
@ -154,7 +154,8 @@ openerp.web_linkedin = function(instance) {
to_change.phone = el.phoneNumber;
}
});
to_change.function = entity.headline;
var positions = entity.positions.values || [];
to_change.function = positions ? positions[0].title : false;
/* TODO
to_change.linkedinUrl = entity.publicProfileUrl;
*/
@ -169,7 +170,7 @@ openerp.web_linkedin = function(instance) {
var commonPeopleFields = ["id", "picture-url", "public-profile-url",
"formatted-name", "location", "phone-numbers", "im-accounts",
"main-address", "headline"];
"main-address", "headline", "positions"];
instance.web_linkedin.LinkedinPopup = instance.web.Dialog.extend({
template: "Linkedin.popup",
@ -261,6 +262,7 @@ openerp.web_linkedin = function(instance) {
} else { // people
this.$("h3").text(this.data.formattedName);
self.$("img").attr("src", this.data.pictureUrl);
self.$(".oe_linkedin_entity_headline").text(this.data.headline);
}
},
});

View File

@ -21,6 +21,7 @@
</span>
</span>
<h3/>
<div class="oe_linkedin_entity_headline" />
</div>
</t>
<t t-name="LinkedIn.DisabledWarning">