[IMP] web_linkedin: url with linkedin image
bzr revid: chm@openerp.com-20130205101445-9ffl4r64j11lkvv9
This commit is contained in:
@@ -1,12 +1,18 @@
|
||||
|
||||
|
||||
.openerp .oe_linkedin_img {
|
||||
.openerp .oe_linkedin_form_img {
|
||||
float: right;
|
||||
width: 1.5em;
|
||||
margin-top: -1px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.openerp .oe_linkedin_img {
|
||||
width: 1em;
|
||||
margin-top: -2px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.openerp .oe_linkedin_input {
|
||||
margin-right:1.5em;
|
||||
}
|
||||
|
||||
@@ -148,13 +148,24 @@ openerp.web_linkedin = function(instance) {
|
||||
this.display_dm = new instance.web.DropMisordered(true);
|
||||
},
|
||||
initialize_content: function() {
|
||||
var $ht = $(QWeb.render("FieldChar.linkedin"));
|
||||
var $ht = $(QWeb.render("FieldChar.linkedin.form"));
|
||||
var $in = this.$("input");
|
||||
$in.replaceWith($ht);
|
||||
this.$(".oe_linkedin_input").append($in);
|
||||
this.$(".oe_linkedin_img").click(_.bind(this.search_linkedin, this));
|
||||
this.$(".oe_linkedin_form_img").click(_.bind(this.search_linkedin, this));
|
||||
|
||||
var $ht = $(QWeb.render("FieldChar.linkedin"));
|
||||
var $span = this.$("span");
|
||||
$span.replaceWith($ht);
|
||||
this.$(".oe_linkedin_span").replaceWith($span);
|
||||
|
||||
this._super();
|
||||
},
|
||||
render_value: function() {
|
||||
var result = this._super();
|
||||
this.$(".oe_linkedin_url").attr("href", this.field_manager.datarecord.linkedin_url || "#").toggle(!!this.field_manager.datarecord.linkedin_url);
|
||||
return result;
|
||||
},
|
||||
search_linkedin: function() {
|
||||
var self = this;
|
||||
this.display_dm.add(instance.web_linkedin.tester.test_linkedin()).done(function() {
|
||||
|
||||
@@ -2,10 +2,14 @@
|
||||
<!-- vim:fdl=1:
|
||||
-->
|
||||
<templates xml:space="preserve">
|
||||
<t t-name="FieldChar.linkedin">
|
||||
<img class="oe_linkedin_img" t-att-src='_s + "/web_linkedin/static/src/img/Linkedin_blue.png"'/>
|
||||
<t t-name="FieldChar.linkedin.form">
|
||||
<img class="oe_linkedin_form_img" t-att-src='_s + "/web_linkedin/static/src/img/Linkedin_blue.png"'/>
|
||||
<div class="oe_linkedin_input"/>
|
||||
</t>
|
||||
<t t-name="FieldChar.linkedin">
|
||||
<div class="oe_linkedin_span"/>
|
||||
<a class="oe_linkedin_url" href="#" target="_blank"><img class="oe_linkedin_img" t-att-src='_s + "/web_linkedin/static/src/img/Linkedin_blue.png"'/></a>
|
||||
</t>
|
||||
<t t-name="Linkedin.popup">
|
||||
<div>
|
||||
<h2 style="margin-top:-10px;">People</h2>
|
||||
|
||||
@@ -7,12 +7,9 @@
|
||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="replace">
|
||||
<field name="name" default_focus="1" nolabel="1" widget="linkedin" />
|
||||
</field>
|
||||
<field name="website" position="after">
|
||||
<field name="linkedin_id" invisible="1"/>
|
||||
<field name="linkedin_url" invisible="1"/>
|
||||
<field name="linkedin_public_url" widget="url" placeholder="LinkedIn url automatically set..."/>
|
||||
<field name="name" default_focus="1" nolabel="1" widget="linkedin" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user