wip
bzr revid: nicolas.vanhoren@openerp.com-20120803140413-cik08mkxcohd4698
This commit is contained in:
parent
56227098e4
commit
def89041dc
|
@ -9,4 +9,20 @@
|
||||||
|
|
||||||
.openerp .oe_linkedin_input {
|
.openerp .oe_linkedin_input {
|
||||||
margin-right:1.5em;
|
margin-right:1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.openerp .oe_linkedin_people {
|
||||||
|
text-align: center;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.openerp .oe_linkedin_people .oe_linkedin_thumb {
|
||||||
|
width: 70px;
|
||||||
|
height: 70px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.openerp .oe_linkedin_people img {
|
||||||
|
max-width: 70px;
|
||||||
|
max-height: 70px;
|
||||||
}
|
}
|
|
@ -60,7 +60,6 @@ openerp.web_linkedin = function(instance) {
|
||||||
instance.web_linkedin.Linkedin = instance.web.form.FieldChar.extend({
|
instance.web_linkedin.Linkedin = instance.web.form.FieldChar.extend({
|
||||||
init: function() {
|
init: function() {
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
var self = this;
|
|
||||||
this.display_dm = new instance.web.DropMisordered(true);
|
this.display_dm = new instance.web.DropMisordered(true);
|
||||||
},
|
},
|
||||||
initialize_content: function() {
|
initialize_content: function() {
|
||||||
|
@ -75,9 +74,16 @@ openerp.web_linkedin = function(instance) {
|
||||||
search_linkedin: function() {
|
search_linkedin: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
this.display_dm.add(instance.web_linkedin.tester.test_linkedin()).then(function() {
|
this.display_dm.add(instance.web_linkedin.tester.test_linkedin()).then(function() {
|
||||||
new instance.web_linkedin.LinkedinPopup(self, self.get("value")).open();
|
var pop = new instance.web_linkedin.LinkedinPopup(self, self.get("value"));
|
||||||
|
pop.open();
|
||||||
|
pop.on("selected", this, function(entity) {
|
||||||
|
self.selected_entity(entity);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
selected_entity: function(entity) {
|
||||||
|
debugger;
|
||||||
|
},
|
||||||
});
|
});
|
||||||
instance.web.form.widgets.add('linkedin', 'instance.web_linkedin.Linkedin');
|
instance.web.form.widgets.add('linkedin', 'instance.web_linkedin.Linkedin');
|
||||||
|
|
||||||
|
@ -86,7 +92,7 @@ openerp.web_linkedin = function(instance) {
|
||||||
init: function(parent, text) {
|
init: function(parent, text) {
|
||||||
this._super(parent);
|
this._super(parent);
|
||||||
this.text = text;
|
this.text = text;
|
||||||
this.limit = 10;
|
this.limit = 15;
|
||||||
},
|
},
|
||||||
start: function() {
|
start: function() {
|
||||||
this._super();
|
this._super();
|
||||||
|
@ -127,7 +133,6 @@ openerp.web_linkedin = function(instance) {
|
||||||
},
|
},
|
||||||
display_result: function() {
|
display_result: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
self.$element.html("<div style='display: table;width:100%'/>");
|
|
||||||
var i = 0;
|
var i = 0;
|
||||||
var $row;
|
var $row;
|
||||||
_.each(self.result, function(el) {
|
_.each(self.result, function(el) {
|
||||||
|
@ -138,6 +143,10 @@ openerp.web_linkedin = function(instance) {
|
||||||
}
|
}
|
||||||
pc.appendTo($row);
|
pc.appendTo($row);
|
||||||
pc.$element.css("display", "table-cell");
|
pc.$element.css("display", "table-cell");
|
||||||
|
pc.$element.css("width", "20%");
|
||||||
|
pc.on("selected", self, function(data) {
|
||||||
|
self.trigger("selected", data);
|
||||||
|
});
|
||||||
i++;
|
i++;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -150,8 +159,15 @@ openerp.web_linkedin = function(instance) {
|
||||||
this.data = data;
|
this.data = data;
|
||||||
},
|
},
|
||||||
start: function() {
|
start: function() {
|
||||||
|
var self = this;
|
||||||
|
this.$element.click(function() {
|
||||||
|
self.trigger("selected", self.data);
|
||||||
|
});
|
||||||
if (this.data.__type === "company") {
|
if (this.data.__type === "company") {
|
||||||
this.$("h3").text(this.data.name);
|
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);
|
||||||
|
});
|
||||||
} else { // people
|
} else { // people
|
||||||
this.$("h3").text(_.str.sprintf("%s %s", this.data.firstName, this.data.lastName));
|
this.$("h3").text(_.str.sprintf("%s %s", this.data.firstName, this.data.lastName));
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,12 +10,15 @@
|
||||||
<div>
|
<div>
|
||||||
<script type="in/Login">
|
<script type="in/Login">
|
||||||
</script>
|
</script>
|
||||||
|
<div style='display: table;width:100%'/>
|
||||||
</div>
|
</div>
|
||||||
</t>
|
</t>
|
||||||
<t t-name="PeopleCompany">
|
<t t-name="PeopleCompany">
|
||||||
<div>
|
<div class="oe_linkedin_people">
|
||||||
<h3 />
|
<span class="oe_linkedin_thumb">
|
||||||
<img />
|
<img />
|
||||||
|
</span>
|
||||||
|
<h3/>
|
||||||
</div>
|
</div>
|
||||||
</t>
|
</t>
|
||||||
</templates>
|
</templates>
|
Loading…
Reference in New Issue